/* calendar.css - Calendar specific styles for Zoom Space */

:root {
    --calendar-grid-border: rgba(255, 255, 255, 0.04);
    --hour-row-height: 70px;
    --time-col-width: 60px;
}

/* Calendar Workspace Layout */
.calendar-workspace {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
    position: relative;
    z-index: 1;
    min-height: 700px;
}

/* Main Calendar Panel */
.calendar-main {
    flex: 1;
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.24);
}

/* Warning Banner styling */
.fallback-banner {
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.15) 0%, rgba(244, 63, 94, 0.05) 100%);
    border-bottom: 1px solid rgba(239, 68, 68, 0.25);
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.85rem;
    color: #fca5a5;
    z-index: 10;
}

.fallback-banner .banner-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.fallback-banner .btn-action {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.fallback-banner .btn-action:hover {
    background: rgba(239, 68, 68, 0.4);
}

/* Calendar Control Bar overrides */
.calendar-header-bar {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.calendar-navigation {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-range-label {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-left: 0.5rem;
    min-width: 180px;
}

/* Tabs View Selectors */
.view-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    padding: 3px;
    border-radius: 12px;
}

.view-tab {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 9px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

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

.view-tab.active {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-primary);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Grid Container */
.calendar-body {
    flex: 1;
    overflow-y: auto;
    position: relative;
    background: rgba(0, 0, 0, 0.05);
}

/* WEEK VIEW & DAY VIEW TIMELINES */
.timeline-container {
    display: flex;
    flex-direction: column;
    min-width: 750px; /* Ensure columns don't squish too much */
    position: relative;
}

.timeline-header {
    display: flex;
    border-bottom: 1px solid var(--card-border);
    background: rgba(10, 10, 14, 0.8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 5;
}

.time-header-cell {
    width: var(--time-col-width);
    flex-shrink: 0;
    border-right: 1px solid var(--calendar-grid-border);
}

.day-header-cell {
    flex: 1;
    padding: 0.75rem 0.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-right: 1px solid var(--calendar-grid-border);
}

.day-header-cell:last-child {
    border-right: none;
}

.day-header-name {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

.day-header-number {
    font-size: 1.25rem;
    font-weight: 600;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-top: 0.25rem;
    color: var(--text-primary);
    transition: var(--transition-smooth);
}

.day-header-cell.today .day-header-number {
    background: var(--accent-indigo);
    color: #fff;
    box-shadow: 0 0 12px var(--accent-indigo-glow);
}

/* Timeline Grid */
.timeline-grid {
    display: flex;
    position: relative;
    padding-top: 10px;
}

.time-axis {
    width: var(--time-col-width);
    flex-shrink: 0;
    border-right: 1px solid var(--calendar-grid-border);
    position: relative;
}

.time-axis-label {
    height: var(--hour-row-height);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: right;
    padding-right: 0.75rem;
    transform: translateY(-8px);
}

.day-columns-container {
    flex: 1;
    display: flex;
    position: relative;
}

.day-column {
    flex: 1;
    border-right: 1px solid var(--calendar-grid-border);
    position: relative;
    height: calc(24 * var(--hour-row-height));
    min-height: calc(24 * var(--hour-row-height));
}

.day-column:last-child {
    border-right: none;
}

/* Hour Grid Lines */
.grid-lines-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.grid-line {
    height: var(--hour-row-height);
    border-bottom: 1px solid var(--calendar-grid-border);
    width: 100%;
}

/* Event block placement */
.event-card {
    position: absolute;
    left: 4px;
    right: 4px;
    border-radius: 8px;
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
    overflow: hidden;
    cursor: pointer;
    z-index: 2;
    border-left: 3px solid transparent;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.event-card:hover {
    z-index: 10;
    transform: scale(1.02);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
    filter: brightness(1.15);
}

.event-card-title {
    font-weight: 600;
    line-height: 1.2;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.15rem;
}

.event-card-time {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.75);
    white-space: nowrap;
    overflow: hidden;
}

.event-card-id {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 0.15rem;
}

/* Current Time Indicator Line */
.current-time-indicator {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: #ef4444;
    z-index: 4;
    pointer-events: none;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.8);
}

.current-time-indicator::before {
    content: '';
    position: absolute;
    left: -4px;
    top: -4px;
    width: 10px;
    height: 10px;
    background: #ef4444;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(239, 68, 68, 1);
}

/* MONTH VIEW GRID */
.month-view-container {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.month-view-header {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    border-bottom: 1px solid var(--card-border);
    background: var(--calendar-grid-border);
    gap: 1px;
}

.month-header-cell {
    background: rgba(10, 10, 14, 0.5);
    padding: 0.75rem 0.5rem;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

.month-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    grid-auto-rows: minmax(110px, 1fr);
    background: var(--calendar-grid-border);
    gap: 1px;
}

.month-day-cell {
    background: var(--bg-primary);
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    position: relative;
    transition: var(--transition-smooth);
    min-height: 110px;
    min-width: 0;
    overflow: hidden;
}

.month-day-cell:hover {
    background: rgba(255, 255, 255, 0.015);
}

.month-day-number {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    align-self: flex-end;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.month-day-cell.today .month-day-number {
    background: var(--accent-indigo);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 0 8px var(--accent-indigo-glow);
}

.month-day-cell.other-month {
    opacity: 0.3;
}

.month-events-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 80px;
    min-width: 0;
}

.month-event-pill {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    color: #fff;
    border-left: 2px solid transparent;
    transition: var(--transition-smooth);
    min-width: 0;
}

.month-event-pill:hover {
    filter: brightness(1.15);
    transform: translateX(2px);
}

/* LIST / AGENDA VIEW */
.list-view-container {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.list-day-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.list-day-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--accent-cyan);
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.list-events-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.list-event-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    transition: var(--transition-smooth);
}

.list-event-item:hover {
    background: rgba(255, 255, 255, 0.04);
    transform: translateX(4px);
    border-color: rgba(255, 255, 255, 0.1);
}

.list-event-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.list-event-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.list-event-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.list-event-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Event Palette Colors (Using HSL for beautiful gradient glows) */
.event-indigo {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(99, 102, 241, 0.1) 100%);
    border-color: rgba(99, 102, 241, 0.3);
    border-left-color: #6366f1;
}
.event-cyan {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.2) 0%, rgba(6, 182, 212, 0.1) 100%);
    border-color: rgba(6, 182, 212, 0.3);
    border-left-color: #06b6d4;
}
.event-emerald {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(16, 185, 129, 0.1) 100%);
    border-color: rgba(16, 185, 129, 0.3);
    border-left-color: #10b981;
}
.event-rose {
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.2) 0%, rgba(244, 63, 94, 0.1) 100%);
    border-color: rgba(244, 63, 94, 0.3);
    border-left-color: #f43f5e;
}
.event-amber {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(245, 158, 11, 0.1) 100%);
    border-color: rgba(245, 158, 11, 0.3);
    border-left-color: #f59e0b;
}
.event-violet {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-color: rgba(139, 92, 246, 0.3);
    border-left-color: #8b5cf6;
}

/* Event Pill variants (Month View) */
.pill-indigo { background: rgba(99, 102, 241, 0.25); border-left-color: #6366f1; color: #c7d2fe; }
.pill-cyan { background: rgba(6, 182, 212, 0.25); border-left-color: #06b6d4; color: #c5f2f7; }
.pill-emerald { background: rgba(16, 185, 129, 0.25); border-left-color: #10b981; color: #d1fae5; }
.pill-rose { background: rgba(244, 63, 94, 0.25); border-left-color: #f43f5e; color: #ffe4e6; }
.pill-amber { background: rgba(245, 158, 11, 0.25); border-left-color: #f59e0b; color: #fef3c7; }
.pill-violet { background: rgba(139, 92, 246, 0.25); border-left-color: #8b5cf6; color: #ede9fe; }

/* Responsive adjustments */
@media (max-width: 992px) {
    .calendar-workspace {
        flex-direction: column;
    }
    .unscheduled-sidebar {
        width: 100%;
        max-height: 250px;
    }
}
