/* static/css/chat.css
   App-wide chat UI: navbar, dropdowns, modals, cards, chat bubbles,
   dashboard, schedule pages, and the landing page. Loaded after style.css. */

@import url('https://fonts.googleapis.com/css2?family=League+Spartan:wght@100..900&display=swap');

:root {
    --chat-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --chat-glass: rgba(255, 255, 255, 0.1);
    --chat-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
}

body {
    font-family: "League Spartan", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-weight: 400;
    min-height: 100vh;
    background-color: #d3d2fb;
}

.page-container {
    position: relative;
    min-height: 100vh;
}

.content-wrap {
    min-height: 100vh;
}

/* ---------- Start Stacking Context Fixes ----------
   Bootstrap dropdowns/modals were clipping behind cards on this layout;
   this establishes an explicit stacking order so overlays always win. */
.navbar { z-index: 100; position: relative; }
.navbar-nav { z-index: 101; position: relative; }
.dropdown-menu {
    z-index: 102;
    background-color: white!important;
    border: 3px solid #ac30ef!important;
    box-shadow: 0 6px 12px rgba(0,0,0,.175)!important;
}
.dropdown-item:focus {
    background-color: #f8f9fa!important;
    color: #16181b!important;
    text-decoration: none!important;
}
.dropdown-item:hover {
    background-color: #007bff!important;
    color: white!important;
    text-decoration: none!important;
    transform: scale(1.02);
}

.card { z-index: 1; position: relative; border: none; border-radius: 15px; box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1); }
.container, .container-fluid { z-index: 1; position: relative; }
.btn, button, input[type="button"], input[type="submit"] { z-index: 5; position: relative; }
.btn { border-radius: 10px; font-weight: 500; transition: all 0.3s ease; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 8px rgba(0,0,0,0.2); }
.alert { z-index: 5; position: relative; border: none; border-radius: 12px; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); }

.modal { z-index: 10000; }
.modal-backdrop { z-index: 9999; }
/* ---------- End Stacking Context Fixes ---------- */

