/* Invoice Generator - Tool Styles */
/* All classes prefixed with ig- to avoid collisions */

/* Generator Section */
.ig-generator-section {
    padding: 40px 0 80px;
}

.ig-generator-section .container {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* Section Divider */
.ig-section-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 32px 0 20px;
}

.ig-section-divider::before,
.ig-section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color, #e2e0dc);
}

.ig-section-divider span {
    font-family: 'Bricolage Grotesque', serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary, #f1643f);
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}

/* Reveal Animation */
.ig-reveal {
    animation: igReveal 0.4s ease-out;
}

@keyframes igReveal {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Card Container */
.ig-card {
    background: var(--bg-card, #fff);
    border: 1px solid var(--border-color, #e2e0dc);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    margin-bottom: 24px;
}

.ig-card h2 {
    font-family: 'Bricolage Grotesque', serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary, #1a1715);
    margin-bottom: 8px;
}

.ig-card h2 + p {
    color: var(--text-secondary, #6b6560);
    margin-bottom: 24px;
    font-size: 15px;
}

/* Form Grid - Two Column (Seller / Buyer) */
.ig-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.ig-form-grid .ig-form-full {
    grid-column: 1 / -1;
}

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

.ig-form-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #1a1715);
}

.ig-form-group label .ig-required {
    color: var(--primary, #f1643f);
}

.ig-form-group select,
.ig-form-group input[type="text"],
.ig-form-group input[type="email"],
.ig-form-group input[type="tel"],
.ig-form-group input[type="number"],
.ig-form-group input[type="date"],
.ig-form-group textarea {
    padding: 10px 14px;
    border: 1px solid var(--border-color, #e2e0dc);
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Hanken Grotesk', sans-serif;
    color: var(--text-primary, #1a1715);
    background: var(--bg-card, #fff);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
    width: 100%;
    box-sizing: border-box;
}

.ig-form-group textarea {
    resize: vertical;
    min-height: 60px;
}

.ig-form-group select:focus,
.ig-form-group input:focus,
.ig-form-group textarea:focus {
    border-color: var(--primary, #f1643f);
    box-shadow: 0 0 0 3px rgba(241, 100, 63, 0.1);
}

.ig-form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236b6560' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.ig-field-error {
    font-size: 12px;
    color: #dc2626;
    margin-top: 2px;
    display: none;
}

.ig-field-error.visible {
    display: block;
}

/* Party Details Columns */
.ig-parties-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.ig-party-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ig-party-col h3 {
    font-family: 'Bricolage Grotesque', serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary, #1a1715);
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary, #f1643f);
    margin: 0;
}

/* Supply Type Badge */
.ig-supply-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
    margin-top: 4px;
}

.ig-supply-badge.intra {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.ig-supply-badge.inter {
    background: rgba(168, 85, 247, 0.1);
    color: #a855f7;
}

/* Line Items Table */
.ig-line-items-wrapper {
    overflow-x: auto;
    margin: 0 -8px;
    padding: 0 8px;
}

.ig-line-items {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 800px;
}

.ig-line-items thead th {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary, #6b6560);
    padding: 10px 8px;
    text-align: left;
    border-bottom: 2px solid var(--border-color, #e2e0dc);
    white-space: nowrap;
}

.ig-line-items thead th:last-child {
    text-align: center;
    width: 50px;
}

.ig-line-items tbody td {
    padding: 8px;
    vertical-align: top;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.ig-line-items tbody td input,
.ig-line-items tbody td select {
    padding: 8px 10px;
    border: 1px solid var(--border-color, #e2e0dc);
    border-radius: 6px;
    font-size: 13px;
    font-family: 'Hanken Grotesk', sans-serif;
    color: var(--text-primary, #1a1715);
    background: var(--bg-card, #fff);
    width: 100%;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s ease;
}

.ig-line-items tbody td input:focus,
.ig-line-items tbody td select:focus {
    border-color: var(--primary, #f1643f);
    box-shadow: 0 0 0 2px rgba(241, 100, 63, 0.08);
}

.ig-line-items tbody td select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236b6560' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 28px;
}

.ig-line-items .ig-col-desc { width: 25%; }
.ig-line-items .ig-col-hsn { width: 12%; }
.ig-line-items .ig-col-qty { width: 8%; }
.ig-line-items .ig-col-unit { width: 10%; }
.ig-line-items .ig-col-rate { width: 12%; }
.ig-line-items .ig-col-gst { width: 10%; }
.ig-line-items .ig-col-taxable { width: 13%; }
.ig-line-items .ig-col-action { width: 50px; }

.ig-taxable-value {
    font-weight: 600;
    color: var(--text-primary, #1a1715);
    padding: 8px 10px;
    font-size: 13px;
}

.ig-btn-remove-row {
    background: none;
    border: 1px solid rgba(220, 38, 38, 0.2);
    color: #dc2626;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.ig-btn-remove-row:hover {
    background: rgba(220, 38, 38, 0.08);
    border-color: #dc2626;
}

.ig-btn-remove-row svg {
    width: 16px;
    height: 16px;
}

.ig-btn-add-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding: 8px 16px;
    background: none;
    border: 1px dashed var(--border-color, #e2e0dc);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Hanken Grotesk', sans-serif;
    color: var(--primary, #f1643f);
    cursor: pointer;
    transition: all 0.2s ease;
}

.ig-btn-add-row:hover {
    border-color: var(--primary, #f1643f);
    background: rgba(241, 100, 63, 0.04);
}

.ig-btn-add-row svg {
    width: 16px;
    height: 16px;
}

/* Totals Section */
.ig-totals {
    display: flex;
    justify-content: flex-end;
    margin-top: 24px;
}

.ig-totals-table {
    width: 340px;
    border: 1px solid var(--border-color, #e2e0dc);
    border-radius: 12px;
    overflow: hidden;
}

.ig-totals-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 16px;
    font-size: 14px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.ig-totals-row:last-child {
    border-bottom: none;
}

.ig-totals-row .ig-totals-label {
    color: var(--text-secondary, #6b6560);
    font-weight: 500;
}

.ig-totals-row .ig-totals-value {
    font-weight: 600;
    color: var(--text-primary, #1a1715);
    text-align: right;
}

.ig-totals-row.ig-grand-total {
    background: var(--primary, #f1643f);
    color: #fff;
    font-size: 16px;
    padding: 14px 16px;
}

.ig-totals-row.ig-grand-total .ig-totals-label,
.ig-totals-row.ig-grand-total .ig-totals-value {
    color: #fff;
    font-weight: 700;
}

.ig-amount-words {
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-secondary, #6b6560);
    font-style: italic;
    text-align: right;
}

.ig-amount-words strong {
    color: var(--text-primary, #1a1715);
}

/* Buttons */
.ig-btn-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 32px;
    gap: 12px;
}

.ig-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    background: var(--primary, #f1643f);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Hanken Grotesk', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ig-btn-primary:hover {
    background: #d4532f;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(241, 100, 63, 0.3);
}

.ig-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.ig-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: transparent;
    color: var(--text-primary, #1a1715);
    border: 1px solid var(--border-color, #e2e0dc);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Hanken Grotesk', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ig-btn-secondary:hover {
    border-color: var(--text-secondary, #6b6560);
    background: rgba(0, 0, 0, 0.02);
}

.ig-btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: transparent;
    color: #dc2626;
    border: 1px solid rgba(220, 38, 38, 0.3);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Hanken Grotesk', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ig-btn-danger:hover {
    background: rgba(220, 38, 38, 0.06);
    border-color: #dc2626;
}

/* ===== PREVIEW MODAL ===== */
.ig-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px;
    overflow-y: auto;
}

.ig-modal-overlay.open {
    display: flex;
}

.ig-modal {
    background: #fff;
    border-radius: 16px;
    max-width: 900px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.ig-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid #e2e0dc;
}

.ig-modal-header h3 {
    font-family: 'Bricolage Grotesque', serif;
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    color: #1a1715;
}

.ig-modal-actions {
    display: flex;
    gap: 8px;
}

.ig-modal-close {
    background: none;
    border: 1px solid #e2e0dc;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    color: #6b6560;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.ig-modal-close:hover {
    background: rgba(0, 0, 0, 0.04);
    color: #1a1715;
}

.ig-modal-close svg {
    width: 18px;
    height: 18px;
}

.ig-modal-body {
    padding: 32px;
}

/* Invoice Preview Layout */
.ig-invoice-preview {
    font-family: 'Hanken Grotesk', sans-serif;
    color: #1a1715;
    max-width: 800px;
    margin: 0 auto;
}

.ig-invoice-title {
    text-align: center;
    font-family: 'Bricolage Grotesque', serif;
    font-size: 22px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
    color: #1a1715;
}

.ig-invoice-subtitle {
    text-align: center;
    font-size: 13px;
    color: #6b6560;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #1a1715;
}

.ig-invoice-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.ig-invoice-party {
    padding: 16px;
    background: #f9f8f6;
    border-radius: 8px;
}

.ig-invoice-party h4 {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b6560;
    margin: 0 0 8px 0;
}

.ig-invoice-party .ig-party-name {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.ig-invoice-party .ig-party-detail {
    font-size: 13px;
    color: #6b6560;
    line-height: 1.5;
}

.ig-invoice-info-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    padding: 12px 16px;
    background: #f9f8f6;
    border-radius: 8px;
    font-size: 13px;
}

.ig-invoice-info-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ig-invoice-info-item .ig-info-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b6560;
}

.ig-invoice-info-item .ig-info-value {
    font-weight: 600;
    color: #1a1715;
}

.ig-invoice-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-bottom: 24px;
}

.ig-invoice-table thead th {
    background: #1a1715;
    color: #fff;
    padding: 10px 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
}

.ig-invoice-table thead th:first-child {
    border-radius: 6px 0 0 0;
}

.ig-invoice-table thead th:last-child {
    border-radius: 0 6px 0 0;
    text-align: right;
}

.ig-invoice-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid #e2e0dc;
    vertical-align: top;
}

.ig-invoice-table tbody td:last-child {
    text-align: right;
    font-weight: 600;
}

.ig-invoice-table tbody tr:last-child td {
    border-bottom: 2px solid #1a1715;
}

.ig-invoice-totals-preview {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
}

.ig-invoice-totals-preview table {
    width: 300px;
    font-size: 13px;
}

.ig-invoice-totals-preview table td {
    padding: 6px 0;
}

.ig-invoice-totals-preview table td:first-child {
    color: #6b6560;
}

.ig-invoice-totals-preview table td:last-child {
    text-align: right;
    font-weight: 600;
}

.ig-invoice-totals-preview table tr.ig-preview-grand-total td {
    font-size: 16px;
    font-weight: 700;
    border-top: 2px solid #1a1715;
    padding-top: 10px;
    color: #1a1715;
}

.ig-invoice-words {
    font-size: 13px;
    color: #6b6560;
    margin-bottom: 32px;
    font-style: italic;
}

.ig-invoice-words strong {
    color: #1a1715;
}

.ig-invoice-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding-top: 24px;
    border-top: 1px solid #e2e0dc;
}

.ig-invoice-footer-note {
    font-size: 12px;
    color: #6b6560;
    line-height: 1.5;
}

.ig-invoice-footer-sign {
    text-align: right;
}

.ig-invoice-footer-sign .ig-sign-line {
    width: 160px;
    border-top: 1px solid #1a1715;
    margin-bottom: 4px;
}

.ig-invoice-footer-sign .ig-sign-label {
    font-size: 11px;
    font-weight: 600;
    color: #6b6560;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== PRINT STYLES ===== */
@media print {
    body * {
        visibility: hidden;
    }

    .ig-modal-overlay,
    .ig-modal-overlay * {
        visibility: visible;
    }

    .ig-modal-overlay {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        background: #fff;
        padding: 0;
        display: block;
    }

    .ig-modal {
        box-shadow: none;
        border-radius: 0;
        max-width: 100%;
    }

    .ig-modal-header,
    .ig-modal-actions {
        display: none !important;
    }

    .ig-modal-body {
        padding: 20px;
    }

    .ig-invoice-preview {
        max-width: 100%;
    }

    .ig-invoice-party {
        background: #f5f5f5 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .ig-invoice-table thead th {
        background: #1a1715 !important;
        color: #fff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    @page {
        margin: 15mm;
        size: A4;
    }
}

/* ===== SEO CONTENT ===== */
.ig-seo-content {
    padding: 80px 0;
    background: rgba(0, 0, 0, 0.02);
}

.ig-seo-content h2 {
    font-family: 'Bricolage Grotesque', serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary, #1a1715);
    margin-bottom: 12px;
    text-align: center;
}

.ig-seo-content > .container > p {
    text-align: center;
    color: var(--text-secondary, #6b6560);
    max-width: 700px;
    margin: 0 auto 40px;
    line-height: 1.7;
    font-size: 15px;
}

.ig-seo-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.ig-seo-card {
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--border-color, #e2e0dc);
    background: var(--bg-card, #fff);
}

.ig-seo-card h3 {
    font-family: 'Bricolage Grotesque', serif;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary, #1a1715);
}

.ig-seo-card p {
    font-size: 14px;
    color: var(--text-secondary, #6b6560);
    line-height: 1.6;
    margin: 0;
}

/* ===== FAQ SECTION ===== */
.ig-faq-section {
    padding: 80px 0;
}

.ig-faq-section h2 {
    font-family: 'Bricolage Grotesque', serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary, #1a1715);
    text-align: center;
    margin-bottom: 40px;
}

.ig-faq-list {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ig-faq-item {
    border: 1px solid var(--border-color, #e2e0dc);
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-card, #fff);
}

.ig-faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    padding: 18px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Hanken Grotesk', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary, #1a1715);
    text-align: left;
    transition: background 0.2s ease;
}

.ig-faq-question:hover {
    background: rgba(0, 0, 0, 0.02);
}

.ig-faq-question i,
.ig-faq-question svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--text-secondary, #6b6560);
    transition: transform 0.2s ease;
}

.ig-faq-item.open .ig-faq-question i,
.ig-faq-item.open .ig-faq-question svg {
    transform: rotate(180deg);
}

.ig-faq-answer {
    display: none;
    padding: 0 20px 18px;
}

.ig-faq-item.open .ig-faq-answer {
    display: block;
}

.ig-faq-answer p {
    font-size: 14px;
    color: var(--text-secondary, #6b6560);
    line-height: 1.7;
    margin: 0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 809px) {
    .ig-card {
        padding: 24px 20px;
    }

    .ig-parties-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .ig-form-grid {
        grid-template-columns: 1fr;
    }

    .ig-totals {
        justify-content: stretch;
    }

    .ig-totals-table {
        width: 100%;
    }

    .ig-btn-row {
        flex-direction: column-reverse;
    }

    .ig-btn-primary,
    .ig-btn-secondary,
    .ig-btn-danger {
        width: 100%;
        justify-content: center;
    }

    .ig-seo-grid {
        grid-template-columns: 1fr;
    }

    .ig-modal {
        border-radius: 12px;
    }

    .ig-modal-body {
        padding: 20px;
    }

    .ig-invoice-meta {
        grid-template-columns: 1fr;
    }

    .ig-invoice-info-row {
        flex-direction: column;
        gap: 8px;
    }

    .ig-invoice-footer {
        flex-direction: column;
        gap: 24px;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .ig-generator-section {
        padding: 0 0 48px;
    }

    .ig-card {
        padding: 20px 16px;
        border-radius: 12px;
    }

    .ig-card h2 {
        font-size: 20px;
    }

    .ig-seo-content {
        padding: 48px 0;
    }

    .ig-seo-content h2 {
        font-size: 22px;
    }

    .ig-faq-section {
        padding: 48px 0;
    }

    .ig-faq-section h2 {
        font-size: 22px;
    }

    .ig-section-divider {
        margin: 24px 0 16px;
    }

    .ig-modal-overlay {
        padding: 20px 10px;
    }

    .ig-invoice-totals-preview table {
        width: 100%;
    }
}
