/* Lab Schedule Heatmap - Cosme Lab Dracula Theme */

:root {
    /* Dracula Dark Backgrounds */
    --bg-dark: #1a1b26;
    --bg-light: #24283b;
    --bg-darker: #16161e;

    /* UCR Brand Colors */
    --ucr-gold: #FFB81C;

    /* Dracula Colors */
    --fg-light: #f8f8f2;
    --cyan: #8be9fd;
    --green: #50fa7b;
    --purple: #bd93f9;
    --red: #ff5555;
    --comment: #7c8db0;
}

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

body {
    font-family: 'Open Sans', sans-serif;
    background: var(--bg-dark);
    color: var(--cyan);
    padding: 2rem;
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem;
    background: var(--bg-light);
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    border: 1px solid rgba(189, 147, 249, 0.2);
    transition: all 0.3s ease;
}

header:hover {
    box-shadow: 0 0 20px rgba(189, 147, 249, 0.6),
                0 0 30px rgba(189, 147, 249, 0.4);
    border-color: rgba(189, 147, 249, 0.5);
}

header h1 {
    font-family: 'Maven Pro', sans-serif;
    color: var(--purple);
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 5px rgba(189, 147, 249, 0.3);
}

.subtitle {
    color: var(--cyan);
    font-size: 1.1rem;
    text-shadow: 0 0 5px rgba(139, 233, 253, 0.3);
    margin-bottom: 0.5rem;
}

.week-info {
    color: var(--ucr-gold);
    font-size: 1rem;
    margin-top: 0.5rem;
}

.week-info span {
    font-weight: 600;
}

/* Instructions */
.instructions {
    background: rgba(139, 233, 253, 0.1);
    padding: 1rem;
    border-radius: 8px;
    border-left: 3px solid var(--cyan);
    margin-bottom: 2rem;
    box-shadow: 0 0 10px rgba(139, 233, 253, 0.2);
}

.instructions i {
    margin-right: 0.5rem;
}

/* Heatmap Container */
.heatmap-container {
    background: var(--bg-light);
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    border: 1px solid rgba(189, 147, 249, 0.2);
    transition: all 0.3s ease;
}

.heatmap-container:hover {
    box-shadow: 0 0 20px rgba(189, 147, 249, 0.6),
                0 0 30px rgba(189, 147, 249, 0.4);
    border-color: rgba(189, 147, 249, 0.5);
}

/* Stats Panel - WoW Style */
.stats-panel {
    margin-bottom: 2rem;
    background: rgba(22, 22, 30, 0.6);
    padding: 1.5rem;
    border-radius: 10px;
    border: 1px solid rgba(189, 147, 249, 0.3);
}

.stats-panel h4 {
    color: var(--purple);
    font-family: 'Maven Pro', sans-serif;
    text-shadow: 0 0 10px rgba(189, 147, 249, 0.5);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.stats-panel h4 i {
    margin-right: 0.5rem;
}

.stats-hint {
    color: var(--cyan);
    font-size: 0.85rem;
    text-align: center;
    margin: 0.75rem 0 1rem 0;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, rgba(189, 147, 249, 0.25), rgba(189, 147, 249, 0.1));
    border-radius: 8px;
    border: 1px solid rgba(189, 147, 249, 0.3);
    box-shadow: 0 0 15px rgba(189, 147, 249, 0.3);
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: default;
}

.stats-hint:hover {
    background: linear-gradient(135deg, rgba(189, 147, 249, 0.35), rgba(189, 147, 249, 0.15));
    border-color: var(--purple);
    box-shadow: 0 0 20px rgba(189, 147, 249, 0.5);
    transform: translateY(-2px);
}

.stats-hint i {
    margin-right: 0.35rem;
    color: var(--purple);
    animation: pointPulse 2s infinite;
    filter: drop-shadow(0 0 5px rgba(189, 147, 249, 0.8));
    transition: all 0.3s ease;
    display: inline-block;
}

.stats-hint:hover i {
    transform: scale(1.2);
    filter: drop-shadow(0 0 8px rgba(189, 147, 249, 0.9));
}

@keyframes pointPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

.student-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    padding: 1rem 0;
}

/* Floating Bubble Design */
.student-bubble {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0.5rem;
}

.student-bubble:hover {
    transform: translateY(-3px);
}

