:root {
    /* Light theme (default) */
    --color-bg: #ffffff;
    --color-text: #333333;
    --color-text-secondary: #666666;
    --color-heading: #2c3e50;
    --color-border: #eeeeee;
    --color-border-light: #f0f0f0;
    --color-border-medium: #dddddd;
    --color-nav-bg: #2c3e50;
    --color-nav-text: #ffffff;
    --color-nav-hover: #1a252f;
    --color-button-primary: #4CAF50;
    --color-button-primary-hover: #45a049;
    --color-button-secondary: #f8f9fa;
    --color-button-secondary-hover: #e9ecef;
    --color-button-text: #333333;
    --color-button-text-light: #ffffff;
    --color-holiday-public-bg: #ffebee;
    --color-holiday-public-accent: #e53935;
    --color-holiday-regular-bg: #e3f2fd;
    --color-holiday-regular-accent: #1e88e5;
    --color-status-bg: #f8f9fa;
    --color-tooltip-bg: #333333;
    --color-tooltip-text: #ffffff;
    --color-week-number-bg: #f0f0f0;
    --color-empty-day-bg: #f9f9f9;
    --color-shadow: rgba(0, 0, 0, 0.1);
    --color-footer-text: #777777;
}

/* Dark theme */
[data-theme="dark"] {
    --color-bg: #121212;
    --color-text: #e0e0e0;
    --color-text-secondary: #aaaaaa;
    --color-heading: #81a1c1;
    --color-border: #333333;
    --color-border-light: #2a2a2a;
    --color-border-medium: #444444;
    --color-nav-bg: #1a1a1a;
    --color-nav-text: #e0e0e0;
    --color-nav-hover: #333333;
    --color-button-primary: #388e3c;
    --color-button-primary-hover: #2e7d32;
    --color-button-secondary: #333333;
    --color-button-secondary-hover: #444444;
    --color-button-text: #e0e0e0;
    --color-button-text-light: #e0e0e0;
    --color-holiday-public-bg: #3e2723;
    --color-holiday-public-accent: #e53935;
    --color-holiday-regular-bg: #0d47a1;
    --color-holiday-regular-accent: #64b5f6;
    --color-status-bg: #1e1e1e;
    --color-tooltip-bg: #424242;
    --color-tooltip-text: #e0e0e0;
    --color-week-number-bg: #1e1e1e;
    --color-empty-day-bg: #1a1a1a;
    --color-shadow: rgba(0, 0, 0, 0.3);
    --color-footer-text: #888888;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg);
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    transition: background-color 0.3s ease, color 0.3s ease;
}
h1, h2, h3 {
    color: var(--color-heading);
}
h1 {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--color-border);
    padding-bottom: 10px;
}
h2 {
    margin-top: 30px;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 5px;
}
.month-container {
    margin-bottom: 30px;
}
.holiday-item {
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 5px;
}
.public-holiday {
    background-color: var(--color-holiday-public-bg);
    border-left: 4px solid var(--color-holiday-public-accent);
}
.regular-day {
    background-color: var(--color-holiday-regular-bg);
    border-left: 4px solid var(--color-holiday-regular-accent);
}
.holiday-date {
    font-weight: bold;
    margin-right: 10px;
}
.holiday-name {
    font-weight: bold;
}
.holiday-description {
    color: var(--color-text-secondary);
    font-size: 0.9em;
}
.subscribe-button {
    display: block;
    width: 200px;
    margin: 30px auto;
    padding: 10px;
    background-color: var(--color-button-primary);
    color: var(--color-button-text-light);
    text-align: center;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
}
.subscribe-button:hover {
    background-color: var(--color-button-primary-hover);
}
.year-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px auto;
    gap: 15px;
    flex-wrap: wrap;
}
.intro-text {
    text-align: center;
    margin-bottom: 30px;
}
.year-nav-button {
    padding: 8px 15px;
    background-color: var(--color-nav-bg);
    color: var(--color-nav-text);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
}
.year-nav-button:hover {
    background-color: var(--color-nav-hover);
}
.current-year {
    font-size: 1.2em;
    font-weight: bold;
    padding: 0 10px;
}
.year-select {
    padding: 8px;
    border-radius: 4px;
    border: 1px solid var(--color-border-medium);
    margin-left: 10px;
    background-color: var(--color-bg);
    color: var(--color-text);
}
.year-select-form {
    display: flex;
    align-items: center;
    margin-left: 15px;
}
.year-select-label {
    margin-right: 5px;
}
.breadcrumb-nav {
    margin-bottom: 20px;
}
.breadcrumb {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
}
.breadcrumb li {
    display: inline-block;
    margin-right: 5px;
}
.breadcrumb li:after {
    content: "›";
    margin-left: 5px;
    color: var(--color-text-secondary);
}
.breadcrumb li:last-child:after {
    content: "";
}
.breadcrumb a {
    color: var(--color-holiday-regular-accent);
    text-decoration: none;
}
.breadcrumb a:hover {
    text-decoration: underline;
}

/* Theme toggle */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
    background-color: var(--color-button-secondary);
    color: var(--color-button-text);
    border: 1px solid var(--color-border-medium);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background-color 0.3s ease;
    box-shadow: 0 2px 5px var(--color-shadow);
}
.theme-toggle:hover {
    background-color: var(--color-button-secondary-hover);
}

