/* :root variables moved to theme.css */

body {
    font-family: 'Cairo', 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
}

.app-container {
    background-color: var(--sidebar-bg);
    border-radius: 0.5rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    overflow-y: auto;
}



.content-grid {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    background-color: var(--sidebar-bg);
    border-radius: 0.5rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    overflow-y: auto;
}

.results-area {
    background-color: var(--sidebar-bg);
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#results-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#items-table-container {
    flex: 1;
    overflow-y: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 0.75rem 1rem;
    text-align: start;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: #f1f5f9;
    font-weight: 600;
    position: sticky;
    top: 0;
}

tr:hover {
    background-color: #f8fafc;
}

.division-item {
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 0.25rem;
}

.division-item:hover {
    background-color: #f1f5f9;
}

.division-item.active {
    background-color: #eff6ff;
    color: var(--primary-color);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgb(0, 0, 0);
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
    background-color: var(--bg-secondary, #fefefe);
    color: var(--text-primary, #1a202c);
    margin: 5% auto;
    padding: 20px;
    border: 1px solid var(--border-color, #888);
    width: 90%;
    max-width: 900px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-height: 90vh;
    overflow-y: auto;
}


.close-modal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover,
.close-modal:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

/* Filter Styles */
.search-bar select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-right: 10px;
    min-width: 150px;
}

.search-bar select:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

/* Detail View Styles */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.detail-item label {
    font-weight: 600;
    display: block;
    margin-bottom: 5px;
    color: var(--text-muted, #555);
}

.crew-section {
    margin-top: 20px;
    border-top: 1px solid var(--border-color, #eee);
    padding-top: 15px;
}

.crew-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.crew-card {
    background: var(--bg-tertiary, #f9f9f9);
    padding: 10px;
    border-radius: 4px;
    border: 1px solid var(--border-color, #eee);
}

.crew-card h4 {
    margin-top: 0;
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: var(--text-primary, #333);
}



/* Newsletter Styles */
.newsletter-section {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark, #2563eb));
    color: white;
    padding: 3rem 1.5rem;
    text-align: center;
    border-radius: 12px;
    margin: 3rem 0 1rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.newsletter-content h3 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.newsletter-content p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    opacity: 0.9;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.newsletter-form {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    max-width: 500px;
    margin: 0 auto;
}

.newsletter-input {
    flex: 1;
    min-width: 250px;
    padding: 0.8rem 1.2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    transition: transform 0.2s;
}

.newsletter-input:focus {
    outline: none;
    transform: scale(1.02);
}

.newsletter-btn {
    background-color: var(--secondary-color, #10b981);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}

.newsletter-btn:hover {
    background-color: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Dark mode adjustment for newsletter input */
[data-theme="dark"] .newsletter-input {
    background-color: #334155;
    color: white;
}

/* =========================================================================
   PRINT STYLES - Professional Invoice/Report Layout
   ========================================================================= */
@media print {
    /* Hide Everything by Default */
    body * {
        visibility: hidden;
    }

    /* Reset Body */
    body {
        margin: 0;
        padding: 0;
        background: white !important;
        color: black !important;
        font-size: 12pt;
    }

    /* Print Container - The only thing visible */
    .print-only, 
    .print-only * {
        visibility: visible;
    }

    .print-only {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        padding: 20px;
    }

    /* Screen Elements Hiding Helper */
    .screen-only,
    .navbar,
    .hero-section,
    .tools-section,
    .why-section,
    .cta-section,
    .site-footer,
    #themeToggle,
    #langToggle,
    .sidebar,
    .modal,
    button,
    input, 
    select {
        display: none !important;
    }

    /* Report Header */
    .print-header {
        border-bottom: 2px solid #3b82f6; /* Blue 500 */
        padding-bottom: 10px;
        margin-bottom: 20px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .print-title {
        font-size: 24px;
        font-weight: bold;
        color: #1e3a8a; /* Blue 900 */
    }

    .print-meta {
        text-align: right;
        font-size: 10pt;
        color: #64748b;
    }

    /* Items Table Style (Detail Breakdown) */
    .report-table {
        width: 100%;
        border-collapse: collapse;
        margin-bottom: 20px;
        font-size: 11pt;
    }

    .report-table th,
    .report-table td {
        border: 1px solid #e2e8f0;
        padding: 8px 12px;
        text-align: left;
    }

    .report-table th {
        background-color: #f1f5f9 !important;
        color: #0f172a;
        font-weight: bold;
        -webkit-print-color-adjust: exact;
    }

    /* Summary Table Style (Final Price) */
    .summary-table {
        width: 100%; /* Full width */
        max-width: 500px; /* Or keep it compact on the right */
        margin-left: auto;
        border-collapse: collapse;
        margin-top: 30px;
        page-break-inside: avoid;
    }

    .summary-table td {
        padding: 8px 12px;
        border-bottom: 1px solid #e2e8f0;
    }

    .summary-label {
        font-weight: bold;
        color: #475569;
        text-align: right;
    }

    .summary-value {
        font-weight: bold;
        text-align: right;
        color: #0f172a;
    }

    .summary-total-row td {
        border-top: 2px solid #0f172a;
        border-bottom: double 4px #0f172a;
        font-size: 14pt;
        color: #0f172a;
        padding-top: 12px;
    }

    /* Footer disclaimer */
    .print-footer {
        margin-top: 40px;
        font-size: 9pt;
        color: #94a3b8;
        text-align: center;
        border-top: 1px solid #e2e8f0;
        padding-top: 10px;
    }
}