/* Calendar Page Styles - Cognitive Science of Yoga */

.calendar-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: clamp(2rem, 5vw, 3rem) clamp(1rem, 5vw, 2rem);
}

.calendar-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: clamp(1.2rem, 3vw, 2rem);
    align-items: start;
}

.calendar-main {
    min-width: 0;
}

.calendar-view-tabs {
    display: inline-flex;
    gap: 0.2rem;
    background: #eef3f7;
    border: 1px solid #d5e0e8;
    border-radius: 999px;
    padding: 0.2rem;
    margin-bottom: 0.9rem;
}

.view-tab {
    border: 0;
    background: transparent;
    color: #4c6173;
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    border-radius: 999px;
    padding: 0.42rem 0.85rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.view-tab:hover {
    color: #2a6b5e;
}

.view-tab.is-active {
    background: white;
    color: #2a6b5e;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.calendar-view-panel[hidden] {
    display: none;
}

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

.calendar-toolbar h2 {
    color: #2c3e50;
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    margin: 0;
}

.cal-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    background: #f0f4f8;
    color: #2a6b5e;
    font-size: 1.6rem;
    line-height: 1;
    text-decoration: none;
    border: 1px solid #d1dce5;
    transition: background 0.15s, color 0.15s;
}
.cal-nav:hover {
    background: #2a6b5e;
    color: white;
    border-color: #2a6b5e;
}

.no-upcoming {
    color: #8a9bb0;
    font-style: italic;
    list-style: none;
}

.calendar-grid {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    overflow: hidden;
    border: 1px solid #e6ecef;
}

.agenda-wrapper {
    background: white;
    border-radius: 10px;
    border: 1px solid #e6ecef;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    padding: 0.4rem 0.9rem;
}

.agenda-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.agenda-day-item {
    border-bottom: 1px solid #edf2f6;
    padding: 0.8rem 0;
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 0.8rem;
    align-items: start;
}

.agenda-day-item:last-child {
    border-bottom: 0;
}

.agenda-date {
    font-size: 0.82rem;
    font-weight: 700;
    color: #3a7bd5;
    padding-top: 0.15rem;
}

.agenda-day-events {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.agenda-event-item {
    display: grid;
    grid-template-columns: 10px 1fr auto;
    align-items: center;
    gap: 0.55rem;
    background: #f8fbfc;
    border: 1px solid #e7eef3;
    border-radius: 8px;
    padding: 0.42rem 0.52rem;
}

.agenda-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.agenda-dot.workshop { background: #2a6b5e; }
.agenda-dot.talk { background: #3a7bd5; }
.agenda-dot.meeting { background: #e67e22; }
.agenda-dot.deadline { background: #c0392b; }

.agenda-event-title {
    font-size: 0.9rem;
    color: #334;
}

.agenda-event-type {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #6d7f90;
    background: #eaf1f6;
    border-radius: 999px;
    padding: 0.18rem 0.45rem;
}

.agenda-empty {
    margin: 0.8rem 0;
    color: #8a9bb0;
    font-style: italic;
}

.weekdays,
.days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.weekdays div {
    text-align: center;
    padding: 0.75rem 0.4rem;
    font-size: 0.8rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    font-weight: 700;
    color: #2a6b5e;
    background: #eef7f4;
    border-bottom: 1px solid #e6ecef;
}

.days div {
    min-height: 90px;
    border-right: 1px solid #f0f3f5;
    border-bottom: 1px solid #f0f3f5;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.days div:nth-child(7n) {
    border-right: none;
}

.days .empty {
    background: #fafcfd;
}

.day-number {
    font-size: 0.88rem;
    font-weight: 600;
    color: #456;
}

.day-event {
    font-size: 0.72rem;
    line-height: 1.25;
    padding: 0.2rem 0.35rem;
    border-radius: 4px;
    color: white;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.day-event.workshop { background: #2a6b5e; }
.day-event.talk { background: #3a7bd5; }
.day-event.meeting { background: #e67e22; }
.day-event.deadline { background: #c0392b; }

.today {
    background: #f4fbff;
}

.today .day-number {
    color: #3a7bd5;
}

.calendar-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.calendar-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    border-left: 4px solid #2a6b5e;
    padding: 1rem;
}

.calendar-card h3 {
    margin: 0 0 0.6rem 0;
    color: #2a6b5e;
    font-size: 1.05rem;
}

.upcoming-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.upcoming-list li {
    display: grid;
    grid-template-columns: 3.2rem 1fr;
    gap: 0.65rem;
    align-items: start;
}

.upcoming-date {
    font-size: 0.78rem;
    font-weight: 700;
    color: #3a7bd5;
}

.upcoming-title {
    font-size: 0.88rem;
    color: #555;
}

.calendar-legend {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.calendar-legend span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: #555;
}

.calendar-legend i {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

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

@media (max-width: 768px) {
    .calendar-view-tabs {
        width: 100%;
        justify-content: center;
    }

    .view-tab {
        flex: 1;
    }

    .agenda-day-item {
        grid-template-columns: 1fr;
        gap: 0.45rem;
    }

    .agenda-date {
        padding-top: 0;
    }

    .agenda-event-item {
        grid-template-columns: 10px 1fr;
    }

    .agenda-event-type {
        grid-column: 2;
        justify-self: start;
    }

    .days div {
        min-height: 68px;
        padding: 0.35rem;
    }

    .day-event {
        font-size: 0.65rem;
    }
}

/* Night Mode */
body.night-mode .calendar-toolbar h2 {
    color: #e0e0e0;
}

body.night-mode .calendar-view-tabs {
    background: #1f2a33;
    border-color: #2f3b45;
}

body.night-mode .view-tab {
    color: #97a9b8;
}

body.night-mode .view-tab:hover {
    color: #b6dfca;
}

body.night-mode .view-tab.is-active {
    background: #2b3a46;
    color: #7ec8a0;
}

body.night-mode .calendar-grid,
body.night-mode .agenda-wrapper,
body.night-mode .calendar-card {
    background: #252525;
    border-color: #333;
}

body.night-mode .weekdays div {
    background: #1a2a20;
    color: #7ec8a0;
    border-color: #333;
}

body.night-mode .days div {
    border-color: #333;
}

body.night-mode .days .empty {
    background: #202020;
}

body.night-mode .today {
    background: #1a2a3a;
}

body.night-mode .day-number {
    color: #cfd8dc;
}

body.night-mode .agenda-day-item {
    border-color: #353535;
}

body.night-mode .agenda-date {
    color: #6aadeb;
}

body.night-mode .agenda-event-item {
    background: #1f2428;
    border-color: #394049;
}

body.night-mode .agenda-event-title {
    color: #d4dce2;
}

body.night-mode .agenda-event-type {
    color: #b8c7d4;
    background: #2f3942;
}

body.night-mode .agenda-empty {
    color: #90a4b3;
}

body.night-mode .today .day-number {
    color: #6aadeb;
}

body.night-mode .calendar-card h3 {
    color: #7ec8a0;
}

body.night-mode .upcoming-date {
    color: #6aadeb;
}

body.night-mode .upcoming-title,
body.night-mode .calendar-legend span {
    color: #b0b0b0;
}
