:root {
    /* Base Colors and Typography */
    --primary-color: #2c3e50;
    --secondary-color: #ffffff;
    --accent-color: #3498db;
    --accent-hover: #2980b9;
    --success-color: #2ecc71;
    --warning-color: #f1c40f;
    --danger-color: #e74c3c;
    --text-color: #2c3e50;
    --text-light: #7f8c8d;
    --border-color: #ecf0f1;
    --background-color: #f5f6fa;
    --card-background: #ffffff;
    --header-bg: #34495e;
    
    /* Holiday Type Colors */
    --national-color: #27ae60;
    --religious-color: #2980b9;
    --observance-color: #f39c12;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.main-header {
    background-color: var(--header-bg);
    box-shadow: var(--shadow-lg);
    padding: var(--spacing-lg) 0;
    margin-bottom: var(--spacing-xl);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-xl);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content h1 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.header-content h1 i {
    font-size: 1.8rem;
}

.header-actions {
    display: flex;
    gap: var(--spacing-md);
}

/* Button Styles */
.btn {
    padding: 0.75rem 1.75rem;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.btn i {
    font-size: 1.1rem;
}

.btn-primary {
    background-color: var(--accent-color);
    color: var(--secondary-color);
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--secondary-color);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

/* Main Content */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-xl);
    flex: 1;
}

/* Calendar Filters */
.calendar-filters {
    background-color: var(--card-background);
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-xl);
    display: flex;
    gap: var(--spacing-xl);
    box-shadow: var(--shadow-md);
}

.filter-group {
    flex: 1;
    max-width: 300px;
}

.filter-group label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.95rem;
}

.form-select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    color: var(--text-color);
    background-color: var(--secondary-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-select:hover {
    border-color: var(--accent-color);
}

.form-select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Calendar Grid */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

/* Month Styles */
.month {
    background-color: var(--card-background);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: visible;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.month:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.month-header {
    background-color: var(--primary-color);
    color: var(--secondary-color);
    padding: var(--spacing-md) var(--spacing-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.month-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.month-stats {
    font-size: 0.9rem;
    opacity: 0.9;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
}

.month-content {
    padding: var(--spacing-md);
    position: relative;
    overflow: visible;
}

.month table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 2px;
    position: relative;
    z-index: 1;
}

.month th {
    padding: var(--spacing-sm);
    text-align: center;
    font-weight: 500;
    color: var(--text-light);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.month td {
    padding: var(--spacing-sm);
    text-align: center;
    position: relative;
    height: 40px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--secondary-color);
    transition: all 0.2s ease;
}

.month td:hover {
    background-color: var(--text-light) !important;
}

.day-number {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-color);
    display: block;
    margin-bottom: 2px;
}

/* Holiday Styles */
.holiday {
    background-color: var(--national-color);
    color: var(--secondary-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.holiday.national {
    background-color: var(--national-color);
}

.holiday.religious {
    background-color: var(--religious-color);
}

.holiday.observance {
    background-color: var(--observance-color);
}

.holiday-info {
    position: absolute;
    background-color: rgba(44, 62, 80, 0.95);
    color: var(--secondary-color);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    min-width: 250px;
    display: none;
    text-align: left;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: none;
}

/* Smart positioning for tooltips */
.holiday:hover .holiday-info {
    display: block;
    animation: fadeIn 0.2s ease-in-out;
}

/* Position the tooltip based on cell position */
td:nth-child(1) .holiday-info,
td:nth-child(2) .holiday-info,
td:nth-child(3) .holiday-info {
    left: 0;
    top: 100%;
    transform: translateY(8px);
}

td:nth-child(4) .holiday-info {
    left: 50%;
    top: 100%;
    transform: translateX(-50%) translateY(8px);
}

td:nth-child(5) .holiday-info,
td:nth-child(6) .holiday-info,
td:nth-child(7) .holiday-info {
    right: 0;
    top: 100%;
    transform: translateY(8px);
}

/* For cells in the last row, show tooltip above */
tr:last-child .holiday-info {
    top: auto;
    bottom: 100%;
    transform: translateY(-8px);
}

.holiday-name {
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    font-size: 0.9rem;
}

.holiday-type {
    font-size: 0.8rem;
    opacity: 0.9;
    text-transform: capitalize;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin-top: 4px;
}

.holiday-type::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: currentColor;
}

.holiday-description {
    margin-top: var(--spacing-xs);
    font-size: 0.8rem;
    opacity: 0.8;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: var(--spacing-xs);
    line-height: 1.4;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(8px);
    }
}

/* Calendar Legend */
.calendar-legend {
    background-color: var(--card-background);
    padding: var(--spacing-lg) var(--spacing-xl);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-xl);
    box-shadow: var(--shadow-md);
}

.calendar-legend h3 {
    margin-bottom: var(--spacing-md);
    color: var(--primary-color);
    font-size: 1.1rem;
    font-weight: 600;
}

.legend-items {
    display: flex;
    gap: var(--spacing-xl);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 0.95rem;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: var(--radius-sm);
}

.legend-color.national {
    background-color: var(--national-color);
}

.legend-color.religious {
    background-color: var(--religious-color);
}

.legend-color.observance {
    background-color: var(--observance-color);
}

/* Footer */
.main-footer {
    background-color: var(--card-background);
    padding: var(--spacing-lg);
    text-align: center;
    color: var(--text-light);
    margin-top: auto;
    border-top: 1px solid var(--border-color);
}

/* Responsive Design */
@media (max-width: 1400px) {
    .calendar-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .calendar-grid {
        grid-template-columns: 1fr;
    }
    
    .header-content,
    .main-content {
        padding: 0 var(--spacing-lg);
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-lg);
    }

    .header-content h1 {
        font-size: 1.6rem;
    }

    .header-actions {
        width: 100%;
        justify-content: center;
    }

    .calendar-filters {
        flex-direction: column;
        padding: var(--spacing-lg);
    }

    .filter-group {
        max-width: none;
    }

    .month td {
        height: 35px;
    }

    .holiday-info {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 90%;
        max-width: 300px;
    }

    @keyframes fadeIn {
        from {
            opacity: 0;
            transform: translate(-50%, -45%);
        }
        to {
            opacity: 1;
            transform: translate(-50%, -50%);
        }
    }

    .legend-items {
        flex-direction: column;
        gap: var(--spacing-md);
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
    }

    .header-actions,
    .calendar-filters,
    .calendar-legend {
        display: none;
    }

    .calendar-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .month {
        break-inside: avoid;
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
        margin-bottom: 20px;
    }

    .month-header {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        color-adjust: exact;
        background-color: var(--primary-color) !important;
    }

    .holiday {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        color-adjust: exact;
    }

    .holiday.national {
        background-color: var(--national-color) !important;
    }

    .holiday.religious {
        background-color: var(--religious-color) !important;
    }

    .holiday.observance {
        background-color: var(--observance-color) !important;
    }

    .holiday-info {
        display: none !important;
    }

    .holiday::after {
        content: attr(data-holiday-name);
        display: block;
        font-size: 8px;
        line-height: 1.2;
        color: var(--secondary-color);
        margin-top: 2px;
    }

    .month td {
        height: 60px;
        padding: 4px;
        font-size: 12px;
    }

    .day-number {
        font-size: 14px;
        margin-bottom: 4px;
    }

    @page {
        margin: 1cm;
        size: A4 landscape;
    }

    .main-footer {
        position: fixed;
        bottom: 0;
        width: 100%;
        border-top: 1px solid #ddd;
        padding: 10px;
        text-align: center;
        background: white;
    }
}

