/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-red: #C8102E;
    --holiday-red: #ff4444;
    --text-dark: #1a1a1a;
    --text-light: #666;
    --bg-light: #f5f5f5;
    --bg-white: #ffffff;
    --weekend-gray: #888;
    --border-color: #e0e0e0;
}

body {
    font-family: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: #fafafa;
    overflow-x: hidden;
}

/* Header Styles */
header {
    background: linear-gradient(135deg, var(--primary-red), #d32f2f);
    color: white;
    text-align: center;
    padding: 3rem 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.2rem;
    font-weight: 300;
    opacity: 0.95;
}

/* Main Content */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.year-overview {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

.year-overview h2 {
    font-size: 2rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.intro-text {
    font-size: 1.1rem;
    color: var(--text-light);
}

/* Calendar Container */
.calendar-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
    max-width: 100%;
}

/* Month Card */
.month-card {
    background: var(--bg-white);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    max-width: 100%;
    box-sizing: border-box;
}

.month-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.month-header {
    text-align: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--primary-red);
}

.month-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-red);
}

.year-text {
    font-size: 1rem;
    color: var(--text-light);
    margin-left: 0.5rem;
}

/* Calendar Grid */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.25rem;
    max-width: 100%;
}

.day-header {
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-light);
    padding: 0.5rem 0;
}

.day-cell {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    padding: 0.2rem;
    font-size: 0.85rem;
    transition: background-color 0.2s;
    min-width: 0;
    overflow: hidden;
}

.day-number {
    font-weight: 500;
}

.lunar-date {
    font-size: 0.6rem;
    opacity: 0.7;
    margin-top: 0.1rem;
    text-align: center;
}

.day-cell.weekend {
    color: var(--weekend-gray);
}

.day-cell.holiday {
    background-color: rgba(255, 68, 68, 0.1);
    color: var(--holiday-red);
    font-weight: 600;
}

.day-cell.today {
    background-color: var(--primary-red);
    color: white;
    font-weight: 700;
}

.day-cell.today .lunar-date {
    opacity: 0.9;
}

.day-cell.clickable {
    cursor: pointer;
}

.day-cell.clickable:hover {
    opacity: 0.85;
    transform: scale(1.05);
}

.day-cell.empty {
    visibility: hidden;
}

/* SEO Description Section */
.seo-description {
    background: var(--bg-white);
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 3rem;
}

.seo-description h2 {
    color: var(--primary-red);
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.seo-description p {
    color: var(--text-dark);
    line-height: 1.8;
    margin-bottom: 1rem;
    font-size: 1.05rem;
}

.seo-description p:last-child {
    margin-bottom: 0;
}

/* Holiday List Section */
.holiday-list {
    background: var(--bg-white);
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 3rem;
}

.holiday-list h2 {
    color: var(--primary-red);
    margin-bottom: 2rem;
    font-size: 1.8rem;
    text-align: center;
}

.holiday-list-container {
    display: grid;
    gap: 1.5rem;
}

.holiday-item {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-light);
    border-radius: 8px;
    border-left: 4px solid var(--primary-red);
    transition: transform 0.2s, box-shadow 0.2s;
}

.holiday-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.holiday-item-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    background: var(--primary-red);
    color: white;
    padding: 0.75rem;
    border-radius: 8px;
    text-align: center;
}

.holiday-day {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1;
}

.holiday-month {
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: 0.25rem;
}

.holiday-item-content {
    flex: 1;
}

.holiday-item-name {
    color: var(--primary-red);
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.holiday-item-desc {
    color: var(--text-dark);
    line-height: 1.6;
    font-size: 1rem;
    margin: 0;
}

/* Responsive Holiday List */
@media (max-width: 768px) {
    .holiday-list {
        padding: 1.5rem;
    }
    
    .holiday-list h2 {
        font-size: 1.5rem;
    }
    
    .holiday-item {
        flex-direction: column;
        gap: 1rem;
        padding: 1.25rem;
    }
    
    .holiday-item-date {
        flex-direction: row;
        min-width: auto;
        width: 100%;
        justify-content: center;
        padding: 0.5rem;
    }
    
    .holiday-day {
        font-size: 1.5rem;
        margin-right: 0.5rem;
    }
    
    .holiday-month {
        font-size: 1rem;
    }
    
    .holiday-item-content {
        text-align: center;
    }
    
    .holiday-item-name {
        font-size: 1.1rem;
    }
    
    .holiday-item-desc {
        font-size: 0.95rem;
    }
}

/* Holiday Modal */
.holiday-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

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

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-light);
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.close-modal:hover {
    color: var(--text-dark);
}

.modal-content h2 {
    color: var(--primary-red);
    margin-bottom: 1rem;
    font-size: 2rem;
}

.modal-date {
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-desc {
    color: var(--text-dark);
    font-size: 1.1rem;
    line-height: 1.8;
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modal-content {
        padding: 2rem 1.5rem;
        width: 95%;
    }
    
    .modal-content h2 {
        font-size: 1.5rem;
    }
    
    .close-modal {
        top: 0.5rem;
        right: 1rem;
        font-size: 1.8rem;
    }
}

/* Footer */
footer {
    background: var(--text-dark);
    color: white;
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 4rem;
}

footer p {
    margin: 0.5rem 0;
}

.ads-enquiry a {
    color: white;
    text-decoration: none;
    font-weight: 600;
}

.ads-enquiry a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .calendar-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .seo-description {
        padding: 1.5rem;
    }
    
    .seo-description h2 {
        font-size: 1.5rem;
    }
    
    .seo-description p {
        font-size: 1rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .calendar-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1025px) {
    .calendar-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Print Styles */
@media print {
    header {
        background: var(--text-dark);
        color: white;
    }
    
    .month-card {
        break-inside: avoid;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }
    
    .day-cell.today {
        background-color: var(--text-dark);
    }
}

