.chat-slider {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    height: 100vh;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.98), rgba(15, 23, 42, 0.98));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 99999;
    transition: right 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
}

.chat-slider.open {
    right: 0;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-header h3 {
    margin: 0;
    color: white;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.chat-close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.chat-controls {
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.ctrl-label {
    color: #cbd5e1;
    font-size: 0.9rem;
    font-weight: 500;
}

.btn-chat-clear {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #ef4444;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-chat-clear:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: translateY(-2px);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-empty-state {
    color: #64748b;
    text-align: center;
    margin-top: 50%;
    font-style: italic;
    font-size: 0.95rem;
}

.chat-msg-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.2s;
    animation: slideInMsg 0.3s ease forwards;
}

@keyframes slideInMsg {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.chat-msg-card:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.chat-msg-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-msg-name {
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
}

.chat-msg-time {
    color: #64748b;
    font-size: 0.75rem;
}

.chat-msg-content {
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-msg-content.hand {
    color: #f59e0b;
}

.chat-msg-content.submitted {
    color: #3b82f6;
}

.chat-msg-content.help {
    color: #ef4444;
}

.chat-msg-action {
    margin-top: 8px;
    border: none;
    background: rgba(99, 102, 241, 0.1);
    color: #818cf8;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
    text-align: center;
}

.chat-msg-action:hover {
    background: rgba(99, 102, 241, 0.2);
    color: white;
}

.chat-msg-delete {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: #64748b;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 0.7rem;
}

.chat-msg-delete:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* Modern Switch */
.switch-modern {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch-modern input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider-modern {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.slider-modern:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: #94a3b8;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider-modern {
    background-color: #10b981;
    border-color: #10b981;
}

input:checked+.slider-modern:before {
    transform: translateX(20px);
    background-color: white;
}

/* Teacher Notch Button Styling */
#btn-teacher-chat-toggle {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    height: 32px;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#btn-teacher-chat-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
    transform: scale(1.05);
}

#btn-teacher-chat-toggle:active {
    transform: scale(0.95);
}

/* Notebook Student Chat Buttons */
.student-chat-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.student-chat-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: scale(1.15) translateY(-2px);
}

.student-chat-btn:active {
    transform: scale(0.9);
}

/* Tooltip for student buttons */
.student-chat-btn::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 0.75rem;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s;
}

.student-chat-btn:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-8px);
}

/* Specific button colors when sent */
.student-chat-btn.sent {
    filter: grayscale(0.5) opacity(0.7);
    cursor: not-allowed;
}

/* Badge pulse animation */
#teacher-chat-badge {
    animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }

    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}