/* Tool-specific styles only - base styles are in tool-layout.css */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #0a0a0a;
    color: #e5e7eb;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: #141414;
    border-bottom: 1px solid #374151;
    z-index: 100;
}

    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

    margin-top: 60px;
    padding: 48px 24px;
    text-align: center;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    max-width: 720px;
    margin: 0 auto;
}

.tool-main {
    flex: 1;
    padding: 32px 24px 120px;
}

.tool-container {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 48px;
}

.input-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.input-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
    background-color: #141414;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 4px;
}

.card-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-group > label {
    font-size: 14px;
    font-weight: 500;
    color: #e5e7eb;
}

.required {
    color: #ef4444;
}

.input-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.input-row > .input-group {
    flex: 1;
    min-width: 0;
}

.text-input {
    background-color: #1a1a1a;
    border: 1px solid #2a2a2a;
    color: #e5e7eb;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 150ms ease, box-shadow 150ms ease;
    width: 100%;
}

.text-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.text-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.text-input::placeholder {
    color: #6b7280;
}

.textarea-input {
    resize: vertical;
    min-height: 56px;
}

.select-input {
    background-color: #1a1a1a;
    border: 1px solid #2a2a2a;
    color: #e5e7eb;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239ca3af' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    transition: border-color 150ms ease, box-shadow 150ms ease;
    width: 100%;
}

.select-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.select-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.select-input option {
    background-color: #1a1a1a;
}

.color-input {
    width: 48px;
    height: 36px;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    background-color: #1a1a1a;
    cursor: pointer;
    padding: 2px;
}

.color-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.field-error {
    font-size: 13px;
    color: #ef4444;
    min-height: 0;
}

.field-error:not(:empty) {
    min-height: 18px;
}

.items-header {
    display: flex;
    gap: 8px;
    padding: 0 0 8px;
    border-bottom: 1px solid #2a2a2a;
}

.item-col-desc { flex: 1; min-width: 0; }

.item-col-qty { width: 60px; }

.item-col-price { width: 90px; }

.item-col-total { width: 80px; }

.item-col-del { width: 36px; }