/* Bubble Circle */
.student-bubble-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    background: linear-gradient(145deg, #2a2d3a, #1a1d2a);
    box-shadow:
        0 4px 10px rgba(0, 0, 0, 0.4),
        inset 0 2px 5px rgba(255, 255, 255, 0.1);
    border: 3px solid;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.student-bubble-circle::before {
    content: '';
    position: absolute;
    top: 10%;
    left: 15%;
    width: 40%;
    height: 35%;
    background: radial-gradient(ellipse, rgba(255, 255, 255, 0.25), transparent);
    border-radius: 50%;
    filter: blur(3px);
}

.student-bubble:hover .student-bubble-circle {
    transform: scale(1.05);
    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.6),
        0 0 25px rgba(189, 147, 249, 0.8),
        0 0 35px rgba(189, 147, 249, 0.5);
    background: linear-gradient(145deg, rgba(189, 147, 249, 0.3), rgba(189, 147, 249, 0.1));
}

/* Bubble Name Label */
.student-bubble-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--cyan);
    text-align: center;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* Student Details Card */
.student-details-card {
    background: var(--bg-light);
    border: 2px solid var(--purple);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 0 20px rgba(189, 147, 249, 0.4);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(189, 147, 249, 0.3);
}

.details-header h4 {
    color: var(--purple);
    font-family: 'Maven Pro', sans-serif;
    margin: 0;
    font-size: 1.1rem;
    text-shadow: 0 0 10px rgba(189, 147, 249, 0.5);
}

.details-header h4 i {
    margin-right: 0.5rem;
}

.close-details-btn {
    background: none;
    border: 1px solid var(--purple);
    color: var(--purple);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-details-btn:hover {
    background: var(--purple);
    color: white;
    transform: rotate(90deg);
    box-shadow: 0 0 15px rgba(189, 147, 249, 0.8);
}

.schedule-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.breakdown-item {
    background: var(--bg-darker);
    padding: 0.75rem;
    border-radius: 6px;
    border-left: 3px solid;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.breakdown-item:hover {
    transform: translateX(5px);
    box-shadow: 0 0 15px rgba(189, 147, 249, 0.3);
}

.breakdown-day {
    color: var(--cyan);
    font-weight: 600;
    font-size: 0.9rem;
}

.breakdown-time {
    color: var(--cyan);
    font-size: 0.85rem;
}

.total-hours {
    background: rgba(189, 147, 249, 0.2);
    padding: 0.75rem;
    border-radius: 6px;
    text-align: center;
    color: var(--purple);
    font-weight: 600;
    font-size: 1rem;
    border: 1px solid rgba(189, 147, 249, 0.4);
}

.total-hours span {
    font-size: 1.2rem;
    color: var(--cyan);
}

.download-calendar-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--purple), rgba(189, 147, 249, 0.8));
    border: 1px solid var(--purple);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.download-calendar-btn:hover {
    background: linear-gradient(135deg, rgba(189, 147, 249, 1), var(--purple));
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(189, 147, 249, 0.8);
}

.download-calendar-btn i {
    font-size: 1.1rem;
}

.calendar-note {
    text-align: center;
    color: var(--comment);
    font-size: 0.8rem;
    margin-top: 0.5rem;
    font-style: italic;
}

.calendar-note i {
    margin-right: 0.25rem;
}

/* Highlight effects for selected student */
.student-pill.highlighted {
    animation: pulseGlow 1.5s infinite;
    box-shadow: 0 0 20px rgba(189, 147, 249, 1);
    position: relative;
    z-index: 10;
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(189, 147, 249, 1);
    }
    50% {
        box-shadow: 0 0 30px rgba(189, 147, 249, 1), 0 0 40px rgba(189, 147, 249, 0.6);
    }
}

.student-pill.faded {
    opacity: 0.3;
    filter: grayscale(0.5);
}

.schedule-cell.highlighted-cell {
    background: rgba(189, 147, 249, 0.2) !important;
    box-shadow:
        0 0 20px rgba(189, 147, 249, 0.8),
        inset 0 0 15px rgba(189, 147, 249, 0.3) !important;
    border-left: 2px solid var(--purple) !important;
    border-bottom: 2px solid var(--purple) !important;
}

/* Loading & Error */
.loading, .error-message {
    text-align: center;
    padding: 2rem;
    font-size: 1.1rem;
}

.loading {
    color: var(--purple);
}

.loading i {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.error-message {
    color: var(--red);
    background: rgba(255, 85, 85, 0.1);
    border: 1px solid var(--red);
    border-radius: 8px;
}

.hidden {
    display: none;
}

/* Grid */
.grid-wrapper {
    overflow-x: auto;
    margin-bottom: 1.5rem;
    background: var(--bg-dark);
    border-radius: 12px;
    padding: 0.5rem;
}

#heatmap-grid {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: transparent;
}

