/**
 * Erişilebilir Takvim Stilleri
 * WCAG 2.1 AA uyumlu - Yüksek kontrast ve focus göstergeleri
 */

.accessible-calendar {
    font-family: 'Roboto', sans-serif;
    max-width: 300px;
    background: #ffffff;
    border-radius: 8px;
    padding: 16px;
}

/* Header */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.calendar-nav {
    width: 36px;
    height: 36px;
    border: 2px solid transparent;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: #333;
}

.calendar-nav:hover {
    background: #018940;
    color: #ffffff;
}

.calendar-nav:focus {
    outline: none;
    border-color: #018940;
    box-shadow: 0 0 0 3px rgba(1, 137, 64, 0.3);
}

.calendar-nav:focus-visible {
    outline: 3px solid #018940;
    outline-offset: 2px;
}

.calendar-title {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid transparent;
    background: #fff;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #333;
    text-align: center;
}

.calendar-title:hover {
    background: #018940;
    color: #ffffff;
}

.calendar-title:focus {
    outline: none;
    border-color: #018940;
    box-shadow: 0 0 0 3px rgba(1, 137, 64, 0.3);
}

.calendar-title:focus-visible {
    outline: 3px solid #018940;
    outline-offset: 2px;
}

/* Days Grid */
.calendar-grid.calendar-days {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.calendar-days th {
    padding: 8px 4px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    border-bottom: 1px solid #eee;
}

.calendar-days td {
    padding: 2px;
    text-align: center;
}

.calendar-day {
    width: 36px;
    height: 36px;
    margin: 0 auto;
    border: 2px solid transparent;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.calendar-day:hover:not(.calendar-day-empty) {
    background: #e8f5e9;
}

.calendar-day:focus {
    outline: none;
}

.calendar-day:focus-visible {
    outline: 3px solid #018940;
    outline-offset: 2px;
}

.calendar-day[tabindex="0"] {
    border-color: #018940;
}

.calendar-day-empty {
    cursor: default;
    pointer-events: none;
}

.calendar-day-today {
    background: #e3f2fd;
    color: #1565c0;
    font-weight: 700;
}

.calendar-day-selected {
    background: #018940 !important;
    color: #ffffff !important;
    font-weight: 700;
}

.calendar-day-has-event {
    position: relative;
}

.calendar-day-has-event::after {
    content: '';
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: #ff5722;
    border-radius: 50%;
}

.calendar-day-selected.calendar-day-has-event::after {
    background: #ffffff;
}

/* Months Grid */
.calendar-months,
.calendar-years {
    display: block;
}

.calendar-grid-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.calendar-month,
.calendar-year {
    padding: 12px 8px;
    border: 2px solid transparent;
    background: #f5f5f5;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    transition: all 0.15s ease;
    text-align: center;
}

.calendar-month:hover,
.calendar-year:hover {
    background: #e8f5e9;
}

.calendar-month:focus,
.calendar-year:focus {
    outline: none;
}

.calendar-month:focus-visible,
.calendar-year:focus-visible {
    outline: 3px solid #018940;
    outline-offset: 2px;
}

.calendar-month-selected,
.calendar-year-selected {
    background: #018940;
    color: #ffffff;
}

.calendar-month-current,
.calendar-year-current {
    border-color: #1565c0;
}

.calendar-year-other {
    color: #999;
}

/* Years Grid - 3 columns for 12 years */
.calendar-years .calendar-grid-row {
    grid-template-columns: repeat(4, 1fr);
}

/* Today Button */
.calendar-today {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 6px;
    border: 2px solid transparent;
    background: #ffffff;
    color: #018940;
    border-radius: 99px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.calendar-today:hover {
    background: #018940;
    color: #ffffff;
}

.calendar-today:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(1, 137, 64, 0.3);
}

.calendar-today:focus-visible {
    outline: 3px solid #018940;
    outline-offset: 2px;
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* High contrast mode support */
@media (prefers-contrast: high) {

    .calendar-day,
    .calendar-month,
    .calendar-year,
    .calendar-nav,
    .calendar-title,
    .calendar-today {
        border-width: 3px;
    }

    .calendar-day-selected {
        border-color: #000000;
    }

    .calendar-day:focus-visible,
    .calendar-month:focus-visible,
    .calendar-year:focus-visible,
    .calendar-nav:focus-visible,
    .calendar-title:focus-visible,
    .calendar-today:focus-visible {
        outline-width: 4px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {

    .calendar-day,
    .calendar-month,
    .calendar-year,
    .calendar-nav,
    .calendar-title,
    .calendar-today {
        transition: none;
    }
}