.items-header span {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.item-col-qty,
.item-col-price,
.item-col-total {
    text-align: right;
}

.item-col-del {
    text-align: center;
}

.line-item-row {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(42, 42, 42, 0.5);
}

.line-item-row .item-desc { flex: 1; min-width: 0; }

.line-item-row .item-qty { width: 60px; }

.line-item-row .item-price { width: 90px; }

.line-item-row:last-child {
    border-bottom: none;
}

.line-item-row .text-input {
    padding: 8px 10px;
    font-size: 13px;
}

.line-item-row input[type="number"] {
    text-align: right;
}

.item-total {
    font-size: 13px;
    font-weight: 500;
    color: #e5e7eb;
    text-align: right;
    width: 80px;
    flex-shrink: 0;
}

.item-delete-btn {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color 150ms ease, background-color 150ms ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.item-delete-btn:hover {
    color: #ef4444;
    background-color: rgba(239, 68, 68, 0.1);
}

.add-item-btn {
    align-self: flex-start;
    padding: 8px 16px;
    font-size: 13px;
}

.totals-display {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    background-color: #1a1a1a;
    border-radius: 6px;
    margin-top: 8px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.total-label {
    font-size: 14px;
    color: #a0a0a0;
}

.total-value {
    font-size: 14px;
    font-weight: 500;
    color: #e5e7eb;
}

.total-discount {
    color: #ef4444;
}

.total-row-final {
    border-top: 1px solid #2a2a2a;
    padding-top: 8px;
    margin-top: 4px;
}

.total-final {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
}

.generate-btn {
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
}

.button-primary {
    background-color: #3b82f6;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    border: none;
    cursor: pointer;
    transition: background-color 150ms ease;
    text-align: center;
}

.button-secondary {
    background-color: #1a1a1a;
    color: #e5e7eb;
    border: 1px solid #2a2a2a;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 150ms ease, border-color 150ms ease;
    text-align: center;
}

.button-small {
    padding: 6px 12px;
    font-size: 13px;
}

.button-download {
    background-color: #059669;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    border: none;
    cursor: pointer;
    transition: background-color 150ms ease;
    text-align: center;
    width: 100%;
}

.output-section {
    background-color: #141414;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.output-header h3 {
    font-size: 20px;
    font-weight: 600;
    line-height: 28px;
    color: #ffffff;
}

.receipt-preview-wrapper {
    display: flex;
    justify-content: center;
    padding: 24px;
    background-color: #0a0a0a;
    border-radius: 8px;
}

.receipt-preview {
    background-color: rgb(255, 255, 255);
    color: #000000;
    padding: 24px 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
    position: relative;
}

.receipt-thermal {
    width: 302px;
    max-width: 100%;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    line-height: 1.4;
}

.receipt-thermal .receipt-business-name {
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 4px;
    word-wrap: break-word;
}

.receipt-thermal .receipt-business-detail {
    font-size: 12px;
    text-align: center;
    color: #333333;
}

.receipt-thermal .receipt-separator {
    border: none;
    border-top: 1px dashed #999999;
    margin: 8px 0;
}

.receipt-thermal .receipt-double-separator {
    border: none;
    border-top: 3px double #000000;
    margin: 8px 0;
}

.receipt-thermal .receipt-info-line {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
}

.receipt-thermal .receipt-item-line {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    padding: 2px 0;
}

.receipt-thermal .receipt-item-desc {
    flex: 1;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 70%;
}

.receipt-thermal .receipt-item-amount {
    text-align: right;
    white-space: nowrap;
    padding-left: 8px;
}

.receipt-thermal .receipt-total-line {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    padding: 2px 0;
}

.receipt-thermal .receipt-total-line.receipt-grand-total {
    font-size: 14px;
    font-weight: 700;
}

.receipt-thermal .receipt-footer-msg {
    text-align: center;
    font-size: 12px;
    color: #333333;
    margin-top: 4px;
    word-wrap: break-word;
}

.receipt-thermal .receipt-logo {
    display: block;
    max-width: 120px;
    max-height: 60px;
    margin: 0 auto 8px;
}

.receipt-a4 {
    width: 595px;
    max-width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    padding: 32px;
}

.receipt-a4 .receipt-business-name {
    font-size: 22px;
    font-weight: 700;
    text-align: left;
    margin-bottom: 4px;
}

.receipt-a4 .receipt-business-detail {
    font-size: 14px;
    text-align: left;
    color: #555555;
}

.receipt-a4 .receipt-separator {
    border: none;
    border-top: 1px solid #dddddd;
    margin: 12px 0;
}

.receipt-a4 .receipt-double-separator {
    border: none;
    border-top: 2px solid #000000;
    margin: 12px 0;
}

.receipt-a4 .receipt-info-line {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.receipt-a4 .receipt-items-table {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0;
}

.receipt-a4 .receipt-items-table th {
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666666;
    padding: 8px 4px;
    border-bottom: 2px solid #dddddd;
}

.receipt-a4 .receipt-items-table th:last-child,
.receipt-a4 .receipt-items-table td:last-child {
    text-align: right;
}

.receipt-a4 .receipt-items-table td {
    padding: 8px 4px;
    border-bottom: 1px solid #eeeeee;
    font-size: 14px;
}

.receipt-a4 .receipt-item-line {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    padding: 4px 0;
}

.receipt-a4 .receipt-item-desc {
    flex: 1;
}

.receipt-a4 .receipt-item-amount {
    text-align: right;
    padding-left: 16px;
}

.receipt-a4 .receipt-total-line {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    padding: 4px 0;
}

.receipt-a4 .receipt-total-line.receipt-grand-total {
    font-size: 18px;
    font-weight: 700;
}

.receipt-a4 .receipt-footer-msg {
    text-align: left;
    font-size: 13px;
    color: #666666;
    margin-top: 8px;
}

.receipt-a4 .receipt-logo {
    display: block;
    max-width: 160px;
    max-height: 80px;
    margin-bottom: 12px;
}

.receipt-halfpage {
    width: 420px;
    max-width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 13px;
    line-height: 1.5;
    padding: 24px;
}

.receipt-halfpage .receipt-business-name {
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 4px;
}

.receipt-halfpage .receipt-business-detail {
    font-size: 13px;
    text-align: center;
    color: #555555;
}

.receipt-halfpage .receipt-separator {
    border: none;
    border-top: 1px solid #cccccc;
    margin: 10px 0;
}

.receipt-halfpage .receipt-double-separator {
    border: none;
    border-top: 2px solid #000000;
    margin: 10px 0;
}

.receipt-halfpage .receipt-info-line {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.receipt-halfpage .receipt-item-line {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 3px 0;
}

.receipt-halfpage .receipt-item-desc {
    flex: 1;
}

.receipt-halfpage .receipt-item-amount {
    text-align: right;
    padding-left: 12px;
}

.receipt-halfpage .receipt-total-line {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 3px 0;
}

.receipt-halfpage .receipt-total-line.receipt-grand-total {
    font-size: 16px;
    font-weight: 700;
}

.receipt-halfpage .receipt-footer-msg {
    text-align: center;
    font-size: 12px;
    color: #555555;
    margin-top: 6px;
}

.receipt-halfpage .receipt-logo {
    display: block;
    max-width: 140px;
    max-height: 70px;
    margin: 0 auto 10px;
}

.receipt-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pro-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pro-feature-card {
    opacity: 0.7;
    transition: opacity 150ms ease;
}

.pro-feature-card.unlocked {
    opacity: 1;
}

.pro-badge {
    color: #0a0a0a;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    flex-shrink: 0;
}

.format-selector {
    display: flex;
    gap: 8px;
}

.format-btn {
    flex: 1;
    background-color: #1a1a1a;
    border: 1px solid #2a2a2a;
    color: #e5e7eb;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 150ms ease;
}

.format-btn:hover:not(:disabled) {
    background-color: #2a2a2a;
}

.format-btn.active {
    background-color: #3b82f6;
    border-color: #3b82f6;
    color: #ffffff;
}

.format-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.logo-upload-area {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.logo-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background-color: #1a1a1a;
    border-radius: 6px;
}

.logo-preview img {
    max-width: 80px;
    max-height: 48px;
    object-fit: contain;
    border-radius: 4px;
}

.upload-logo-label,
.upload-csv-label {
    display: inline-block;
    cursor: pointer;
}

.upload-hint {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}

.template-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.template-actions {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.template-info {
    font-size: 13px;
    color: #a0a0a0;
}

.auto-increment-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #e5e7eb;
}

.checkbox-custom {
    width: 18px;
    height: 18px;
    background-color: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 4px;
    position: relative;
    transition: all 150ms ease;
    flex-shrink: 0;
}

.batch-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.batch-description {
    font-size: 14px;
    color: #a0a0a0;
}

.batch-upload-area {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.batch-status {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.batch-count {
    font-size: 14px;
    font-weight: 500;
    color: #e5e7eb;
}

.batch-errors {
    font-size: 13px;
    color: #ef4444;
    background-color: rgba(239, 68, 68, 0.1);
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.batch-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background-color: #2a2a2a;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: #3b82f6;
    border-radius: 2px;
    width: 0%;
    transition: width 200ms ease;
}

.progress-text {
    font-size: 12px;
    color: #a0a0a0;
}

.pro-cta-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}

.pro-cta-text {
    font-size: 14px;
    color: #d1d5db;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 24px;
}

.modal-overlay.modal-hidden {
    display: none;
}

.modal-overlay.modal-visible {
    display: flex;
}

.modal {
    background-color: #141414;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    padding: 0;
    max-width: 480px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    padding: 24px 24px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 22px;
    font-weight: 600;
    color: #ffffff;
}

.modal-close {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 150ms ease;
}

.modal-close:hover {
    color: #e5e7eb;
}

.modal-content {
    padding: 24px;
}

.pro-features-list {
    margin-bottom: 24px;
}

.pro-feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
}

.feature-check {
    width: 20px;
    height: 20px;
    background-color: #059669;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.feature-text {
    font-size: 15px;
    color: #e5e7eb;
}

.modal-cta {
    width: 100%;
    display: block;
}

.footer {
    background-color: #0a0a0a;
    border-top: 1px solid #2a2a2a;
    padding: 32px 24px;
    text-align: center;
    margin-top: auto;
}

.footer p {
    font-size: 14px;
    color: #6b7280;
}

.error-message {
    background-color: #7f1d1d;
    border: 1px solid #dc2626;
    color: #fca5a5;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    margin-top: 8px;
}

.success-message {
    background-color: #064e3b;
    border: 1px solid #059669;
    color: #6ee7b7;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    margin-top: 8px;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #2a2a2a;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.modal-hidden {
    display: none;
}

@media print {
    body {
        background-color: rgb(255, 255, 255);
        color: #000000;
    }

    .nav,
    .hero,
    .input-section,
    .pro-section,
    .pro-cta-bar,
    .footer,
    .receipt-actions,
    .output-header,
    .modal-overlay {
        display: none !important;
    }

    .tool-main {
        padding: 0;
    }

    .tool-container {
        max-width: none;
    }

    .output-section {
        background: none;
        border: none;
        padding: 0;
        box-shadow: none;
    }

    .receipt-preview-wrapper {
        background: none;
        padding: 0;
    }

    .receipt-preview {
        box-shadow: none;
        width: 100% !important;
        max-width: none;
        margin: 0;
    }

    .section-hidden {
        display: none !important;
    }
}

@media (max-width: 768px) {
        padding: 32px 16px;
    }

        font-size: 28px;
        line-height: 36px;
    }

        font-size: 14px;
    }

    .tool-main {
        padding: 24px 16px 100px;
    }

    .tool-container {
        gap: 32px;
    }

    .input-card {
        padding: 16px;
    }

    .input-row {
        flex-direction: column;
        gap: 12px;
    }

    .items-header {
        display: none;
    }

    .line-item-row {
        flex-wrap: wrap;
        gap: 6px;
        padding: 12px 0;
    }

    .line-item-row .item-desc,
    .line-item-row .item-qty,
    .line-item-row .item-price { width: 100%; }

    .line-item-row .text-input {
        width: 100%;
    }

    .item-total {
        text-align: left;
    }

    .item-delete-btn {
        justify-self: end;
    }

    .output-section {
        padding: 16px;
    }

    .receipt-preview-wrapper {
        padding: 16px;
    }

    .format-selector {
        flex-direction: column;
    }

    .template-actions {
        flex-direction: column;
    }

        padding: 0 16px;
    }

    .pro-cta-content {
        flex-direction: column;
        gap: 10px;
    }

    .button-primary,
    .button-secondary,
    .button-download {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .receipt-preview {
        padding: 16px 12px;
    }

    .receipt-thermal {
        font-size: 11px;
    }

    .receipt-thermal .receipt-business-name {
        font-size: 14px;
    }
}