/* ============================================
   Mastering.com Member Mentorship Calendar
   Style Guide: Dark purple + gold accents
   ============================================ */

:root {
    --bg-primary: #1B0B35;
    --bg-card: #221338;
    --accent-blue: #2B52DE;
    --accent-gold: #D3A65E;
    --text-primary: #FFFFFF;
    --text-secondary: #B8A9CC;
    --text-muted: #7B6B8F;
    --hover-purple: #3A2055;
    --border-color: #3A2055;
    --radius: 12px;
    --radius-sm: 8px;

    /* Font stacks */
    --font-display: 'Gotham', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-body: 'Gotham', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
}

/* ---- Top Navigation ---- */

.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-primary);
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-nav__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.top-nav__logo-img {
    height: 44px;
    width: auto;
    object-fit: contain;
}

.top-nav__logo {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 28px;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.top-nav__logo span {
    color: var(--accent-gold);
}

.top-nav__subtitle {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    font-weight: 500;
}

.top-nav__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    cursor: pointer;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn--default {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn--default:hover {
    background: var(--hover-purple);
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

.btn--primary {
    background: var(--accent-blue);
    color: var(--text-primary);
    border-color: var(--accent-blue);
}

.btn--primary:hover {
    background: var(--accent-gold);
    border-color: var(--accent-gold);
    color: var(--bg-primary);
}

.btn--gold {
    background: var(--accent-gold);
    color: var(--bg-primary);
    border-color: var(--accent-gold);
    font-weight: 700;
}

.btn--gold:hover {
    background: #e6b96e;
    border-color: #e6b96e;
    color: var(--bg-primary);
}

.btn--sm {
    padding: 8px 16px;
    font-size: 11px;
    white-space: nowrap;
}

/* ---- Main Layout ---- */

.main-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 0;
    height: calc(100vh - 65px);
}

@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 1fr;
        height: auto;
        min-height: calc(100vh - 65px);
    }
}

/* ---- Calendar Panel (Left) ---- */

.calendar-panel {
    padding: 32px;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.calendar-header__title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 32px;
}

.calendar-header__nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.calendar-header__nav button:not(.btn) {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s;
}

.calendar-header__nav button:not(.btn):hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

.calendar-header__month {
    font-size: 16px;
    font-weight: 600;
    min-width: 160px;
    text-align: center;
}

/* ---- Calendar Grid ---- */

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
    flex: 1;
    min-height: 0;
}

.calendar-grid__day-header {
    background: var(--bg-card);
    padding: 12px 8px;
    text-align: center;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    font-weight: 600;
}

.calendar-grid__cell {
    background: var(--bg-primary);
    min-height: 100px;
    padding: 8px;
    cursor: pointer;
    transition: background 0.15s;
    position: relative;
}

.calendar-grid__cell:hover {
    background: var(--hover-purple);
}

.calendar-grid__cell--other-month {
    opacity: 0.3;
}

.calendar-grid__cell--today {
    background: rgba(43, 82, 222, 0.1);
}

.calendar-grid__cell--today .calendar-grid__date {
    background: var(--accent-blue);
    color: #fff;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-grid__date {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 4px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-grid__event {
    background: var(--accent-blue);
    color: #fff;
    font-size: 11px;
    padding: 3px 6px;
    border-radius: 4px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: background 0.15s;
    font-weight: 500;
}

.calendar-grid__event:hover {
    background: var(--accent-gold);
    color: var(--bg-primary);
}

.calendar-grid__event--more {
    background: transparent;
    color: var(--accent-gold);
    font-weight: 600;
    padding: 2px 6px;
}

/* ---- Meetings Sidebar (Right) ---- */

.meetings-panel {
    padding: 32px 24px;
    overflow-y: auto;
    max-height: calc(100vh - 65px);
    position: sticky;
    top: 65px;
}

.meetings-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.meetings-panel__title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 24px;
}

.meetings-panel__count {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

/* ---- Eyebrow labels ---- */

.eyebrow {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-gold);
    font-weight: 600;
    margin-bottom: 4px;
}

/* ---- Meeting Cards ---- */

.meeting-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.meeting-card:hover {
    border-color: var(--accent-gold);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.meeting-card__date {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-gold);
    font-weight: 600;
    margin-bottom: 8px;
}

.meeting-card__title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.meeting-card__time {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.meeting-card__time svg {
    width: 14px;
    height: 14px;
    opacity: 0.6;
}

.meeting-card__zoom-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 10px;
    padding: 4px 10px;
    background: rgba(43, 82, 222, 0.15);
    border-radius: 20px;
    font-size: 11px;
    color: var(--accent-blue);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ---- Date Group Dividers ---- */

.date-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 12px;
}

