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

body {
    font-family: Arial, Helvetica, sans-serif;
    background-color: #f5f5f5;
    padding: 20px;
}

.calendar-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Info Header Styles */
.info-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 30px;
    margin-bottom: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.info-title {
    font-size: 36px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.info-content {
    max-width: 900px;
    margin: 0 auto;
    line-height: 1.6;
}

.info-content p {
    margin-bottom: 20px;
    font-size: 16px;
}

.info-features {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.info-features h3 {
    font-size: 22px;
    margin-bottom: 15px;
    font-weight: bold;
}

.info-features ul {
    list-style: none;
    padding: 0;
}

.info-features li {
    margin-bottom: 12px;
    padding-left: 25px;
    position: relative;
}

.info-features li:before {
    content: "✓";
    position: absolute;
    left: 0;
    font-weight: bold;
    color: #ffd700;
    font-size: 18px;
}

.info-note {
    font-style: italic;
    background-color: rgba(255, 255, 255, 0.15);
    padding: 15px;
    border-left: 4px solid #ffd700;
    border-radius: 4px;
}

.info-learn-more {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
}

.info-learn-more a {
    color: #ffd700;
    text-decoration: none;
    font-weight: bold;
    border-bottom: 2px solid #ffd700;
}

.info-learn-more a:hover {
    color: #fff;
    border-bottom-color: #fff;
}

/* Month Page Styles */
.month-page {
    background-color: white;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Special Day Styles (New Year's Day, Leap Day) */
.special-day-container {
    background-color: #fff9e6;
    border: 3px solid #ffc107;
    padding: 20px;
    margin-bottom: 30px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.special-day-title {
    font-size: 24px;
    color: #e65100;
    margin-bottom: 15px;
    font-weight: bold;
}

.special-day {
    display: inline-block;
    background-color: white;
    padding: 20px 40px;
    border: 2px solid #ff9800;
    border-radius: 8px;
    position: relative;
}

.special-day-name {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    display: block;
    margin-bottom: 10px;
}

.special-day .old-date {
    position: static;
    font-size: 14px;
    color: #666;
    font-style: italic;
}

.special-day-explanation {
    margin-top: 15px;
    font-size: 13px;
    color: #555;
    font-style: italic;
    line-height: 1.5;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.month-page-split {
    border-left: 4px solid #ff9800;
}

.month-header {
    text-align: center;
    font-size: 32px;
    margin-bottom: 20px;
    color: #333;
    font-weight: bold;
}

/* Calendar Table Styles */
.calendar-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.calendar-table thead th {
    background-color: #4a4a4a;
    color: white;
    padding: 10px;
    text-align: center;
    font-weight: bold;
    border: 1px solid #333;
}

.week-number-header {
    width: 50px;
    background-color: #666 !important;
}

.week-number {
    background-color: #e0e0e0;
    font-weight: bold;
    text-align: center;
    vertical-align: middle;
    border: 1px solid #999;
    width: 50px;
}

.day-cell {
    border: 1px solid #ccc;
    padding: 8px;
    vertical-align: top;
    height: 120px;
    position: relative;
}

.day-number {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.day-of-year {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 10px;
    color: #666;
    background-color: #f0f0f0;
    padding: 2px 5px;
    border-radius: 3px;
}

.day-content {
    min-height: 40px;
    font-size: 10px;
}

/* Holiday Styles */
.holiday-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.holiday-item {
    margin-bottom: 3px;
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 3px;
}

.holiday-flag {
    width: 14px;
    height: 10px;
    display: inline-block;
    vertical-align: middle;
    border: 1px solid #ddd;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.holiday-tag {
    display: inline-block;
    background-color: #3498db;
    color: white;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: bold;
    text-transform: uppercase;
    flex-shrink: 0;
}

.holiday-name {
    font-size: 10px;
    color: #333;
    flex: 1;
    min-width: 0;
}

.holiday-more {
    margin-top: 3px;
}

.more-link {
    color: #2980b9;
    text-decoration: none;
    font-weight: bold;
    font-size: 9px;
    cursor: pointer;
}

.more-link:hover {
    color: #1a5a8a;
    text-decoration: underline;
}

/* Holiday Popup Styles */
.holiday-popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    border: 2px solid #3498db;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    padding: 20px;
    min-width: 300px;
    max-width: 400px;
    z-index: 1000;
}

.holiday-popup.active {
    display: block;
}

.popup-header {
    font-size: 16px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
}

.popup-holiday-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.popup-holiday-list li {
    margin-bottom: 8px;
    padding: 5px;
    background-color: #f8f9fa;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.popup-holiday-list .holiday-flag {
    width: 18px;
    height: 13px;
}

.popup-holiday-list .holiday-tag {
    font-size: 10px;
}

.popup-holiday-list .holiday-name {
    font-size: 13px;
}

/* Overlay for popup */
.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.popup-overlay.active {
    display: block;
}

.old-date {
    position: absolute;
    bottom: 5px;
    right: 5px;
    font-size: 11px;
    color: #999;
    font-style: italic;
}

/* Print Styles */
@media print {
    body {
        background-color: white;
        padding: 0;
    }

    .calendar-container {
        max-width: 100%;
    }

    .month-page {
        page-break-after: always;
        margin: 0;
        padding: 15px;
        box-shadow: none;
    }

    .month-page:last-child {
        page-break-after: auto;
    }

    .month-header {
        font-size: 28px;
        margin-bottom: 15px;
    }

    .calendar-table {
        page-break-inside: avoid;
    }

    .day-cell {
        height: 95px;
    }

    /* Ensure clean printing */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .special-day-container {
        margin-bottom: 20px;
        padding: 15px;
    }

    .special-day-title {
        font-size: 20px;
    }
}

/* Screen-only styles */
@media screen {
    .month-page:hover {
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
        transition: box-shadow 0.3s ease;
    }
}

/* Attribution Footer */
.attribution-footer {
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    border-top: 2px solid #e0e0e0;
    background-color: #f8f9fa;
}

.attribution-footer p {
    margin: 0;
    font-size: 12px;
    color: #666;
}

.attribution-footer a {
    color: #3498db;
    text-decoration: none;
}

.attribution-footer a:hover {
    text-decoration: underline;
}

@media print {
    .attribution-footer {
        page-break-before: avoid;
        margin-top: 20px;
        padding: 10px;
    }
}