.navbar-chat {
    background: var(--chat-primary)!important;
    border: none;
    box-shadow: var(--chat-shadow);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.nav-link {
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: 8px;
    margin: 0 0.25rem;
}

.nav-link:hover {
    background: var(--chat-glass);
    transform: translateY(-2px);
}

.nav-link.active {
    background: var(--chat-glass);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.glass-card {
    background: var(--chat-glass);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* ---------- Start Shared Chat Components ---------- */
.chat-item {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    border: none;
    transition: all 0.3s ease;
}

.chat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.schedule-summary {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 1rem;
    margin-top: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.schedule-day.today {
    background: rgba(79, 172, 254, 0.1);
    border-radius: 8px;
    padding: 0.75rem;
    font-weight: 600;
}

.time-input-group {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 1rem;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.9);
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

.message-bubble {
    display: inline-block;
    max-width: 75%;
    padding: 1rem 1.25rem;
    border-radius: 20px;
    word-wrap: break-word;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
}

.system .message-bubble {
    background: rgba(255, 193, 7, 0.1);
    color: #856404;
    font-style: italic;
    border: 2px dashed #ffc107;
}

.tech-input-area, .student-input-group {
    padding: 1rem;
    border-top: 1px solid #dee2e6;
    border-radius: 0 0 15px 15px;
    flex-shrink: 0;
}

.tech-input-area button {
    background-color: #f4f5f6;
}

.tech-input-area button:hover {
    background-color: #eaeced;
    color: #888686;
}

.emoji-grid {
    background-color: white;
}

.topic-badge {
    padding: 0.75rem 0.5rem;
    border-radius: 12px;
    text-align: center;
    color: #fff;
    transition: all 0.3s ease;
    cursor: pointer;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.25rem;
    min-height: 80px;
}

.topic-badge:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.topic-badge i {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.topic-badge div:not(small) {
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.1;
}

@media (max-width: 768px) {
    .topic-badge { min-height: 70px; padding: 0.5rem 0.25rem; }
    .topic-badge i { font-size: 1rem; }
    .topic-badge div:not(small) { font-size: 0.9rem; }
}

/* Flat, calmer topic color set (CSCI 1100 + 1300) */
.ocean-1 { background: hsl(205, 60%, 42%); }
.ocean-2 { background: hsl(199, 55%, 46%); }
.ocean-3 { background: hsl(190, 50%, 42%); }
.sunset-1 { background: hsl(18, 65%, 48%); }
.sunset-2 { background: hsl(30, 65%, 50%); }
.sunset-3 { background: hsl(8, 60%, 50%); }
.forest-1 { background: hsl(152, 42%, 38%); }
.forest-3 { background: hsl(140, 38%, 42%); }
.berry-1 { background: hsl(var(--clr-berry)); }
.berry-2 { background: hsl(292, 32%, 46%); }
.berry-3 { background: hsl(268, 32%, 44%); }
.amber-1 { background: hsl(var(--clr-amber)); }
.amber-2 { background: hsl(30, 65%, 48%); }
.amber-3 { background: hsl(22, 62%, 48%); }

.course-heading {
    font-weight: 700;
    text-align: left;
    margin-bottom: 0.75rem;
}

.topic-section { margin-bottom: 0.75rem; }

.course-heading-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: none;
    border: none;
    padding: 0.5rem 0;
    font-weight: 700;
    text-align: left;
}

.course-heading-toggle .toggle-chevron {
    transition: transform 0.2s ease;
}

.course-heading-toggle.collapsed .toggle-chevron {
    transform: rotate(-90deg);
}

.rotating-topic {
    display: inline-block;
    font-weight: 600;
    color: hsl(var(--clr-primary));
    cursor: pointer;
    text-decoration: 1.2px underline dotted;
    line-height: 1.8rem;
    transition: transform 0.15s ease;
}

.rotating-topic:hover {
    color: hsl(var(--clr-primary-hover));
}

.rotating-topic-pop {
    transform: scale(0.92);
}

.info-box {
    border: 1px solid #dddede;
    border-radius: 15px;
    box-shadow: rgba(0, 0, 0, 0.05) 0px 2px 4px 0px;
}

.current-time-display {
    font-size: 1.2rem;
    font-weight: 600;
}
/* ---------- End Shared Chat Components ---------- */

/* ---------- Start Animations ---------- */
.fade-in {
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.pulse-glow {
    animation: pulseGlow 2s ease-in-out infinite alternate;
}

@keyframes pulseGlow {
    from { box-shadow: 0 0 5px rgba(102, 126, 234, 0.5); }
    to { box-shadow: 0 0 20px rgba(102, 126, 234, 0.8); }
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

.dot-available { background: #28a745; }
.dot-unavailable { background: #dc3545; }
.dot-current { background: #007bff; animation: dotPulse 2s infinite; }

@keyframes dotPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}
/* ---------- End Animations ---------- */

@media (max-width: 768px) {
    .navbar-brand { font-size: 1.2rem; }
    .nav-link { margin: 0.125rem 0; }
}

/* ============ Landing page ============ */
.availability-status {
    border-radius: 15px;
    padding: 1.5rem;
    animation: statusPulse 3.8s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(64, 145, 255, 0);
    }
    50% {
        transform: scale(1.011);
        box-shadow: 0 0 24px rgba(41, 209, 255, 0.56);
    }
}

.pulse-attention {
    animation: pulseAttention 0.9s ease-in-out 3;
}

@keyframes pulseAttention {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(64, 145, 255, 0);
    }
    50% {
        transform: scale(1.08);
        box-shadow: 0 0 12px rgba(64, 145, 255, 0.6);
    }
}

.status-available {
    background: hsl(var(--clr-create));
    color: white;
}

.status-unavailable {
    background: hsl(var(--clr-danger));
    color: white;
}

.status-override {
    background: hsl(var(--clr-putty-yellow-hover));
    color: #212529;
}

.form-disabled {
    opacity: 0.7;
    pointer-events: none;
}

.offline-message {
    background: hsl(var(--clr-danger));
    color: white;
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
}

/* ============ Student chat ============ */
.btn-green { color: #5ebf71; }

.chat-container {
    border-radius: 20px;
    border: 1px solid #5484d2;
    display: flex;
    flex-direction: column;
}

@media (min-width: 992px) {
    .chat-container { height: 85vh; }
}

@media (max-width: 991.98px) {
    .chat-container { min-height: 60vh; max-height: 70vh; margin-bottom: 2rem; }
}

@media (max-width: 576px) {
    .chat-container { min-height: 50vh; max-height: 75vh; margin-bottom: 3rem; border-radius: 15px; }
}

.chat-header {
    background: linear-gradient(45deg, #4facfe 0%, #00f2fe 100%);
    border-radius: 20px 20px 0 0;
    color: white;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(79, 172, 254, 0.3);
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .chat-header { padding: 1rem; border-radius: 15px 15px 0 0; }
    .chat-header h3 { font-size: 1.3rem; margin-bottom: 0.5rem; }
    .chat-header .d-flex { flex-direction: column; gap: 0.5rem; }
    .status-badge { font-size: 0.8rem; padding: 0.4rem 0.8rem; }
    .chat-messages { padding: 1rem; height: auto; }
    .message { margin-bottom: 1rem; }
    .message-bubble { max-width: 85%; padding: 0.875rem 1.125rem; font-size: 0.9rem; border-radius: 18px; }
    .chat-input { padding: 1rem; border-radius: 0 0 15px 15px; }
    .chat-input .input-group { flex-wrap: wrap; }
    .chat-input textarea { font-size: 16px; min-height: 80px; }
    .student-input-group { border-radius: 20px; padding: 0.4rem; }
    .emoji-btn { width: 40px; height: 40px; font-size: 1.2rem; }
    .close-chat-btn { font-size: 0.85rem; padding: 0.5rem 1rem; }
    .attachment-preview { padding: 0.5rem; border-radius: 10px; font-size: 0.9rem; }
    .emoji-grid .row { margin: 0; }
    .emoji-grid .emoji-btn { padding: 0.25rem; font-size: 1.1rem; width: 35px; height: 35px; }
    .chat-input .alert h5 { font-size: 1.1rem; }
    .chat-input .alert p { font-size: 0.9rem; }
    .container-fluid { padding-left: 0.75rem; padding-right: 0.75rem; }
    #studentFilePreview { max-height: 120px; }
    #studentFilePreview .alert { font-size: 0.85rem; padding: 0.5rem; }
    .badge { font-size: 0.7rem; padding: 0.3rem 0.6rem; }
}

@media (max-width: 576px) {
    .chat-header { padding: 0.75rem; }
    .chat-header h3 { font-size: 1.1rem; }
    .status-badge { font-size: 0.7rem; padding: 0.3rem 0.6rem; }
    .chat-messages { padding: 0.75rem; }
    .message-bubble { max-width: 90%; padding: 0.75rem 1rem; font-size: 0.85rem; border-radius: 15px; }
    .chat-input { padding: 0.75rem; }
    .chat-input textarea { min-height: 70px; font-size: 16px; }
    .student-input-group { border-radius: 15px; padding: 0.3rem; }
    .emoji-btn { width: 35px; height: 35px; font-size: 1.1rem; padding: 0.3rem; }
    .close-chat-btn { font-size: 0.75rem; padding: 0.4rem 0.8rem; }
    .attachment-preview { padding: 0.4rem; border-radius: 8px; font-size: 0.8rem; }
    .emoji-grid .emoji-btn { padding: 0.2rem; font-size: 1rem; width: 30px; height: 30px; }
    .chat-input .alert h5 { font-size: 1rem; }
    .chat-input .alert p { font-size: 0.8rem; margin-bottom: 1rem; }
    .container-fluid { padding-left: 0.5rem; padding-right: 0.5rem; }
    #studentFilePreview { max-height: 100px; }
    #studentFilePreview .alert { font-size: 0.75rem; padding: 0.4rem; }
    .badge { font-size: 0.65rem; padding: 0.25rem 0.5rem; }
}

@media (max-width: 400px) {
    .chat-header h3 { font-size: 1rem; }
    .message-bubble { max-width: 95%; padding: 0.5rem 0.75rem; font-size: 0.8rem; }
    .chat-input { padding: 0.5rem; }
    .student-input-group { padding: 0.25rem; }
    .emoji-btn { width: 30px; height: 30px; font-size: 1rem; }
}

.message { margin-bottom: 1.2rem; }
.message.student { text-align: right; }
.message.technician { text-align: left; }
.message.system { text-align: center; }

.bg-technician-connected { background-color: #acfabf; }

.btn-stack-grid { display: grid; grid-template-columns: 1fr; }

.student .message-bubble {
    background: linear-gradient(145deg, #007bff, #0056b3);
    color: white;
    border-bottom-right-radius: 3px;
}

.technician .message-bubble {
    background: linear-gradient(145deg, #acfabf, #a0e1af);
    color: black;
    border-bottom-left-radius: 3px;
}

.student-input-group {
    background: #1adcfe61;
    border-bottom-left-radius: 25px;
    border-bottom-right-radius: 25px;
    padding: 0.5rem;
    height: fit-content;
}

.student-message-form {
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    background: #1adcfea4;
}

.student-content-input {
    resize: none;
    border: 2px solid rgba(79, 172, 254, 0.3);
}

.textarea-no-resize { resize: none; }

.emoji-btn {
    background: linear-gradient(135deg, #f6e1b4cc, #a9f0fc80);
    border: 1px solid #39befb;
    font-size: 1.3rem;
    padding: 0.5rem;
    border-radius: 45%;
    transition: all 0.3s ease;
    width: 45px;
    height: 45px;
}

.submit-message-btn {
    background: linear-gradient(45deg, #007bff 0%, #3995f8 100%);
    border: 1px solid #39befb;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-bottom-left-radius: 0;
    color: white;
}

.submit-message-btn:hover {
    background: linear-gradient(35deg, #006cde 0%, #308cef 100%);
    color: #d1d0d0;
}

.attachment-btn {
    background: linear-gradient(45deg, #007bff 0%, #3995f8 100%);
    border: 1px solid #39befb;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    color: white;
}

.attachment-btn:hover {
    background: linear-gradient(35deg, #006cde 0%, #308cef 100%);
    color: #d1d0d0;
}

.close-chat-btn {
    background: linear-gradient(45deg, #c84b58, #bf2f5f);
    border: none;
    transition: all 0.3s ease;
}

.attachment-preview {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 0.75rem;
    margin-top: 0.5rem;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

#studentEmojiPicker, #techEmojiPicker {
    position: relative;
    z-index: 5;
}

#studentFilePreview {
    max-height: 150px;
    overflow-y: auto;
}

@media screen and (max-width: 768px) {
    input[type="text"], input[type="email"], input[type="tel"], input[type="password"],
    textarea, select {
        font-size: 16px!important;
    }
}

/* ============ Technician chat ============ */
.tech-chat-container {
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

@media (min-width: 992px) {
    .tech-chat-container { height: 85vh; }
}

@media (max-width: 991.98px) {
    .tech-chat-container { min-height: 60vh; max-height: 70vh; }
    .chat-sidebar { margin-top: 1rem; }
}

@media (max-width: 576px) {
    .tech-chat-container { min-height: 50vh; max-height: 60vh; margin-bottom: 1rem; }
    .chat-sidebar .card-body { padding: 1rem; }
    .chat-sidebar dt { font-size: 0.9rem; }
    .chat-sidebar dd { font-size: 0.85rem; margin-bottom: 0.5rem; }
    .modal-dialog { margin: 1rem; max-width: calc(100% - 2rem); }
    .modal-body { padding: 1rem; }
    .modal-footer { padding: 0.75rem 1rem; flex-direction: column; gap: 0.5rem; }
    .modal-footer button { width: 100%; }
}

.tech-chat-header {
    background: linear-gradient(45deg, #93edaa 0%, #80e097 100%);
    color: black;
    padding: 1rem;
    border-radius: 15px 15px 0 0;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .tech-chat-header { padding: 0.75rem; }
    .tech-chat-header h4 { font-size: 1.1rem; margin-bottom: 0.5rem; }
    .tech-chat-header .d-flex { flex-direction: column; gap: 0.5rem; }
    .participant-badge { font-size: 0.7rem; padding: 0.2rem 0.5rem; }
    .tech-input-area { padding: 0.75rem; }
    .tech-input-area .input-group { flex-wrap: wrap; }
    .tech-input-area textarea { font-size: 16px; min-height: 80px; }
    .quick-actions { padding: 0.25rem; margin-bottom: 0.5rem; }
    .quick-action-btn { font-size: 0.7rem; padding: 0.2rem 0.4rem; margin: 0.1rem; }
    .close-chat-btn { font-size: 0.8rem; padding: 0.4rem 0.8rem; }
    .attachment-grid { grid-template-columns: 1fr; gap: 0.25rem; }
    .emoji-grid .row { margin: 0; }
    .emoji-btn { padding: 0.25rem; font-size: 1.2rem; }
    .container-fluid { padding-left: 0.75rem; padding-right: 0.75rem; }
}

@media (max-width: 400px) {
    .tech-chat-header h4 { font-size: 1rem; }
    .message-bubble { max-width: 90%; padding: 0.5rem 0.75rem; font-size: 0.85rem; }
    .quick-action-btn { font-size: 0.6rem; padding: 0.15rem 0.3rem; }
}

.quick-actions {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 0.5rem;
    margin-bottom: 1rem;
}

.quick-action-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: black;
    border-radius: 8px;
    padding: 0.25rem 0.5rem;
    margin: 0.125rem;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.quick-action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    color: black;
}

.chat-sidebar {
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.attachment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.5rem;
    margin-top: 0.5rem;
    color: #287ffc;
}

.attachment-item {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    padding: 0.5rem;
    border: 1px solid #dee2e6;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

.attachment-item:hover {
    background: rgb(234, 234, 234);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.attachment-size {
    font-size: 0.7rem;
}

/* Technician chat overrides the shared submit/attachment button colors */
.tech-chat-page .submit-message-btn,
.tech-chat-page .attachment-btn { color: inherit; }

.message.student { text-align: left; }
.message.technician { text-align: right; }

/* Close-chat confirmation modal: forced to the top of the stack because it
   sits above dynamically-loaded chat content; JS also re-applies this z-index
   on open/interval as a belt-and-suspenders guard (see technician_chat.html). */
.modal-nuclear {
    position: fixed!important;
    top: 0!important;
    left: 0!important;
    width: 100vw!important;
    height: 100vh!important;
    z-index: 2147483647!important;
    background-color: rgba(0, 0, 0, 0.6)!important;
}

.modal-dialog-nuclear {
    position: absolute!important;
    top: 50%!important;
    left: 50%!important;
    transform: translate(-50%, -50%)!important;
    z-index: 2147483647!important;
    margin: 0!important;
    width: 90%!important;
    max-width: 500px!important;
}

.modal-content-nuclear {
    z-index: 2147483647!important;
    position: relative!important;
    background-color: #fff!important;
    border-radius: 0.5rem!important;
    box-shadow: 0 20px 60px rgba(0,0,0,0.8)!important;
}

.modal-section-nuclear {
    z-index: 2147483647!important;
    position: relative!important;
    pointer-events: auto!important;
}

.modal-footer-pad { padding: 1rem 2rem; }

.modal-close-btn-nuclear {
    z-index: 2147483647!important;
    position: relative!important;
    pointer-events: auto!important;
    background-color: white!important;
    border-radius: 50%!important;
    padding: 0.5rem!important;
}

.modal-footer-btn-nuclear {
    z-index: 2147483647!important;
    position: relative!important;
    pointer-events: auto!important;
    padding: 0.75rem 1.5rem!important;
}

/* ============ Technician dashboard ============ */
.dashboard-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 15px;
    color: white;
    transition: transform 0.3s ease;
}

.dashboard-card:hover {
    transform: translateY(-5px);
}

.metric-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
}

.waiting-indicator {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.new-chat-alert {
    background: linear-gradient(45deg, rgba(250, 84, 145, 0.55), rgba(240, 187, 72, 0.55));
    border-radius: 10px;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { box-shadow: 0 0 5px rgba(255, 107, 107, 0.5); }
    to { box-shadow: 0 0 20px rgba(255, 107, 107, 0.8); }
}

.status-waiting { background: #ffd93d; }
.status-active { background: #6bcf7f; }
.status-left { background: #95a5a6; }

.chat-timestamp {
    font-size: 0.8rem;
}

.notification-badge {
    background: #ff6b6b;
    color: white;
    border-radius: 50%;
    padding: 0.25rem 0.7rem;
    font-size: 0.75rem;
    position: absolute;
    right: -8px;
}

.waiting-queue-header {
    background: linear-gradient(135deg, rgba(250, 84, 145, 0.9), rgba(240, 187, 72, 0.9));
}

.active-queue-header {
    background: linear-gradient(135deg, #58b86b, #6bcf7f);
}

.queue-scroll { max-height: 400px; overflow-y: auto; }

.dashboard-notice {
    border-radius: 12px;
    background: rgba(13, 202, 240, 0.1);
    border: 1px solid rgba(13, 202, 240, 0.2);
}

/* ============ Manage schedule ============ */
.schedule-card {
    border-radius: 15px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.schedule-card.active {
    border-color: #28a745;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1), rgba(32, 201, 151, 0.1));
}

.schedule-card.inactive {
    border-color: #6c757d;
    background: rgba(108, 117, 125, 0.1);
}

.day-header {
    font-weight: 700;
    font-size: 1.1rem;
    padding: 1rem;
    border-radius: 15px 15px 0 0;
}

.day-header.active {
    background: linear-gradient(45deg, #28a745, #20c997);
    color: white;
}

.day-header.inactive {
    background: #6c757d;
    color: white;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

.status-available { background: #28a745; }
.status-unavailable { background: #dc3545; }
.status-override { background: #ffc107; }

.preset-selector {
    background: linear-gradient(135deg, #3695fb, #0d5eb5);
    color: white;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.current-status {
    background: linear-gradient(135deg, #17a2b8, #117a8b);
    color: white;
    border-radius: 15px;
    padding: 1.5rem;
}

.override-item {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid #ffc107;
    border-radius: 10px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}

@media (max-width: 768px) {
    .schedule-grid { display: block; }
    .schedule-card { margin-bottom: 1rem; }
}

/* ============ Manage schedule overrides ============ */
.override-card {
    border-radius: 12px;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

.override-card.active {
    border-left: 5px solid #28a745;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1), rgba(255, 255, 255, 0.9));
}

.override-card.inactive {
    border-left: 5px solid #dc3545;
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1), rgba(255, 255, 255, 0.9));
}

.override-form {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border-radius: 15px;
    padding: 2rem;
}

.date-badge {
    background: linear-gradient(45deg, #17a2b8, #117a8b);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
}

.reason-tag {
    background: rgba(255, 193, 7, 0.2);
    border: 1px solid #ffc107;
    color: #856404;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.85rem;
}

.time-display {
    font-family: 'Courier New', monospace;
    background: rgba(0, 0, 0, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 5px;
}

/* ============ Dark Mode ============ */
@media (prefers-color-scheme: dark) {
    body { background-color: #282762; }

    a[href]:not(.nav-link, .navbar-brand) { color: #7cb3ff; }
    a[href]:not(.nav-link, .navbar-brand):hover { color: #a3cbff; }

    .rotating-topic { color: #7cb3ff; }
    .rotating-topic:hover { color: #a3cbff; }

    .card, .card-body {
        background: rgba(52, 73, 94, 0.9);
        color: #ecf0f1;
        border-color: #7f8c8d;
        border-radius: 10px;
    }

    .chat-item {
        background: rgba(44, 82, 103, 0.8);
        box-shadow: rgba(14, 30, 37, 0.12) 0px 2px 4px 0px, rgba(14, 30, 37, 0.32) 0px 2px 16px 0px;
    }

    table, .table {
        background: rgba(52, 73, 94, 0.9);
        color: #ecf0f1;
    }

    table thead th, .table thead th,
    table tbody tr, .table tbody tr,
    table tbody td, .table tbody td,
    table tfoot tr, .table tfoot tr {
        background: rgba(52, 73, 94, 0.9)!important;
        color: #ecf0f1!important;
        border-color: #7f8c8d!important;
    }

    .table-striped tbody tr:nth-of-type(odd) {
        background: rgba(44, 62, 80, 0.9)!important;
    }

    .alert {
        background: rgba(44, 62, 80, 0.9);
        color: #ecf0f1;
    }

    .alert-success { background: rgba(40, 167, 69, 0.25); color: #8ee6a4; border-color: rgba(40, 167, 69, 0.4); }
    .alert-danger { background: rgba(220, 53, 69, 0.25); color: #f5a3ac; border-color: rgba(220, 53, 69, 0.4); }
    .alert-warning { background: rgba(255, 193, 7, 0.2); color: #ffe08a; border-color: rgba(255, 193, 7, 0.4); }
    .alert-info { background: rgba(13, 202, 240, 0.2); color: #9be7f7; border-color: rgba(13, 202, 240, 0.4); }

    .text-secondary { color: #b8c4d0!important; }
    .btn-outline-secondary { color: #b8c4d0; border-color: #b8c4d0; }
    .btn-outline-secondary:hover { background-color: #b8c4d0; color: #1c2733; }

    .card-body * { color: #ecf0f1; }
    small span, .text-muted, .text-muted span, .text-muted p { color: #a0c5ce!important; }

    .schedule-summary {
        background: rgba(53, 84, 114, 0.7);
        border: 1px solid rgba(255, 255, 255, 0.1);
        color: #f0f0f0;
    }

    .schedule-day.today {
        background-color: rgba(53, 84, 114, 0.6);
        box-shadow: rgba(0, 0, 0, 0.05) 0px 6px 24px 0px, rgba(0, 0, 0, 0.08) 0px 0px 0px 1px;
    }

    .topic-badge { color: #cce3f9; }

    .bg-etsu-yellow { background-color: hsl(44, 60%, 35%)!important; }
    .bg-putty-yellow { background-color: hsl(48, 40%, 35%)!important; }
    .text-putty-yellow { color: hsl(48, 70%, 75%)!important; }

    .form-container {
        background-color: rgba(52, 73, 94, 0.95)!important;
        border-color: rgb(127, 140, 141)!important;
        color: #ecf0f1;
    }

    .button-container {
        background-color: rgba(44, 62, 80, 0.3)!important;
        border-color: rgb(127, 140, 141)!important;
    }

    .time-input-group { background-color: rgba(44, 62, 80, 0.9)!important; }
    .chat-messages { background: rgba(52, 73, 94, 0.9); }

    .tech-input-area, .student-input-group {
        background: #485b6e;
        border-top: 1px solid rgba(105, 118, 132, 0.9);
    }

    .tech-input-area button {
        background-color: #2f4356;
        border: 1px solid #c9c9c9;
    }

    .tech-input-area button:hover { background-color: #475665; }
    .attachment-btn { color: #c9c9c9; }
    .system .message-bubble { color: #a0c5ce; }

    .emoji-grid {
        background-color: #2f4356;
        border: 1px solid #c9c9c9;
    }

    input[type=text], input[type=time], input[type=password], input[type=email],
    input[type=tel], input[type=url], select, textarea {
        background-color: rgba(44, 62, 80, 0.9)!important;
        border-color: rgb(127, 140, 141)!important;
        color: #ecf0f1!important;
    }

    input[type=text]::placeholder, input[type=password]::placeholder,
    input[type=email]::placeholder, input[type='tel']::placeholder,
    input[type=url]::placeholder, textarea::placeholder {
        color: #7fa3ac!important;
    }

    label, .forms-label { color: #bebebe!important; }

    .bttn-warning {
        background-color: hsl(48, 50%, 40%)!important;
        color: rgb(236, 240, 241)!important;
    }

    .bttn-warning:hover {
        background-color: hsl(48, 50%, 45%)!important;
        color: rgb(236, 240, 241)!important;
    }

    th, tr, td {
        color: rgb(236, 240, 241)!important;
        border-color: rgb(127, 140, 141)!important;
    }

    .table { color: rgb(236, 240, 241)!important; }

    .table-striped > tbody > tr:nth-of-type(odd) > td,
    .table-striped > tbody > tr:nth-of-type(odd) > th {
        background-color: rgba(44, 62, 80, 0.3)!important;
    }

    .border-ccc { border-color: rgb(127, 140, 141)!important; }

    .has-info {
        background-color: rgba(var(--clr-info), 0.2)!important;
        color: rgb(236, 240, 241)!important;
    }

    .tos-box {
        background-color: rgba(44, 62, 80, 0.5)!important;
        border-color: rgb(127, 140, 141)!important;
        color: rgb(236, 240, 241)!important;
    }

    .dropdown-menu {
        background-color: rgba(44, 62, 80, 0.95)!important;
        border-color: rgb(127, 140, 141)!important;
    }

    .dropdown-item { color: rgb(236, 240, 241)!important; }

    .dropdown-item:hover, .dropdown-item:focus {
        background-color: rgba(52, 73, 94, 0.7)!important;
        color: rgb(236, 240, 241)!important;
    }

    .shadow {
        -webkit-box-shadow: 2px 15px 72px -5px rgba(0,0,0,0.9);
        -moz-box-shadow: 2px 15px 72px -5px rgba(0,0,0,0.9);
        box-shadow: 2px 15px 72px -5px rgba(0,0,0,0.9);
    }

    h1, h2, h3, h4 { color: #ecf0f1; }
}
