/* =============================================
   SIDEBAR.CSS - Left Sidebar and Mini Calendar Styling
   ============================================= */

/* Left Sidebar Container */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    height: calc(100vh);  /* Full viewport height */
    flex-shrink: 0;
    border-right: 1px solid var(--border);
    background: #F6F6F6;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    transition: transform var(--duration-slow) var(--ease-out);
}

/* Collapsed sidebar state */
.sidebar.collapsed {
    transform: translateX(-100%);
}

/* =============================================
   SIDEBAR HEADER - Toggle and Create Buttons
   ============================================= */

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-4);
    background: #F6F6F6;
}

.sidebar-toggle-btn,
.create-event-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: #6B7280;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
}

.sidebar-toggle-btn:hover,
.create-event-btn:hover {
    background: #EBEBEB;
    color: #1A1A1A;
}

/* =============================================
   SIDEBAR CONTENT - Scrollable Area
   ============================================= */

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-4);
}

/* =============================================
   SIDEBAR FOOTER - Logo
   ============================================= */

.sidebar-footer {
    padding: var(--space-5) var(--space-4);
    display: flex;
    justify-content: center;
    align-items: center;
    background: #F6F6F6;
}

.sidebar-logo-img {
    height: 16px;
    width: auto;
    filter: brightness(0) saturate(100%) invert(70%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(90%) contrast(90%);
    /* Results in approximately #A4A4A4 color */
}

.sidebar-logo {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 400;
    font-style: italic;
    color: #A4A4A4;
    letter-spacing: 1px;
}

/* =============================================
   MINI CALENDAR - Compact Design to Fit Sidebar
   ============================================= */

.mini-calendar {
    background: #FFFFFF;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

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

.mini-calendar-month {
    font-size: 16px;
    font-weight: 600;
    color: #1A1A1A;
}

.mini-calendar-nav {
    display: flex;
    gap: 8px;
}

.mini-calendar-nav button {
    background: transparent;
    border: none;
    font-size: 16px;
    color: #9CA3AF;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease;
}

.mini-calendar-nav button:hover {
    color: #4A4A4A;
}

.mini-calendar-nav button svg {
    width: 14px;
    height: 14px;
}

/* Mini Calendar Weekday Headers */
.mini-day-header {
    font-size: 11px;
    font-weight: 500;
    color: #9CA3AF;
    text-align: center;
    padding-bottom: 8px;
}

/* Mini Calendar Grid - Always 6 rows for consistent height */
.mini-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: auto repeat(6, 1fr);  /* Header row + 6 week rows */
    gap: 4px;
    text-align: center;
    width: 100%;
}

/* =============================================
   CYCLE PHASE COLORS - Soft Pastels
   ============================================= */

:root {
    --cycle-menstrual: #FADDE5;    /* Soft pink fill */
    --cycle-follicular: #D4EDED;   /* Soft teal/blue */
    --cycle-ovulation: #C5E5E2;    /* Slightly more saturated teal */
    --cycle-luteal: #F0F0F0;       /* Light gray */
    --cycle-predicted: #E8B4BC;    /* Pink dashed border */
    --cycle-today: #4A8F88;        /* Solid muted teal */
}

/* =============================================
   MINI CALENDAR DAY CELLS - Compact Sizing
   ============================================= */

.mini-day {
    aspect-ratio: 1;
    width: 100%;
    max-width: 28px;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    margin: 0 auto;
    transition: all 0.15s ease;
    position: relative;
    box-sizing: border-box;
    /* Default: light gray background for all days */
    background: #F0F0F0;
    color: #6B7280;
}

.mini-day:hover {
    opacity: 0.8;
}

.mini-day-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Hide TODAY label - cleaner look */
.today-label {
    display: none;
}

/* =============================================
   CYCLE PHASE STYLING - Filled Circles
   ============================================= */

/* Menstrual/Period Phase - Soft pink filled circle */
.mini-calendar-grid .mini-day.menstrual {
    background: var(--cycle-menstrual);
    color: #4A4A4A;
}

.mini-calendar-grid .mini-day.menstrual:hover {
    background: #f5ccd6;
}

/* Follicular Phase - Light blue/teal filled circle */
.mini-calendar-grid .mini-day.follicular {
    background: var(--cycle-follicular);
    color: #4A4A4A;
}

.mini-calendar-grid .mini-day.follicular:hover {
    background: #c4e3e3;
}

/* Ovulation Phase - Slightly more saturated teal circle */
.mini-calendar-grid .mini-day.ovulation {
    background: var(--cycle-ovulation);
    color: #4A4A4A;
}

.mini-calendar-grid .mini-day.ovulation:hover {
    background: #b5dbd8;
}

/* Luteal Phase - Light gray filled circle */
.mini-calendar-grid .mini-day.luteal {
    background: var(--cycle-luteal);
    color: #6B7280;
}

.mini-calendar-grid .mini-day.luteal:hover {
    background: #e5e5e5;
}

/* Predicted Period - Pink dashed outline, no fill */
.mini-calendar-grid .mini-day.predicted {
    background: transparent;
    color: #D4878F;
    border: 1.5px dashed var(--cycle-predicted);
}

.mini-calendar-grid .mini-day.predicted:hover {
    background: rgba(232, 180, 188, 0.1);
}

/* =============================================
   TODAY MARKER
   ============================================= */

.mini-calendar-grid .mini-day.today {
    background: var(--cycle-today) !important;
    color: #FFFFFF !important;
    font-weight: 600;
    border: none !important;
}

.mini-calendar-grid .mini-day.today:hover {
    background: #3d7a74 !important;
}

/* =============================================
   OTHER MONTH DAYS
   ============================================= */

.mini-calendar-grid .mini-day.other-month {
    background: #F5F5F5;
    color: #C0C0C0;
}

.mini-calendar-grid .mini-day.other-month:hover {
    background: #EBEBEB;
}

/* =============================================
   CYCLE PHASE LEGEND - Compact Two Row Layout
   ============================================= */

.cycle-legend {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #EBEBEB;
}

.cycle-legend-row {
    display: flex;
    gap: 16px;
    margin-bottom: 8px;
}

.cycle-legend-row:last-child {
    margin-bottom: 0;
}

.cycle-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #6B7280;
}