#heatmap-grid thead th {
    background: linear-gradient(135deg, rgba(255, 184, 28, 0.15), rgba(255, 184, 28, 0.05));
    color: var(--ucr-gold);
    padding: 1rem 0.75rem;
    font-family: 'Maven Pro', sans-serif;
    font-weight: 700;
    border: none;
    text-shadow: 0 0 10px rgba(255, 184, 28, 0.5);
    position: sticky;
    top: 0;
    z-index: 10;
    font-size: 0.95rem;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

#heatmap-grid thead th:first-child {
    border-radius: 10px 0 0 0;
}

#heatmap-grid thead th:last-child {
    border-radius: 0 10px 0 0;
}

/* Time column cells */
#heatmap-grid tbody td.time-cell {
    background: linear-gradient(135deg, rgba(139, 233, 253, 0.15), rgba(139, 233, 253, 0.05));
    color: var(--cyan);
    font-weight: 700;
    text-align: center;
    padding: 0.9rem 0.5rem;
    cursor: default;
    min-width: 60px;
    font-size: 0.85rem;
    border: none;
    text-shadow: 0 0 8px rgba(139, 233, 253, 0.4);
    letter-spacing: 0.3px;
}

#heatmap-grid tbody tr:last-child td.time-cell {
    border-radius: 0 0 0 10px;
}

/* Schedule cells */
#heatmap-grid tbody td.schedule-cell {
    padding: 0.3rem;
    background: rgba(40, 42, 54, 0.5);
    border: none;
    border-left: 1px solid rgba(68, 71, 90, 0.3);
    border-bottom: 1px solid rgba(68, 71, 90, 0.3);
    transition: all 0.2s ease;
    min-width: 120px;
    max-width: 200px;
    position: relative;
    vertical-align: middle;
}

#heatmap-grid tbody td.schedule-cell.empty-cell {
    background: rgba(22, 22, 30, 0.3);
}

#heatmap-grid tbody tr:last-child td.schedule-cell:last-child {
    border-radius: 0 0 10px 0;
}

/* Subtle hover for cells */
#heatmap-grid tbody td.schedule-cell:hover {
    background: rgba(68, 71, 90, 0.5);
}

#heatmap-grid tbody td.schedule-cell.empty-cell:hover {
    background: rgba(40, 42, 54, 0.6);
}

/* Student Pills Container */
.student-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: center;
    justify-content: center;
}

/* Student Name Pills - Compact Circle Design */
.student-pill {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
    position: relative;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 2px solid;
}

/* Pill Colors - Muted Pastel Palette (Reduced Opacity) */
.student-pill.pill-lavender {
    background: rgba(200, 162, 255, 0.5);
    border-color: rgba(200, 162, 255, 0.6);
}

.student-pill.pill-sky {
    background: rgba(135, 206, 250, 0.5);
    border-color: rgba(135, 206, 250, 0.6);
}

.student-pill.pill-mint {
    background: rgba(152, 251, 152, 0.5);
    border-color: rgba(152, 251, 152, 0.6);
}

.student-pill.pill-rose {
    background: rgba(255, 182, 193, 0.5);
    border-color: rgba(255, 182, 193, 0.6);
}

.student-pill.pill-peach {
    background: rgba(255, 218, 185, 0.5);
    border-color: rgba(255, 218, 185, 0.6);
}

.student-pill.pill-coral {
    background: rgba(255, 160, 122, 0.5);
    border-color: rgba(255, 160, 122, 0.6);
}

.student-pill.pill-lemon {
    background: rgba(255, 250, 205, 0.5);
    border-color: rgba(255, 250, 205, 0.6);
    color: #e0e0e0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.student-pill.pill-lilac {
    background: rgba(221, 160, 221, 0.5);
    border-color: rgba(221, 160, 221, 0.6);
}

/* Pill Hover Effects - Subtle */
.student-pill:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Refresh Section */
.refresh-section {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid rgba(189, 147, 249, 0.2);
}

