:root {
    --primary-color: #2c5aa0;
    --secondary-color: #1a4480;
    --accent-color: #4CAF50;
    --light-bg: #f8f9fa;
    --border-radius: 8px;
    --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
[dir="rtl"] .section-title {
    text-align: right;
    justify-content: flex-start;
    flex-direction: row;
}

[dir="rtl"] .section-title i {
    margin-right: 0;
    margin-left: 10px;
}
body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 30px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 30px;
    text-align: center;
    box-shadow: var(--card-shadow);
}

.header h1 {
    font-size: 2.2rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Section Titles */
.section-title {
    font-size: 1.6rem;
    color: var(--primary-color);
    margin: 30px 0 20px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--accent-color);
    display: flex;
    align-items: center;
}

.section-title i {
    margin-right: 10px;
    color: var(--accent-color);
}

/* Table Wrapper for Responsive Design */
.table-wrapper {
    overflow-x: auto;
    margin-bottom: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    background: white;
}

/* Table Styles */
.schedule-table, .vaccination-table {
    width: 100%;
    min-width: 400px;
    border-collapse: collapse;
    background: white;
}

.schedule-table th, .vaccination-table th {
    background: var(--primary-color);
    color: white;
    padding: 15px 12px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.schedule-table td, .vaccination-table td {
    padding: 12px 10px;
    border: 1px solid #e9ecef;
    text-align: center;
    vertical-align: middle;
    font-size: 0.9rem;
}

.schedule-table tr:nth-child(even), .vaccination-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

.schedule-table tr:hover, .vaccination-table tr:hover {
    background-color: #e3f2fd;
}

/* Typography */
.arabic {
    font-family: 'Noto Sans Arabic', 'Times New Roman', serif;
    direction: rtl;
    font-size: 14px;
    display: flex;
    flex-direction: row; 
    gap: 10px;
}

.french {
    font-style: italic;
    color: #666;
}

.vaccine-name {
    font-weight: 600;
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.vaccine-description {
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
}

/* Notes Section */
.notes-section {
    background: linear-gradient(135deg, #e8f5e8 0%, #f0f8f0 100%);
    padding: 25px;
    border-radius: var(--border-radius);
    margin-top: 30px;
    border-left: 4px solid var(--accent-color);
    box-shadow: var(--card-shadow);
}

.notes-section h3 {
    color: var(--secondary-color);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.notes-section h3 i {
    margin-right: 10px;
    color: var(--accent-color);
}

.notes-section ul {
    list-style: none;
    padding: 0;
}

.notes-section li {
    padding: 6px 0;
    display: flex;
    align-items: flex-start;
}

.notes-section li i {
    color: var(--accent-color);
    margin-right: 10px;
    margin-top: 2px;
}

/* Location Section */
.location-section {
    background: white;
    padding: 30px;
    border-radius: var(--border-radius);
    margin-top: 30px;
    margin-bottom: 20px;
    box-shadow: var(--card-shadow);
    border-top: 3px solid var(--primary-color);
}

.location-content {
   
    gap: 30px;
    align-items: center;
    margin-top: 20px;
}

.location-details h3 {
    color: var(--primary-color);
    margin-bottom: 12px;
    font-size: 1.3rem;
}

.location-details p {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

.location-info {
    display: grid;
    gap: 10px;
}

.location-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: var(--light-bg);
    border-radius: 6px;
    border-left: 3px solid var(--accent-color);
}

.location-item i {
    color: var(--accent-color);
    margin-right: 10px;
    width: 18px;
}

.location-item span {
    color: #333;
    font-weight: 500;
}

.map-container {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    height: 350px;
    border: 2px solid #f8f9fa;
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

/* Language Selector */
.language-selector {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
}

.language-selector select {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--card-shadow);
    outline: none;
}

.language-selector select:hover {
    background: var(--light-bg);
}

/* Print Button */
.print-button {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 18px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--card-shadow);
    z-index: 1000;
}

.print-button:hover {
    background: var(--secondary-color);
}

/* Footer */
footer {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
}

footer p {
    color: #666;
    font-size: 0.9rem;
}

.footer-content {
    display: flex;
    align-items: center;
    gap: 5px;
    justify-content: center;
}

.footer-link {
    color: #2c5aa0;
    text-decoration: none;
    font-weight: 500;
}

.footer-logo {
    width: 20px;
    height: auto;
    filter: grayscale(100%);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .header {
        padding: 25px 15px;
    }

    .header h1 {
        font-size: 1.8rem;
    }

    .location-content {
       
        gap: 20px;
    }

    .map-container {
        height: 280px;
    }

    .table-wrapper {
        margin-bottom: 25px;
    }

    .schedule-table, .vaccination-table {
        font-size: 0.8rem;
        min-width: 500px; /* Reduced width since we have fewer columns */
    }

    .schedule-table th, .vaccination-table th,
    .schedule-table td, .vaccination-table td {
        padding: 8px 6px;
        white-space: nowrap; /* Prevent text wrapping in cells */
    }

    .section-title {
        font-size: 1.4rem;
    }

    .location-section {
        padding: 20px;
    }

    .notes-section {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .schedule-table, .vaccination-table {
        min-width: 600px; /* Adjusted for fewer columns */
    }
    
    .schedule-table td, .vaccination-table td {
        padding: 6px 4px;
    }
}

/* RTL Support for Arabic */
[dir="rtl"] {
    text-align: right;
}



[dir="rtl"] .location-item {
    flex-direction: row-reverse;
}

[dir="rtl"] .location-item i {
    margin-right: 0;
    margin-left: 10px;
}

[dir="rtl"] .footer-content {
    flex-direction: row-reverse;
}

[dir="rtl"] .notes-section h3 i {
    margin-right: 0;
    margin-left: 10px;
}

[dir="rtl"] .notes-section li i {
    margin-right: 0;
    margin-left: 10px;
}

[dir="rtl"] .location-content {
    grid-template-columns: 1.5fr 1fr;
}

[dir="rtl"] .location-details {
    text-align: right;
}

[dir="rtl"] .location-details h3 {
    text-align: right;
}

[dir="rtl"] .location-details p {
    text-align: right;
}

/* Print Styles */
@media print {
    .print-button, .location-section, .language-selector, .header {
        display: none;
    }

    body {
        background: white;
    }

    .container {
        max-width: none;
        padding: 0;
    }

    .notes-section, footer {
        page-break-inside: avoid;
    }

    .table-wrapper {
        overflow: visible;
        box-shadow: none;
        margin: 0;
        padding: 0;
    }

    .schedule-table, .vaccination-table {
        box-shadow: none;
        border: 1px solid #ddd;
        min-width: auto;
        width: 100%;
        table-layout: fixed;
        font-size: 12px;
    }

    .schedule-table th, .vaccination-table th,
    .schedule-table td, .vaccination-table td {
        padding: 7px 4px;
        font-size: 11px;
        word-wrap: break-word;
        overflow-wrap: break-word;
        -webkit-hyphens: auto;
        hyphens: auto;
        white-space: normal;
        word-break: break-word;
        overflow: hidden;
    }

    .vaccine-name {
        font-size: 10px;
    }

    .vaccine-description {
        font-size: 9px;
        line-height: 1.3;
    }

    /* Fixed column widths for better control */
    .schedule-table th:first-child,
    .schedule-table td:first-child {
        width: 50%;
    }
    
    .vaccination-table th:first-child,
    .vaccination-table td:first-child {
        width: 20%;
    }
    
    .vaccination-table th:nth-child(2),
    .vaccination-table td:nth-child(2) {
        width: 30%;
    }
    
    .vaccination-table th:nth-child(3),
    .vaccination-table td:nth-child(3) {
        width: 50%;
    }

    /* Arabic RTL print fixes */
    [dir="rtl"] .schedule-table,
    [dir="rtl"] .vaccination-table {
        direction: rtl;
    }

    [dir="rtl"] .schedule-table th,
    [dir="rtl"] .vaccination-table th,
    [dir="rtl"] .schedule-table td,
    [dir="rtl"] .vaccination-table td {
        text-align: right;
        padding: 4px 2px;
        font-size: 10px;
        white-space: normal;
        word-break: break-word;
        overflow-wrap: break-word;
    }

    [dir="rtl"] .vaccine-description {
        font-size: 8px;
        text-align: right;
        white-space: normal;
        word-break: break-word;
        overflow-wrap: break-word;
        line-height: 1.2;
    }

    /* Add a simple header for print */
    .container::before {
        content: "جدول التطعيمات - مركز الصحة القدس";
        display: block;
        text-align: center;
        font-size: 18px;
        font-weight: 600;
        color: #2c5aa0;
        margin-bottom: 20px;
        padding-bottom: 10px;
        border-bottom: 2px solid #2c5aa0;
        direction: rtl;
        font-family: 'Noto Sans Arabic', Arial, sans-serif;
    }
}