/* View switcher styles */
.view-switcher {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    gap: 15px;
    flex-wrap: wrap;
}
.view-button {
    padding: 10px 15px;
    background-color: var(--color-button-secondary);
    color: var(--color-button-text);
    border: 1px solid var(--color-border-medium);
    border-radius: 4px;
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}
.view-button:hover {
    background-color: var(--color-button-secondary-hover);
}
.view-button.active {
    background-color: var(--color-nav-bg);
    color: var(--color-nav-text);
    border-color: var(--color-nav-bg);
}
.view-icon {
    margin-right: 8px;
    font-size: 1.2em;
}

/* Calendar grid styles */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 30px;
}
.month-grid {
    border: 1px solid var(--color-border-medium);
    border-radius: 5px;
    overflow: hidden;
}
.month-header {
    background-color: var(--color-nav-bg);
    color: var(--color-nav-text);
    padding: 10px;
    text-align: center;
    font-weight: bold;
}
.weekdays {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    background-color: var(--color-button-secondary);
    border-bottom: 1px solid var(--color-border-medium);
}
.weekday {
    padding: 5px;
    text-align: center;
    font-weight: bold;
    font-size: 0.8em;
}
.week-number {
    background-color: var(--color-week-number-bg);
    border-right: 1px solid var(--color-border-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7em;
    color: var(--color-text-secondary);
}
.days {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
}
.day {
    padding: 5px;
    height: 30px;
    border: 1px solid var(--color-border-light);
    text-align: center;
    font-size: 0.9em;
    position: relative;
}
.day.empty {
    background-color: var(--color-empty-day-bg);
}
.day.today {
    background-color: var(--color-holiday-regular-bg);
    font-weight: bold;
}
.day.holiday {
    position: relative;
}
.day.public-holiday {
    background-color: var(--color-holiday-public-bg);
}
.day.regular-holiday {
    background-color: var(--color-holiday-regular-bg);
}
.holiday-marker {
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 5px;
    height: 5px;
    border-radius: 50%;
}
.public-holiday-marker {
    background-color: var(--color-holiday-public-accent);
}
.regular-holiday-marker {
    background-color: var(--color-holiday-regular-accent);
}
.holiday-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--color-tooltip-bg);
    color: var(--color-tooltip-text);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8em;
    white-space: nowrap;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
    /* Prevent tooltip from being cut off at the edges */
    max-width: 200px;
    text-overflow: ellipsis;
    overflow: hidden;
}

/* Adjust tooltip position when near the left edge */
.days > .day:nth-child(8n+2) .holiday-tooltip,
.days > .day:nth-child(8n+3) .holiday-tooltip {
    left: 0;
    transform: translateX(0);
}

/* Adjust tooltip position when near the right edge */
.days > .day:nth-child(8n+7) .holiday-tooltip,
.days > .day:nth-child(8n+8) .holiday-tooltip {
    left: auto;
    right: 0;
    transform: translateX(0);
}
.day:hover .holiday-tooltip {
    opacity: 1;
    visibility: visible;
}

.holiday-status {
    background-color: var(--color-status-bg);
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 4px var(--color-shadow);
}
.today-is-holiday {
    display: flex;
    align-items: flex-start;
}
.next-holiday {
    display: flex;
    align-items: flex-start;
}
.status-icon {
    font-size: 2rem;
    margin-right: 15px;
    display: inline-block;
}
.status-text {
    flex: 1;
}
.status-title {
    font-size: 1.2rem;
    margin: 0 0 10px 0;
    color: var(--color-heading);
}
.status-description {
    margin: 0;
    color: var(--color-text-secondary);
}
.today-is-holiday .status-title {
    color: var(--color-holiday-public-accent);
}
.next-holiday .status-title {
    color: var(--color-holiday-regular-accent);
}

footer {
    margin-top: 50px;
    text-align: center;
    color: var(--color-footer-text);
    font-size: 0.9em;
    border-top: 1px solid var(--color-border);
    padding-top: 20px;
}

/* Responsive styles */
@media (max-width: 1200px) {
    body {
        padding: 15px;
    }
}

@media (max-width: 992px) {
    .calendar-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .calendar-grid {
        grid-template-columns: 1fr;
    }

    .year-navigation {
        flex-direction: column;
        gap: 10px;
    }

    .year-select-form {
        margin-left: 0;
        margin-top: 10px;
        width: 100%;
        justify-content: center;
    }

    .subscribe-button {
        width: 100%;
    }

    .holiday-status {
        padding: 15px;
    }

    .status-icon {
        font-size: 1.5rem;
    }

    .status-title {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    h1 {
        font-size: 1.5rem;
    }

    .day {
        height: 25px;
        padding: 2px;
        font-size: 0.8em;
    }

    .weekday {
        font-size: 0.7em;
        padding: 3px 2px;
    }

    .week-number {
        font-size: 0.6em;
    }

    .month-header {
        padding: 8px 5px;
        font-size: 0.9em;
    }

    .today-is-holiday, .next-holiday {
        flex-direction: column;
    }

    .status-icon {
        margin-bottom: 10px;
        margin-right: 0;
    }
}