.date-divider__label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    font-weight: 600;
    white-space: nowrap;
}

.date-divider__line {
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

/* ---- Modal / Popup ---- */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 4, 22, 0.85);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    max-width: 520px;
    width: 90%;
    padding: 0;
    transform: translateY(20px) scale(0.97);
    transition: transform 0.25s ease;
    overflow: hidden;
}

.modal-overlay.active .modal {
    transform: translateY(0) scale(1);
}

.modal__header {
    padding: 24px 28px 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.modal__close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.15s;
}

.modal__close:hover {
    color: var(--text-primary);
}

.modal__body {
    padding: 20px 28px 28px;
}

.modal__event-type {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-gold);
    font-weight: 600;
    margin-bottom: 8px;
}

.modal__title {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.2;
}

.modal__detail {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-secondary);
}

.modal__detail:last-of-type {
    border-bottom: none;
}

.modal__detail-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: rgba(43, 82, 222, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.modal__detail-icon svg {
    width: 18px;
    height: 18px;
    color: var(--accent-blue);
}

.modal__zoom-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 24px;
    margin-top: 20px;
    background: var(--accent-blue);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
}

.modal__zoom-cta:hover {
    background: var(--accent-gold);
    color: var(--bg-primary);
}

.modal__zoom-cta:disabled,
.modal__zoom-cta--disabled {
    background: var(--border-color);
    cursor: not-allowed;
    opacity: 0.5;
}

.modal__description {
    margin-top: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ---- Add to Calendar Dropdown ---- */

.add-to-cal {
    position: relative;
    margin-top: 12px;
}

.add-to-cal__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 24px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: all 0.2s;
}

.add-to-cal__btn:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

.add-to-cal__chevron {
    transition: transform 0.2s;
}

.add-to-cal.open .add-to-cal__chevron {
    transform: rotate(180deg);
}

.add-to-cal__dropdown {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    margin-bottom: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    z-index: 10;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
}

.add-to-cal.open .add-to-cal__dropdown {
    display: block;
}

.add-to-cal__option {
    display: block;
    padding: 12px 16px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s;
    border-bottom: 1px solid var(--border-color);
}

.add-to-cal__option:last-child {
    border-bottom: none;
}

.add-to-cal__option:hover {
    background: var(--hover-purple);
    color: var(--accent-gold);
}

/* ---- Empty State ---- */

.empty-state {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-muted);
}

.empty-state__icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state__title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state__text {
    font-size: 13px;
}

/* ---- Loading Spinner ---- */

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---- Timezone Bar ---- */

.tz-bar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tz-bar__time {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.tz-bar__select {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 11px;
    padding: 5px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    max-width: 180px;
    transition: border-color 0.15s;
    appearance: auto;
}

.tz-bar__select:hover,
.tz-bar__select:focus {
    border-color: var(--accent-gold);
    outline: none;
}

/* ---- Sync indicator ---- */

.sync-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sync-indicator__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #2ecc71;
}

.sync-indicator__dot--stale {
    background: var(--accent-gold);
}

/* ---- Scrollbar ---- */

.meetings-panel::-webkit-scrollbar {
    width: 6px;
}

.meetings-panel::-webkit-scrollbar-track {
    background: transparent;
}

.meetings-panel::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.meetings-panel::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ---- Responsive ---- */

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

    .calendar-panel {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .meetings-panel {
        max-height: none;
        position: static;
    }
}

@media (max-width: 768px) {
    .top-nav {
        flex-wrap: wrap;
        padding: 12px 16px;
        gap: 12px;
    }

    .top-nav__brand {
        flex: 1;
        min-width: 0;
    }

    .top-nav__logo-img {
        height: 32px;
    }

    .top-nav__subtitle {
        font-size: 10px;
        letter-spacing: 1.5px;
    }

    .top-nav__actions {
        width: 100%;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: space-between;
    }

    .tz-bar {
        flex: 1;
        min-width: 0;
    }

    .tz-bar__select {
        flex: 1;
        min-width: 0;
        max-width: none;
    }

    .calendar-header {
        flex-wrap: wrap;
        gap: 12px;
    }

    .calendar-header__title {
        font-size: 24px;
    }
}

@media (max-width: 640px) {
    .top-nav {
        padding: 10px 12px;
    }

    .calendar-panel {
        padding: 16px;
    }

    .calendar-grid__cell {
        min-height: 60px;
        padding: 4px;
    }

    .calendar-grid__event {
        font-size: 10px;
        padding: 2px 4px;
    }

    .meetings-panel {
        padding: 16px;
    }

    .sync-indicator {
        display: none;
    }
}
