/* =====================================================
   OT Events Manager — Calendar Styles
   ===================================================== */

/* ── Outer wrapper: two-column layout ── */
.ot-cal-wrap {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 24px;
    align-items: start;
    font-family: inherit;
    position: relative;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
    box-sizing: border-box;
}

.ot-cal-wrap.ot-cal-loading .ot-cal-grid-wrap {
    opacity: 0.45;
    pointer-events: none;
    transition: opacity 0.2s;
}

/* ══════════════════════════════
   Calendar Main
   ══════════════════════════════ */

.ot-cal-main {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(0,0,0,0.06);
}

/* ── Top bar ── */
.ot-cal-top {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid #e5e7eb;
    flex-wrap: wrap;
}

.ot-cal-today-btn {
    padding: 6px 16px;
    border: 1.5px solid #d1d5db;
    background: #fff;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    color: #374151;
    transition: border-color 0.15s, color 0.15s;
}

.ot-cal-today-btn:hover {
    border-color: var(--ot-accent, #2563eb);
    color: var(--ot-accent, #2563eb);
}

.ot-cal-nav-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    justify-content: center;
}

.ot-cal-nav {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d1d5db;
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    color: #6b7280;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
}

.ot-cal-nav svg {
    width: 16px;
    height: 16px;
    display: block;
    stroke: currentColor;
    fill: none;
    flex-shrink: 0;
}

.ot-cal-nav:hover {
    background: var(--ot-accent-light, #eff6ff);
    border-color: var(--ot-accent, #2563eb);
    color: var(--ot-accent, #2563eb);
}

.ot-cal-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #111827;
    white-space: nowrap;
    min-width: 140px;
    text-align: center;
}

/* ── View tabs ── */
.ot-cal-view-tabs {
    display: flex;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.ot-cal-view-btn {
    padding: 5px 14px;
    background: #fff;
    border: none;
    border-right: 1px solid #e5e7eb;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    color: #6b7280;
    transition: background 0.15s, color 0.15s;
}

.ot-cal-view-btn:last-child {
    border-right: none;
}

.ot-cal-view-btn.active,
.ot-cal-view-btn:hover {
    background: var(--ot-accent, #2563eb);
    color: #fff;
}

/* ══════════════════════════════
   Calendar Grid
   ══════════════════════════════ */

.ot-cal-grid-wrap {
    padding: 0 0 12px;
}

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

/* Day-of-week headers */
.ot-cal-dow {
    padding: 10px 6px;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9ca3af;
    border-bottom: 1px solid #f3f4f6;
}

/* Day cells */
.ot-cal-cell {
    min-height: 90px;
    padding: 6px 5px 5px;
    border-right: 1px solid #f3f4f6;
    border-bottom: 1px solid #f3f4f6;
    position: relative;
    vertical-align: top;
    cursor: default;
    transition: background 0.12s;
}

.ot-cal-cell:nth-child(7n) {
    border-right: none;
}

.ot-cal-cell:hover {
    background: #f9fafb;
}

.ot-cal-empty {
    background: #fafafa;
}

/* Today */
.ot-cal-today {
    background: var(--ot-accent-light, #eff6ff);
}

.ot-cal-today .ot-cal-cell-day {
    background: var(--ot-accent, #2563eb);
    color: #fff;
}

/* Day number */
.ot-cal-cell-day {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
    flex-shrink: 0;
}

/* Event pills */
.ot-cal-event-pill {
    display: block;
    background: var(--ot-accent, #2563eb);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
    line-height: 1.5;
    transition: opacity 0.15s;
}

.ot-cal-event-pill:hover {
    opacity: 0.85;
    color: #fff;
    text-decoration: none;
}

.ot-cal-more {
    font-size: 0.65rem;
    color: #6b7280;
    font-weight: 600;
    padding: 1px 4px;
    cursor: pointer;
}

/* ── Legend ── */
.ot-cal-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    padding: 12px 20px 16px;
    border-top: 1px solid #f3f4f6;
}

.ot-cal-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: #6b7280;
    font-weight: 500;
}

.ot-cal-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ══════════════════════════════
   Sidebar
   ══════════════════════════════ */

.ot-cal-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ot-cal-sidebar-box {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 8px rgba(0,0,0,0.05);
}

.ot-cal-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid #f3f4f6;
}

.ot-cal-sidebar-head h3 {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 700;
    color: #111827;
}

.ot-cal-view-all {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ot-accent, #2563eb);
    text-decoration: none;
    transition: gap 0.15s;
}

.ot-cal-view-all:hover {
    gap: 5px;
    text-decoration: none;
    color: var(--ot-accent, #2563eb);
}

.ot-cal-view-all svg {
    width: 12px;
    height: 12px;
    display: block;
    stroke: currentColor;
    fill: none;
    flex-shrink: 0;
}

/* ── Upcoming events list ── */
.ot-cal-upcoming {
    list-style: none;
    margin: 0;
    padding: 6px 0;
}

.ot-upcoming-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    border-bottom: 1px solid #f9fafb;
    transition: background 0.12s;
}

.ot-upcoming-item:last-child {
    border-bottom: none;
}

.ot-upcoming-item:hover {
    background: #f9fafb;
}

/* Date pill (used when no thumbnail) */
.ot-upcoming-date-pill {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
    line-height: 1;
}

.ot-upcoming-day {
    font-size: 1rem;
    font-weight: 800;
}

.ot-upcoming-mon {
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.9;
}

/* Thumbnail (when event has featured image) */
.ot-upcoming-thumb {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
}

.ot-upcoming-info {
    flex: 1;
    min-width: 0;
}

.ot-upcoming-title {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #111827;
    text-decoration: none;
    line-height: 1.35;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ot-upcoming-title:hover {
    color: var(--ot-accent, #2563eb);
}

.ot-upcoming-meta {
    font-size: 0.72rem;
    color: #9ca3af;
    font-weight: 500;
}

.ot-upcoming-empty {
    padding: 16px 18px;
    font-size: 0.85rem;
    color: #9ca3af;
    font-style: italic;
}

/* ── Calendar Tools ── */
.ot-cal-tools {
    list-style: none;
    margin: 0;
    padding: 6px 0;
}

.ot-cal-tools li {
    border-bottom: 1px solid #f9fafb;
}

.ot-cal-tools li:last-child {
    border-bottom: none;
}

.ot-cal-tool-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    text-decoration: none;
    transition: background 0.12s;
}

.ot-cal-tool-link:hover {
    background: #f9fafb;
    text-decoration: none;
}

.ot-cal-tool-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ot-cal-tool-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.ot-cal-tool-text strong {
    font-size: 0.82rem;
    font-weight: 700;
    color: #111827;
    display: block;
}

.ot-cal-tool-text span {
    font-size: 0.72rem;
    color: #9ca3af;
    display: block;
}

/* ══════════════════════════════
   Week View
   ══════════════════════════════ */

.ot-week-grid {
    grid-template-rows: auto;
}

.ot-week-cell {
    min-height: 130px;
}

/* ══════════════════════════════
   Day View
   ══════════════════════════════ */

.ot-day-view {
    padding: 16px 20px;
}

.ot-day-event-item {
    display: flex;
    align-items: stretch;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
}

.ot-day-event-item:last-child {
    border-bottom: none;
}

.ot-day-event-bar {
    width: 4px;
    border-radius: 2px;
    flex-shrink: 0;
    min-height: 40px;
}

.ot-day-event-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.ot-day-event-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #111827;
    text-decoration: none;
    line-height: 1.35;
}

.ot-day-event-title:hover {
    color: var(--ot-accent, #2563eb);
    text-decoration: none;
}

.ot-day-event-time,
.ot-day-event-venue {
    font-size: 0.76rem;
    color: #9ca3af;
}

.ot-day-no-events {
    padding: 36px 20px;
    text-align: center;
    color: #9ca3af;
    font-style: italic;
    font-size: 0.88rem;
}

/* ══════════════════════════════
   Responsive
   ══════════════════════════════ */

@media ( max-width: 900px ) {
    .ot-cal-wrap {
        grid-template-columns: 1fr;
    }

    .ot-cal-sidebar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }
}

@media ( max-width: 640px ) {
    .ot-cal-top {
        gap: 8px;
        padding: 10px 12px;
    }

    .ot-cal-title {
        font-size: 0.92rem;
        min-width: 110px;
    }

    .ot-cal-cell {
        min-height: 60px;
        padding: 4px 2px 3px;
    }

    .ot-cal-event-pill {
        font-size: 0.6rem;
        padding: 1px 4px;
    }

    .ot-cal-sidebar {
        grid-template-columns: 1fr;
    }
}
