/* ============================================
   GENZFLOW — CONTENT CALENDAR
   Monthly calendar grid for post scheduling
   ============================================ */

.calendar-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.calendar-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.calendar-nav-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary, #8a8a9a);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.calendar-nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary, #f0f0f5);
}

.calendar-month-label {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary, #f0f0f5);
    min-width: 160px;
    text-align: center;
}

.calendar-today-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary, #8a8a9a);
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.calendar-today-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary, #f0f0f5);
}

/* Calendar Grid */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.calendar-day-header {
    padding: 10px 8px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted, #55556a);
    background: rgba(255, 255, 255, 0.02);
}

.calendar-day {
    min-height: 100px;
    padding: 8px;
    background: var(--card-bg, rgba(255, 255, 255, 0.02));
    cursor: pointer;
    transition: background 0.15s ease;
    position: relative;
}

.calendar-day:hover {
    background: rgba(255, 255, 255, 0.05);
}

.calendar-day.other-month {
    opacity: 0.3;
}

.calendar-day.today {
    background: rgba(110, 86, 207, 0.08);
    box-shadow: inset 0 0 0 1px rgba(110, 86, 207, 0.3);
}

.calendar-day-number {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary, #8a8a9a);
    margin-bottom: 6px;
}

.calendar-day.today .calendar-day-number {
    color: hsl(245, 70%, 62%);
    font-weight: 700;
}

/* Post dots */
.calendar-dots {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.calendar-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.calendar-dot.published {
    background: hsl(145, 60%, 45%);
}

.calendar-dot.scheduled {
    background: hsl(45, 80%, 55%);
}

.calendar-dot.draft {
    background: rgba(255, 255, 255, 0.2);
}

.calendar-dot.failed {
    background: hsl(0, 65%, 50%);
}

/* Day popover */
.calendar-popover {
    position: fixed;
    z-index: 1000;
    background: var(--card-bg, #1a1a24);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
    min-width: 280px;
    max-width: 340px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    animation: popoverIn 0.2s ease;
}

@keyframes popoverIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.calendar-popover-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #f0f0f5);
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.calendar-popover-close {
    background: none;
    border: none;
    color: var(--text-muted, #55556a);
    cursor: pointer;
    padding: 2px;
}

.calendar-popover-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    transition: background 0.15s ease;
    cursor: pointer;
}

.calendar-popover-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.calendar-popover-item .pop-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.calendar-popover-item .pop-caption {
    font-size: 13px;
    color: var(--text-primary, #f0f0f5);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-popover-item .pop-platform {
    font-size: 11px;
    color: var(--text-muted, #55556a);
}

.calendar-popover-empty {
    font-size: 13px;
    color: var(--text-muted, #55556a);
    text-align: center;
    padding: 16px 0;
}

/* Responsive: mobile list view */
@media (max-width: 640px) {
    .calendar-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .calendar-day-header {
        display: none;
    }

    .calendar-day {
        min-height: auto;
        padding: 12px 16px;
        display: flex;
        align-items: center;
        gap: 12px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    }

    .calendar-day.other-month {
        display: none;
    }

    .calendar-day-number {
        min-width: 28px;
        margin-bottom: 0;
        font-size: 14px;
    }

    .calendar-dots {
        flex: 1;
    }
}

/* Light mode */
[data-theme="light"] .calendar-nav-btn {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .calendar-popover {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}