body {
    font-family: system-ui, sans-serif;
    margin: 0;
    padding: 2rem 0;
}

.container {
    max-width: 60rem;
    margin: auto;
    background-color: #fff;
    padding: 2rem;
    border: 1px solid #d6d6d6;
}

h1 {
    margin-bottom: 1rem;
    margin-top: 0;
}

a {
    color: inherit;
    text-decoration: underline;
}

label {
    display: block;
    text-align: left;
    margin: 15px 0 5px;
}

input[type="date"],
input[type="checkbox"] {
    width: 100%;
    padding: 0.5rem;
    box-sizing: border-box;
    border-radius: 0;
    border: 1px solid;
}

input[type="checkbox"] {
    width: auto;
}

.checkbox label {
    display: inline;
    margin-left: 5px;
}

button {
    padding: 12px 20px;
    border: 1px solid;
    border-radius: 0;
    cursor: pointer;
    font-size: 16px;
    margin-top: 20px;
    background-color: white;
}

button:hover {
    background-color: black;
    color: white;
}

#result {
    margin-top: 5px;
    padding: 15px;
    background-color: white;
    border-radius: 0;
    border: 1px solid;
    display: inline-block;
    width: 100%;
    box-sizing: border-box;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 20px;
    }

    .container {
        width: 90%;
        padding: 20px;
    }

    
}

/* ... existing styles ... */

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

table, th, td {
    border: 1px solid;
}

th, td {
    text-align: left;
    padding: 8px;
}

th {
    background-color: #f2f2f2;
    font-weight: normal;
}

/*tr:nth-child(even) {
    background-color: #f9f9f9;
}*/

/* ... existing responsive styles ... */

.description {
    margin: 1rem 0 2rem;
    color: #666;
    line-height: 1.5;
    font-size: 0.95rem;
}

.description p {
    margin: 0;
}

.disclaimer {
    margin-top: 2rem;
    font-size: 0.9rem;
    color: #666;
}

.disclaimer p {
    margin: 0;
}

.ad-container {
    margin: 2rem 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.ad-placeholder {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Responsive ad container */
@media (max-width: 768px) {
    .ad-container {
        margin: 1.5rem 0;
    }
}

.year-calendars {
    margin: 2rem 0;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 0;
}

.calendar-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toolbar-btn {
    padding: 0.5rem;
    background-color: #000;
    color: #fff;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    margin-top: 0;
}

.toolbar-btn:hover,
.toolbar-btn:focus-visible {
    background-color: #0f2f35;
    border-color: #0f2f35;
}

.toolbar-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

.calendar-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.calendar-nav {
    
    padding: 0.5rem;
    background-color: #000;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0;
    line-height: 1;
}



.calendar-nav:disabled {
    opacity: 0.4;
    cursor: default;
}

.calendar-year-label {
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: white;
    background-color: #000;
    padding: 0.5rem;
}

.calendar-grid {
    margin-top: 1rem;
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
}

.calendar-card {
    display: flex;
    flex-direction: column;
    min-height: 17rem;
}

.calendar-header {
    color: #000;
    font-weight: 600;
    font-size: 1rem;
    text-transform: uppercase;
}

.calendar-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
    border: 1px solid #dfdfdf;
    font-size: 0.8rem;
}

.calendar-table th,
.calendar-table td {
    border: 1px solid #000;
    text-align: center;
    padding: 0.35rem;
    width: 14.2857%;
}

.calendar-table th {
    background: #000;
    color: #fff;
    font-weight: 600;
}

.calendar-table td.outside-month {
    color: #b3b3b3;
    background-color: #fafafa;
}

.calendar-table td.weekend {
    background-color: gainsboro;
    color: #000;
}

.calendar-table td.holiday {
    background-color: red;
    color: #fff;
    font-weight: 600;
}

.calendar-table td.substitute-day,
.calendar-table td.transferred-day,
.calendar-table td.shortened-day {
    background-color: orange;
    color: #6b3e04;
    font-weight: 600;
}

.calendar-footer {
    margin-top: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.calendar-summary {
    display: flex;
    align-items: baseline;
    flex-direction: column;
    gap: 0;
    font-size: 0.85rem;
}

.calendar-summary strong {
    font-weight: 600;
}

.calendar-actions {
    display: flex;
    justify-content: flex-end;
}

.holiday-button {
    padding: 0.5rem;
    font-size: 0.9rem;
    background-color: #000;
    color: #fff;
    cursor: pointer;
    margin-top: 0;
}

.holiday-button:hover,
.holiday-button:focus-visible {
    background-color: #000;
    border-color: #000;
    color: #fff;
}

.holiday-list {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #000;
    font-size: 0.8rem;
    display: none;
}

.holiday-list.visible {
    display: block;
}

.holiday-list p {
    margin: 0 0 0.45rem;
}

.calendar-error {
    padding: 1rem;
    border: 1px solid #000;
    background-color: #fff4e5;
    color: #8a4600;
    font-size: 0.9rem;
    border-radius: 4px;
    text-align: center;
}

.faq {
    margin: 2.5rem 0 2rem;
}

.faq h2 {
    font-size: 1.6rem;
    margin-bottom: 1rem;
}

.faq-item {
    margin-bottom: 1.5rem;
}

.faq-item h3 {
    font-size: 1.05rem;
    margin: 0 0 0.35rem;
}

.faq-item p {
    margin: 0;
    color: #444;
    line-height: 1.5;
}


@media (max-width: 768px) {
    .calendar-grid {
        grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
        gap: 1rem;
    }

    /*.calendar-card {
        padding: 0.75rem;
    }*/

    .calendar-toolbar {
        flex-direction: row;
        align-items: stretch;
    }

    .toolbar-left,
    .toolbar-right {
        justify-content: space-between;
    }
}

@media print {
    @page {
        size: A4 portrait;
        margin: 10mm;
    }

    body {
        padding: 0;
        font-size: 11px;
    }

    .container {
        border: none;
        box-shadow: none;
        padding: 0;
    }

    .calendar-toolbar,
    .calendar-actions,
    .holiday-button,
    .calendar-error {
        display: none !important;
    }

    .year-calendars {
        gap: 1rem;
    }

    .calendar-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }

    .calendar-card {
        padding: 0.5rem;
        min-height: auto;
        border: 1px solid #ccc;
        box-shadow: none;
    }

    .calendar-header {
        font-size: 0.85rem;
        padding: 0.35rem 0.5rem;
    }

    .calendar-table {
        margin-top: 0.4rem;
        font-size: 0.65rem;
    }

    .calendar-table th,
    .calendar-table td {
        padding: 0.2rem;
    }

    .calendar-footer {
        margin-top: 0.4rem;
    }

    .calendar-summary {
        align-items: flex-start;
        gap: 0.15rem;
        font-size: 0.7rem;
    }

    .holiday-list {
        font-size: 0.7rem;
    }
}
