/**
 * Year Tracker - Calendar styles
 * Simple, clean, responsive.
 */

.year-tracker {
    padding: 1rem;
    padding-bottom: 4rem; /* Space for fixed counter */
    max-width: 1200px;
    margin: 0 auto;
}

.year-tracker-nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.year-tracker-nav > *:first-child {
    justify-self: start;
}

.year-tracker-nav .year-tracker-title {
    justify-self: center;
}

.year-tracker-nav > *:last-child {
    justify-self: end;
}

.year-tracker-nav-btn {
    padding: 0.5rem 1rem;
    color: #333;
    text-decoration: none;
    font-size: 0.95rem;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.year-tracker-nav-btn:hover {
    background: #e5e5e5;
    border-color: #ccc;
}

.year-tracker-nav-btn-disabled {
    width: 1px;
    visibility: hidden;
    overflow: hidden;
}

.year-tracker-title {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 600;
}

.year-tracker-months {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.year-tracker-month {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.year-tracker-month-title {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
}

.year-tracker-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 0.5rem;
}

.year-tracker-weekday {
    font-size: 0.7rem;
    font-weight: 600;
    color: #666;
    text-align: center;
}

.year-tracker-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.year-tracker-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.year-tracker-day:hover:not(.year-tracker-day-empty) {
    background: #f5f5f5;
    border-color: #ccc;
}

.year-tracker-day-marked {
    background: #4caf50 !important;
    border-color: #43a047 !important;
    color: #fff;
}

.year-tracker-day-marked:hover {
    background: #43a047 !important;
    border-color: #388e3c !important;
}

.year-tracker-day-empty {
    background: transparent !important;
    border-color: transparent !important;
    cursor: default;
}

/* Fixed counter at bottom - must be direct child of body for iOS (see script.js) */
.year-tracker-counter {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    background: #333;
    color: #fff;
    padding: 0.75rem 1rem;
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
    text-align: center;
    font-weight: 600;
    font-size: 1rem;
    z-index: 999999;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.15);

}

/* Responsive: smaller grids on narrow screens */
@media (max-width: 600px) {
    .year-tracker {
        padding: 0.5rem;
        padding-bottom: 3.5rem;
    }

    .year-tracker-months {
        grid-template-columns: 1fr;
    }

    .year-tracker-day {
        font-size: 0.75rem;
    }

    .year-tracker-weekday {
        font-size: 0.65rem;
    }
}