.refresh-btn {
    background: linear-gradient(135deg, #44475a, #282a36);
    border: 1px solid rgba(189, 147, 249, 0.3);
    color: var(--purple);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(189, 147, 249, 0.4);
    margin-bottom: 0.75rem;
}

.refresh-btn:hover {
    background: linear-gradient(135deg, var(--purple), rgba(189, 147, 249, 0.9));
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(189, 147, 249, 0.6);
}

.refresh-btn i {
    margin-right: 0.5rem;
    transition: transform 0.5s;
}

.refresh-btn:hover i {
    transform: rotate(360deg);
}

/* Randomize Colors Button */
.randomize-btn {
    background: linear-gradient(135deg, #44475a, #282a36);
    border: 1px solid rgba(255, 0, 255, 0.4);
    color: rgba(255, 0, 255, 0.9);
}

.refresh-btn.randomize-btn:hover {
    background: linear-gradient(
        135deg,
        rgba(255, 0, 0, 0.8),
        rgba(255, 165, 0, 0.8),
        rgba(255, 255, 0, 0.8),
        rgba(0, 255, 0, 0.8),
        rgba(0, 0, 255, 0.8),
        rgba(75, 0, 130, 0.8),
        rgba(238, 130, 238, 0.8)
    ) !important;
    background-size: 200% 200% !important;
    color: white !important;
    box-shadow:
        0 0 15px rgba(255, 0, 0, 0.6),
        0 0 25px rgba(255, 165, 0, 0.5),
        0 0 35px rgba(255, 255, 0, 0.4),
        0 0 45px rgba(0, 255, 0, 0.3),
        0 0 55px rgba(0, 0, 255, 0.3),
        0 0 65px rgba(75, 0, 130, 0.3),
        0 0 75px rgba(238, 130, 238, 0.3) !important;
    border-color: white !important;
    animation: rainbow-bg-shift 3s ease-in-out infinite !important;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8) !important;
    transform: translateY(-2px) !important;
}

@keyframes rainbow-bg-shift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.last-updated {
    color: var(--comment);
    font-size: 0.85rem;
    font-style: italic;
}

.last-updated span {
    color: var(--cyan);
}

/* Submit Poll Section */
.submit-poll-section {
    text-align: center;
    padding: 2rem;
    background: var(--bg-light);
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    border: 1px solid rgba(189, 147, 249, 0.2);
    transition: all 0.3s ease;
}

.submit-poll-section:hover {
    box-shadow: 0 0 20px rgba(189, 147, 249, 0.6),
                0 0 30px rgba(189, 147, 249, 0.4);
    border-color: rgba(189, 147, 249, 0.5);
}

.submit-poll-section p {
    color: var(--cyan);
    margin-bottom: 1rem;
}

.submit-poll-btn {
    display: inline-block;
    background: linear-gradient(135deg, #44475a, #282a36);
    border: 1px solid rgba(189, 147, 249, 0.3);
    color: var(--purple);
    padding: 0.75rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(189, 147, 249, 0.4);
}

.submit-poll-btn:hover {
    background: linear-gradient(135deg, var(--purple), rgba(189, 147, 249, 0.9));
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(189, 147, 249, 0.6);
}

.submit-poll-btn i {
    margin-right: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 0.5rem;
    }

    .container {
        padding: 0;
        max-width: 100%;
    }

    header {
        padding: 1.5rem 1rem;
    }

    header h1 {
        font-size: 1.75rem;
    }

    .heatmap-container {
        padding: 1rem;
    }

    .stats-panel {
        padding: 1rem;
    }

    .student-count-circle {
        min-width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .student-bar-name {
        font-size: 0.8rem;
    }

    .student-bar-slots {
        font-size: 0.75rem;
    }

    .student-bar-bg {
        height: 30px;
    }

    /* Mobile-optimized grid - show full week */
    .grid-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        background: linear-gradient(90deg,
            var(--bg-light) 0%,
            transparent 10%,
            transparent 90%,
            var(--bg-light) 100%);
        border-radius: 8px;
        padding: 0.5rem 0;
    }

    #heatmap-grid {
        font-size: 0.7rem;
        min-width: 100%;
        width: max-content;
    }

    #heatmap-grid thead th {
        padding: 0.6rem 0.4rem;
        font-size: 0.75rem;
        min-width: 55px;
    }

    #heatmap-grid tbody td.schedule-cell {
        min-width: 70px;
        padding: 0.4rem 0.25rem;
        font-size: 0.7rem;
    }

    #heatmap-grid tbody td.time-cell {
        font-size: 0.7rem;
        padding: 0.7rem 0.3rem;
        min-width: 55px;
        position: sticky;
        left: 0;
        z-index: 5;
        box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
    }

    .student-pill {
        width: 20px;
        height: 20px;
        font-size: 0.6rem;
    }

    .student-pills {
        gap: 0.2rem;
    }

    .submit-poll-btn,
    .refresh-btn {
        width: 100%;
        padding: 0.875rem 1.5rem;
    }
}