/* Loading Styles */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
    text-align: center;
    color: var(--text-light);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: var(--spacing-md);
}

.error-message {
    color: var(--danger-color);
    padding: var(--spacing-lg);
    text-align: center;
    background-color: var(--card-background);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Holiday List Section */
.holiday-list-section {
    background-color: var(--card-background);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    box-shadow: var(--shadow-md);
}

.holiday-list-section h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: var(--spacing-lg);
}

.holiday-list-filters {
    margin-bottom: var(--spacing-lg);
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.holiday-list-filters .btn {
    background-color: var(--background-color);
    color: var(--text-color);
}

.holiday-list-filters .btn.active {
    background-color: var(--accent-color);
    color: var(--secondary-color);
}

.holiday-list-container {
    overflow-x: auto;
}

.holiday-list-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: var(--spacing-md);
}

.holiday-list-table th {
    background-color: var(--background-color);
    color: var(--text-color);
    font-weight: 600;
    text-align: left;
    padding: var(--spacing-md);
    border-bottom: 2px solid var(--border-color);
}

.holiday-list-table td {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
}

.holiday-row {
    transition: background-color 0.2s ease;
}

.holiday-row:hover {
    background-color: var(--background-color);
}

.holiday-type-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--secondary-color);
}

.holiday-type-badge.national {
    background-color: var(--national-color);
}

.holiday-type-badge.religious {
    background-color: var(--religious-color);
}

.holiday-type-badge.observance {
    background-color: var(--observance-color);
}

/* Update print styles to include holiday list */
@media print {
    .holiday-list-filters {
        display: none;
    }

    .holiday-list-section {
        break-before: page;
        border: none;
        box-shadow: none;
    }

    .holiday-list-table th {
        background-color: #f5f6fa !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .holiday-type-badge {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .holiday-type-badge.national {
        background-color: var(--national-color) !important;
    }

    .holiday-type-badge.religious {
        background-color: var(--religious-color) !important;
    }

    .holiday-type-badge.observance {
        background-color: var(--observance-color) !important;
    }
}

/* Responsive adjustments for holiday list */
@media (max-width: 768px) {
    .holiday-list-table {
        font-size: 0.9rem;
    }

    .holiday-list-table td {
        padding: var(--spacing-sm);
    }

    .holiday-type-badge {
        font-size: 0.8rem;
    }
}

/* Header Controls */
.header-controls {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.country-year-selector {
    display: flex;
    gap: var(--spacing-md);
}

.select-group {
    min-width: 200px;
}

.select-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--secondary-color);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.select-group select:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.select-group select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.3);
}

.select-group select option {
    background-color: var(--primary-color);
    color: var(--secondary-color);
}

/* Share Dialog */
.share-dialog {
    background-color: var(--card-background);
    border-radius: var(--radius-lg);
    padding: 0;
    border: none;
}

.share-dialog .ui-dialog-titlebar {
    background: var(--primary-color);
    color: var(--secondary-color);
    border: none;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: var(--spacing-md) var(--spacing-lg);
}

.share-dialog h3 {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
}

.share-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
}

.share-options .btn {
    width: 100%;
    justify-content: center;
    font-size: 0.9rem;
}

.share-options .btn i {
    font-size: 1.1rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .header-controls {
        width: 100%;
    }

    .country-year-selector {
        flex-direction: column;
        width: 100%;
    }

    .select-group {
        width: 100%;
        min-width: auto;
    }

    .header-actions {
        flex-wrap: wrap;
        justify-content: center;
    }

    .share-options {
        grid-template-columns: 1fr;
    }
}

/* Download Dialog */
.download-dialog {
    background-color: var(--card-background);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    text-align: center;
}

.download-options {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    margin-top: var(--spacing-md);
}

.download-options .btn {
    min-width: 120px;
}
  