.cycle-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.cycle-legend-dot.menstrual { background: #F2A0AC; }
.cycle-legend-dot.follicular { background: #7ECEC8; }
.cycle-legend-dot.ovulation { background: #4A9F97; }
.cycle-legend-dot.luteal { background: #D0D0D0; }
.cycle-legend-dot.predicted {
    background: transparent;
    border: 1.5px dashed #E8B4BC;
    width: 6px;
    height: 6px;
}

/* =============================================
   CALENDARS LIST
   ============================================= */

.calendars-section {
    flex: 1;
}

.calendars-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-2);
    padding: 0 var(--space-1);
}

.calendars-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--warm-gray);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.calendars-toggle {
    background: transparent;
    border: none;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--warm-gray);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--duration-fast) var(--ease-out);
}

.calendars-toggle:hover {
    background: var(--cream);
    color: var(--ink);
}

.calendars-toggle svg {
    width: 14px;
    height: 14px;
}

/* Calendar Items */
.calendar-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.calendar-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-2);
    cursor: pointer;
    color: var(--ink);
    border-radius: var(--radius-md);
    transition: all var(--duration-fast) var(--ease-out);
}

.calendar-item:hover {
    background: var(--cream);
}

/* Calendar Color Dot - Always visible colored circle */
.calendar-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.calendar-dot.coral { background: var(--coral); }
.calendar-dot.sage { background: var(--sage); }
.calendar-dot.lavender { background: var(--lavender); }
.calendar-dot.honey { background: var(--honey); }

/* Hide checkbox visually but keep it accessible */
.calendar-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Dim dot when unchecked */
.calendar-item input[type="checkbox"]:not(:checked) + .calendar-dot {
    opacity: 0.3;
}

.calendar-item input[type="checkbox"]:not(:checked) ~ .calendar-name {
    opacity: 0.5;
    text-decoration: line-through;
}

.calendar-name {
    font-size: 13px;
    color: var(--ink);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Add Calendar Button */
.add-calendar-btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-2);
    color: var(--warm-gray);
    font-size: 13px;
    cursor: pointer;
    margin-top: var(--space-2);
    border-radius: var(--radius-md);
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    transition: all var(--duration-fast) var(--ease-out);
}

.add-calendar-btn:hover {
    background: var(--cream);
    color: var(--coral);
}

.add-calendar-btn svg {
    width: 16px;
    height: 16px;
}

/* =============================================
   SIDEBAR DIVIDER
   ============================================= */

.sidebar-divider {
    height: 1px;
    background: var(--border);
    margin: var(--space-4) 0;
}

/* =============================================
   CYCLE STATUS CARD
   ============================================= */

.cycle-status {
    background: #FFFFFF;
    border-radius: 12px;
    padding: var(--space-4);
    margin-bottom: var(--space-4);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: none;
}

.cycle-status-card {
    background: #FFFFFF;
    border-radius: 12px;
    padding: var(--space-4);
    margin-bottom: var(--space-4);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Phase-specific status card backgrounds - subtle tints on white */
.cycle-status.menstrual-phase {
    background: linear-gradient(135deg, #FFFFFF 0%, rgba(248, 180, 200, 0.08) 100%);
}

.cycle-status.follicular-phase {
    background: linear-gradient(135deg, #FFFFFF 0%, rgba(126, 206, 198, 0.08) 100%);
}

.cycle-status.ovulation-phase {
    background: linear-gradient(135deg, #FFFFFF 0%, rgba(107, 184, 178, 0.08) 100%);
}

.cycle-status.luteal-phase {
    background: #FFFFFF;
}

/* Phase indicator colors */
.cycle-phase-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.cycle-phase-indicator.menstrual { background: var(--cycle-menstrual); }
.cycle-phase-indicator.follicular { background: var(--cycle-follicular); }
.cycle-phase-indicator.ovulation { background: var(--cycle-ovulation); }
.cycle-phase-indicator.luteal { background: var(--cycle-luteal); }
.cycle-phase-indicator.predicted {
    background: transparent;
    border: 2px dotted var(--cycle-predicted);
}

.cycle-status-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

.cycle-status-icon {
    font-size: 16px;
}

.cycle-status-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--charcoal);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cycle-status-phase {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 400;
    color: var(--ink);
    margin-bottom: var(--space-1);
}

.cycle-status-day {
    font-size: 12px;
    color: var(--charcoal);
}

.energy-indicator {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid rgba(45, 42, 38, 0.08);
}

.energy-label {
    font-size: 11px;
    color: var(--charcoal);
    margin-right: var(--space-1);
}

.energy-bolt {
    font-size: 12px;
    opacity: 0.3;
    transition: opacity var(--duration-fast) var(--ease-out);
}

.energy-bolt.active {
    opacity: 1;
}

/* Energy Level Text Display */
.energy-level-text {
    font-size: 13px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: var(--radius-full);
}

.energy-level-text.low {
    background: rgba(248, 180, 200, 0.2);
    color: #c48a9e;
}

.energy-level-text.medium {
    background: rgba(26, 26, 26, 0.1);
    color: var(--charcoal);
}

.energy-level-text.high {
    background: rgba(126, 206, 198, 0.15);
    color: var(--cycle-follicular);
}

.energy-level-text.peak {
    background: rgba(107, 184, 178, 0.15);
    color: var(--cycle-ovulation);
}

/* =============================================
   RESPONSIVE SIDEBAR STYLES
   ============================================= */

/* Tablet: 768px - 1200px */
@media (max-width: 1200px) {
    .sidebar {
        width: 280px;
        min-width: 280px;
    }
}

/* Mobile: < 768px */
@media (max-width: 768px) {
    .sidebar {
        width: 85vw;
        max-width: 320px;
        min-width: auto;
    }

    .mini-calendar {
        margin-bottom: var(--space-4);
    }

    .mini-calendar-grid .mini-day {
        width: 32px;
        height: 32px;
    }

    .cycle-status {
        padding: var(--space-3);
    }

    .calendars-section {
        display: none;
    }
}
