/* ==========================================================================
   BROPRO UNIVERSAL BHAI CHAT STYLESHEET 👑💬
   High-priority glassmorphic modal, floating widget, animated emojis,
   and mobile virtual keyboard resilient layout.
   ========================================================================== */

/* ── Modal Overlay (Highest Priority Above All Site Modals & Toasts) ── */
#studentChatModal.modal-overlay {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(4, 7, 14, 0.78) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    z-index: 2147483640 !important;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

#studentChatModal.modal-overlay.active {
    display: flex !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* ── Chat Modal Window ── */
.bhai-chat-modal {
    background: linear-gradient(180deg, #18192c 0%, #121528 100%);
    border-radius: 22px;
    width: 95%;
    max-width: 440px;
    height: 78vh;
    max-height: 680px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.65), 0 0 50px rgba(139, 92, 246, 0.25);
    border: 1px solid rgba(139, 92, 246, 0.35);
    position: relative;
    box-sizing: border-box;
    animation: bhaiChatModalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transition: width 0.32s cubic-bezier(0.16, 1, 0.3, 1),
                height 0.32s cubic-bezier(0.16, 1, 0.3, 1),
                max-width 0.32s cubic-bezier(0.16, 1, 0.3, 1),
                max-height 0.32s cubic-bezier(0.16, 1, 0.3, 1),
                border-radius 0.28s ease,
                box-shadow 0.28s ease;
}

/* ── Fullscreen Theater Mode (Immersive Desktop & Tablet Workspace) ── */
#studentChatModal.fullscreen-active {
    padding: 0 !important;
}

.bhai-chat-modal.fullscreen-mode {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    border: none !important;
    inset: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
}

.bhai-chat-modal.fullscreen-mode .bhai-chat-header {
    padding: 0.9rem clamp(1.25rem, 5vw, 3.5rem) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    cursor: default;
}

.bhai-chat-modal.fullscreen-mode .chat-mode-toggle-bar {
    padding: 0.65rem clamp(1.25rem, 5vw, 3.5rem) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.bhai-chat-modal.fullscreen-mode .bhai-chat-area {
    background-image: 
        radial-gradient(ellipse at 50% 30%, rgba(14, 15, 30, 0.22) 0%, rgba(10, 11, 24, 0.72) 80%),
        url('/assets/bhai-avatar-2048.webp') !important;
    background-position: center 12% !important;
    background-size: cover !important;
}

.bhai-chat-modal.fullscreen-mode .bhai-chat-messages {
    max-width: 960px !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding: 1.5rem clamp(1.25rem, 4vw, 2.5rem) !important;
    box-sizing: border-box !important;
}

.bhai-chat-modal.fullscreen-mode .bhai-welcome-screen {
    max-width: 760px !important;
    width: 100% !important;
    margin: auto !important;
    padding: 2rem 1.5rem !important;
}

.bhai-chat-modal.fullscreen-mode .student-quick-replies {
    display: none !important;
}

.bhai-chat-modal.fullscreen-mode .student-reply-dock {
    max-width: 960px !important;
    width: 100% !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
}

.bhai-chat-modal.fullscreen-mode .bhai-input-area {
    max-width: 960px !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding: 1rem clamp(1.25rem, 4vw, 2.5rem) calc(1rem + env(safe-area-inset-bottom, 0px)) !important;
    box-sizing: border-box !important;
}

@keyframes bhaiChatModalPop {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(12px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ── Chat Modal Themes ── */
/* 1. Galaxy Neon (Default) */
.bhai-chat-modal.theme-galaxy {
    background: linear-gradient(180deg, #18192c 0%, #121528 100%) !important;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.65), 0 0 50px rgba(139, 92, 246, 0.25) !important;
    border: 1px solid rgba(139, 92, 246, 0.35) !important;
}

/* 2. OLED Midnight */
.bhai-chat-modal.theme-midnight {
    background: linear-gradient(180deg, #09090b 0%, #020203 100%) !important;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.85), 0 0 40px rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
}
.bhai-chat-modal.theme-midnight .bhai-chat-header {
    background: linear-gradient(135deg, #14141a 0%, #08080c 100%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* 3. Royal Gold */
.bhai-chat-modal.theme-gold {
    background: linear-gradient(180deg, #19140c 0%, #0d0a06 100%) !important;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.75), 0 0 50px rgba(245, 158, 11, 0.28) !important;
    border: 1px solid rgba(245, 158, 11, 0.4) !important;
}
.bhai-chat-modal.theme-gold .bhai-chat-header {
    background: linear-gradient(135deg, #332109 0%, #171107 100%) !important;
    border-bottom: 1px solid rgba(245, 158, 11, 0.3) !important;
}
.bhai-chat-modal.theme-gold .student-msg {
    background: linear-gradient(135deg, #d97706, #b45309) !important;
}

/* 4. Cyber Emerald */
.bhai-chat-modal.theme-emerald {
    background: linear-gradient(180deg, #091a14 0%, #04100c 100%) !important;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.75), 0 0 50px rgba(16, 185, 129, 0.28) !important;
    border: 1px solid rgba(16, 185, 129, 0.4) !important;
}
.bhai-chat-modal.theme-emerald .bhai-chat-header {
    background: linear-gradient(135deg, #0a3325 0%, #061912 100%) !important;
    border-bottom: 1px solid rgba(16, 185, 129, 0.3) !important;
}
.bhai-chat-modal.theme-emerald .student-msg {
    background: linear-gradient(135deg, #059669, #047857) !important;
}

/* 5. Sunset Rose */
.bhai-chat-modal.theme-rose {
    background: linear-gradient(180deg, #220e18 0%, #12060c 100%) !important;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.75), 0 0 50px rgba(244, 63, 94, 0.28) !important;
    border: 1px solid rgba(244, 63, 94, 0.4) !important;
}
.bhai-chat-modal.theme-rose .bhai-chat-header {
    background: linear-gradient(135deg, #3d1426 0%, #1e0913 100%) !important;
    border-bottom: 1px solid rgba(244, 63, 94, 0.3) !important;
}
.bhai-chat-modal.theme-rose .student-msg {
    background: linear-gradient(135deg, #e11d48, #be123c) !important;
}

/* 6. BroPro (Official Website Brand Theme: Emerald Green #10B981 & Golden Amber #F59E0B) */
.bhai-chat-modal.theme-bropro,
.bhai-chat-modal.theme-supersite {
    background: linear-gradient(180deg, #070d0a 0%, #040806 100%) !important;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.88), 0 0 55px rgba(16, 185, 129, 0.28), 0 0 35px rgba(245, 158, 11, 0.18) !important;
    border: 1px solid rgba(16, 185, 129, 0.42) !important;
}
.bhai-chat-modal.theme-bropro .bhai-chat-header,
.bhai-chat-modal.theme-supersite .bhai-chat-header {
    background: linear-gradient(135deg, #091f17 0%, #05120d 100%) !important;
    border-bottom: 1px solid rgba(16, 185, 129, 0.35) !important;
}
.bhai-chat-modal.theme-bropro .bhai-header-avatar,
.bhai-chat-modal.theme-supersite .bhai-header-avatar {
    border: 2px solid #10b981 !important;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.5) !important;
}
.bhai-chat-modal.theme-bropro .chat-mode-toggle-bar,
.bhai-chat-modal.theme-supersite .chat-mode-toggle-bar {
    background: linear-gradient(180deg, rgba(8, 18, 14, 0.98), rgba(5, 11, 9, 0.96)) !important;
    border-bottom: 1px solid rgba(16, 185, 129, 0.25) !important;
}
.bhai-chat-modal.theme-bropro .mode-btn.active,
.bhai-chat-modal.theme-supersite .mode-btn.active {
    background: linear-gradient(135deg, #0d8a68 0%, #d97706 100%) !important;
    box-shadow: 0 4px 15px rgba(13, 138, 104, 0.45) !important;
    color: #ffffff !important;
}
.bhai-chat-modal.theme-bropro .student-msg,
.bhai-chat-modal.theme-supersite .student-msg {
    background: linear-gradient(135deg, #059669 0%, #0d8a68 45%, #b45309 100%) !important;
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.35) !important;
    border: 1px solid rgba(245, 158, 11, 0.3) !important;
}
.bhai-chat-modal.theme-bropro .bhai-input-send-btn,
.bhai-chat-modal.theme-supersite .bhai-input-send-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 40%, #d97706 85%, #f59e0b 100%) !important;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.45) !important;
}
.bhai-chat-modal.theme-bropro .bhai-input-area,
.bhai-chat-modal.theme-supersite .bhai-input-area {
    border-top: 1px solid rgba(16, 185, 129, 0.25) !important;
    background: linear-gradient(180deg, rgba(8, 18, 14, 0.98), rgba(4, 9, 7, 0.99)) !important;
}
.bhai-chat-modal.theme-bropro .bhai-msg-bubble,
.bhai-chat-modal.theme-supersite .bhai-msg-bubble {
    border: 1px solid rgba(16, 185, 129, 0.22) !important;
}

/* ── Header ── */
.bhai-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.25rem;
    background: linear-gradient(135deg, #2b1848 0%, #17162b 100%);
    border-bottom: 1px solid rgba(139, 92, 246, 0.25);
    flex-shrink: 0;
    gap: 0.75rem;
}

.bhai-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.bhai-header-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    object-position: top;
    border: 2px solid #a855f7;
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.4);
    flex-shrink: 0;
}

.bhai-header-info {
    min-width: 0;
}

.bhai-header-info h2 {
    color: #ffffff;
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: inherit;
}

.bhai-status {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    color: #22c55e;
    font-weight: 500;
}

.bhai-status-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.8);
    animation: statusPulse 2s infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

.bhai-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.bhai-clear-chat-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(220, 38, 38, 0.25));
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: 10px;
    color: #ef4444;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bhai-clear-chat-btn:hover {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.25), rgba(220, 38, 38, 0.4));
    transform: translateY(-1px);
}

/* ── Fullscreen Toggle Button ── */
.bhai-fullscreen-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
    flex-shrink: 0;
}

.bhai-fullscreen-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(168, 85, 247, 0.6);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.25);
}

.bhai-fullscreen-btn:active,
.bhai-fullscreen-btn.active {
    background: rgba(168, 85, 247, 0.3);
    border-color: #a855f7;
    color: #ffffff;
}

.bhai-fullscreen-btn .bhai-fs-icon-expand {
    display: block;
}

.bhai-fullscreen-btn .bhai-fs-icon-collapse {
    display: none;
}

.bhai-chat-modal.fullscreen-mode .bhai-fullscreen-btn .bhai-fs-icon-expand {
    display: none;
}

.bhai-chat-modal.fullscreen-mode .bhai-fullscreen-btn .bhai-fs-icon-collapse {
    display: block;
}

@media (max-width: 600px) {
    .bhai-fullscreen-btn {
        display: none !important;
    }
}

/* ── 3-Dots Options Menu ── */
.bhai-options-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.bhai-options-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
}

.bhai-options-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(217, 70, 239, 0.6);
    color: #ffffff;
    transform: translateY(-1px);
}

.bhai-options-btn:active,
.bhai-options-btn.active {
    background: rgba(217, 70, 239, 0.35);
    border-color: #d946ef;
    color: #ffffff;
}

/* Glassmorphic Dropdown Menu */
.bhai-options-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 230px;
    background: rgba(18, 14, 32, 0.96);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    padding: 0.65rem;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), 0 0 20px rgba(139, 92, 246, 0.25);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.96);
    transform-origin: top right;
    transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s;
    pointer-events: none;
}

.bhai-options-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.bhai-dropdown-header {
    padding: 0.35rem 0.5rem 0.5rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.6);
}

/* Theme Swatch Selector */
.bhai-theme-grid {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.bhai-theme-opt {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0.6rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid transparent;
    border-radius: 9px;
    color: #cbd5e1;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
    width: 100%;
}

.bhai-theme-opt:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.bhai-theme-opt.active {
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.5);
    color: #ffffff;
    font-weight: 600;
}

.bhai-theme-opt.active::after {
    content: '✓';
    margin-left: auto;
    color: #a855f7;
    font-weight: 800;
    font-size: 0.85rem;
}

.theme-swatch {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
}

.theme-swatch.galaxy {
    background: linear-gradient(135deg, #8b5cf6, #3b82f6);
}
.theme-swatch.midnight {
    background: linear-gradient(135deg, #334155, #0f172a);
    border: 1px solid rgba(255, 255, 255, 0.3);
}
.theme-swatch.gold {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}
.theme-swatch.emerald {
    background: linear-gradient(135deg, #10b981, #059669);
}
.theme-swatch.rose {
    background: linear-gradient(135deg, #f43f5e, #be123c);
}
.theme-swatch.bropro,
.theme-swatch.supersite {
    background: linear-gradient(135deg, #10b981 0%, #059669 40%, #fbbf24 85%, #f59e0b 100%);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6), 0 0 5px rgba(245, 158, 11, 0.4);
}

.bhai-dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0.5rem 0.25rem;
}

.bhai-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 0.6rem;
    background: transparent;
    border: none;
    border-radius: 9px;
    color: #cbd5e1;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    width: 100%;
}

.bhai-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.bhai-dropdown-item .item-badge {
    margin-left: auto;
    font-size: 0.68rem;
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    font-weight: 700;
}

.bhai-dropdown-item .item-badge.off {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.bhai-close-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 1.05rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.bhai-close-btn:hover {
    background: rgba(239, 68, 68, 0.4);
    transform: scale(1.08);
}

/* ── Chat Mode Toggle Bar ── */
.chat-mode-toggle-bar {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    flex-shrink: 0 !important;
    min-height: 52px !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0.45rem 0.85rem !important;
    background: linear-gradient(180deg, rgba(26, 18, 44, 0.98), rgba(18, 14, 32, 0.95)) !important;
    border-bottom: 1px solid rgba(139, 92, 246, 0.25) !important;
    z-index: 10 !important;
}

.wallet-display-chat {
    display: flex !important;
    align-items: center !important;
    gap: 0.35rem !important;
    padding: 0.3rem 0.65rem !important;
    background: rgba(16, 185, 129, 0.16) !important;
    border: 1px solid rgba(16, 185, 129, 0.35) !important;
    border-radius: 18px !important;
    cursor: pointer !important;
    font-size: 0.82rem !important;
    font-weight: 700 !important;
    color: #34d399 !important;
}

.chat-mode-toggle {
    display: flex !important;
    gap: 0.35rem !important;
    background: rgba(0, 0, 0, 0.35) !important;
    border-radius: 10px !important;
    padding: 3px !important;
}

.mode-btn {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    padding: 0.35rem 0.65rem !important;
    border-radius: 8px !important;
    min-width: 68px !important;
    border: none !important;
    cursor: pointer !important;
    background: rgba(255, 255, 255, 0.05) !important;
    color: rgba(255, 255, 255, 0.75) !important;
    transition: all 0.2s ease !important;
}

.mode-btn.active {
    background: linear-gradient(135deg, #8b5cf6, #a855f7) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.35) !important;
}

.mode-btn .mode-icon { font-size: 0.95rem; }
.mode-btn .mode-label { font-size: 0.72rem; font-weight: 700; margin-top: 1px; }
.mode-btn .mode-cost { font-size: 0.62rem; opacity: 0.85; }

/* ── Chat Area & Ultra-HD Background ── */
.bhai-chat-area {
    flex: 1;
    overflow-y: auto;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background-color: #0e0f1e;
    /* Layer 1: Contrast-calibrated dark scrim ensuring 100% WCAG AAA text legibility while keeping artwork vivid */
    /* Layer 2: Ultra-HD crisp crowned hero avatar (1024px standard, 2048px Retina/4K, JPG fallback) */
    background-image: 
        linear-gradient(180deg, rgba(14, 15, 30, 0.35) 0%, rgba(10, 11, 24, 0.68) 100%),
        url('/assets/bhai-avatar-premium.jpg');
    background-image: 
        linear-gradient(180deg, rgba(14, 15, 30, 0.35) 0%, rgba(10, 11, 24, 0.68) 100%),
        url('/assets/bhai-avatar-1024.webp');
    background-image: 
        linear-gradient(180deg, rgba(14, 15, 30, 0.35) 0%, rgba(10, 11, 24, 0.68) 100%),
        -webkit-image-set(
            url('/assets/bhai-avatar-1024.webp') 1x,
            url('/assets/bhai-avatar-2048.webp') 2x
        );
    background-image: 
        linear-gradient(180deg, rgba(14, 15, 30, 0.35) 0%, rgba(10, 11, 24, 0.68) 100%),
        image-set(
            url('/assets/bhai-avatar-1024.webp') type("image/webp") 1x,
            url('/assets/bhai-avatar-2048.webp') type("image/webp") 2x,
            url('/assets/bhai-avatar-premium.jpg') type("image/jpeg") 1x
        );
    background-position: center top;
    background-size: cover;
    background-repeat: no-repeat;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: high-quality;
    transform: translateZ(0);
}

@media (-webkit-min-device-pixel-ratio: 1.5), (min-resolution: 144dpi), (min-width: 800px) {
    .bhai-chat-area {
        background-image: 
            linear-gradient(180deg, rgba(14, 15, 30, 0.35) 0%, rgba(10, 11, 24, 0.68) 100%),
            url('/assets/bhai-avatar-2048.webp');
    }
}

.bhai-welcome-screen {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 1.5rem 1rem;
    background: radial-gradient(circle at 50% 28%, rgba(14, 15, 32, 0.28) 0%, rgba(10, 10, 22, 0.62) 100%);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    z-index: 2;
    transition: opacity 0.3s ease;
    overflow-y: auto;
}

.bhai-welcome-overlay {
    text-align: center;
    max-width: 360px;
}

.wave-emoji {
    font-size: 2.5rem;
    display: inline-block;
    margin-bottom: 0.5rem;
    animation: wave 1.5s ease-in-out infinite;
}

@keyframes wave {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(18deg); }
    75% { transform: rotate(-18deg); }
}

.bhai-welcome-overlay h3 {
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 0.35rem;
}

.bhai-welcome-overlay p {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.85rem;
    margin: 0 0 1.2rem;
}

.mode-info-cards {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.mode-info-card {
    flex: 1;
    padding: 0.85rem 0.65rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.mode-info-card.real { border-color: rgba(139, 92, 246, 0.4); background: rgba(139, 92, 246, 0.12); }
.mode-info-card.ai { border-color: rgba(59, 130, 246, 0.4); background: rgba(59, 130, 246, 0.12); }

.mode-info-card .info-icon { font-size: 1.4rem; margin-bottom: 0.3rem; }
.mode-info-card .info-title { font-size: 0.8rem; font-weight: 700; color: #fff; margin-bottom: 0.2rem; }
.mode-info-card .info-desc { font-size: 0.68rem; color: rgba(255, 255, 255, 0.68); line-height: 1.2; margin-bottom: 0.4rem; }
.mode-info-card .info-cost { font-size: 0.7rem; font-weight: 700; color: #fbbf24; }

/* ── Messages Container ── */
.bhai-messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    z-index: 3;
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 92, 246, 0.3) transparent;
}

.bhai-messages-container::-webkit-scrollbar { width: 5px; }
.bhai-messages-container::-webkit-scrollbar-thumb {
    background-color: rgba(139, 92, 246, 0.3);
    border-radius: 3px;
}

/* ── Message Bubbles ── */
.chat-message,
.bhai-chat-bubble {
    max-width: 82%;
    padding: 0.75rem 0.95rem;
    border-radius: 14px;
    position: relative;
    color: #ffffff;
    font-size: 0.92rem;
    line-height: 1.42;
    word-break: break-word;
    animation: fadeIn 0.2s ease;
}

/* Student's Perspective: Student on Right, Bhai on Left */
#studentChatModal .chat-message.user-message,
#studentChatModal .user-bubble {
    align-self: flex-end;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    border-bottom-right-radius: 2px;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.3);
}

#studentChatModal .chat-message.admin-message,
#studentChatModal .bhai-bubble {
    align-self: flex-start;
    background: linear-gradient(135deg, rgba(28, 20, 52, 0.95), rgba(38, 24, 68, 0.95));
    backdrop-filter: blur(10px);
    border: 1px solid rgba(139, 92, 246, 0.35);
    border-bottom-left-radius: 2px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

/* ── WhatsApp-Grade Animated Emojis in Chat ── */
/* Base Container Override: 100% Transparent, Seamless, Zero Speech Bubble */
#studentChatModal .chat-message.emoji-message,
#studentChatModal .chat-message.user-message.emoji-message,
#studentChatModal .chat-message.admin-message.emoji-message,
#studentChatModal .chat-message.emoji-single,
#studentChatModal .chat-message.emoji-few,
#studentChatModal .chat-message.emoji-many,
#studentChatModal .user-bubble.emoji-message,
#studentChatModal .bhai-bubble.emoji-message,
#studentChatModal .chat-message:has(.emoji-content),
#studentChatModal .chat-message:has(.premium-emoji),
.chat-message.emoji-message,
.chat-message.user-message.emoji-message,
.chat-message.admin-message.emoji-message {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    padding: 6px 4px !important;
    max-width: none !important;
    overflow: visible !important;
    display: flex !important;
    flex-direction: column !important;
}

/* Alignment */
#studentChatModal .chat-message.user-message.emoji-message,
.chat-message.user-message.emoji-message {
    align-self: flex-end !important;
    align-items: flex-end !important;
    margin-left: auto !important;
    margin-right: 4px !important;
}

#studentChatModal .chat-message.admin-message.emoji-message,
.chat-message.admin-message.emoji-message {
    align-self: flex-start !important;
    align-items: flex-start !important;
    margin-right: auto !important;
    margin-left: 4px !important;
}

/* Emoji Typography & Scale Hierarchy */
#studentChatModal .chat-message.emoji-message .emoji-content,
#studentChatModal .chat-message.emoji-message .message-content,
.chat-message.emoji-message .emoji-content,
.chat-message.emoji-message .message-content {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1.15 !important;
    display: inline-block !important;
    text-align: center !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    cursor: pointer !important;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    transform-origin: center center !important;
}

/* Single Emoji (~76px desktop, ~64px mobile) */
#studentChatModal .chat-message.emoji-single .emoji-content,
#studentChatModal .chat-message.emoji-single .message-content,
.chat-message.emoji-single .emoji-content,
.chat-message.emoji-single .message-content {
    font-size: 4.8rem !important;
    letter-spacing: 0 !important;
}

/* 2-3 Emojis (~50px) */
#studentChatModal .chat-message.emoji-few .emoji-content,
#studentChatModal .chat-message.emoji-few .message-content,
.chat-message.emoji-few .emoji-content,
.chat-message.emoji-few .message-content {
    font-size: 3.2rem !important;
    letter-spacing: 4px !important;
}

/* 4+ Emojis (~34px) */
#studentChatModal .chat-message.emoji-many .emoji-content,
#studentChatModal .chat-message.emoji-many .message-content,
.chat-message.emoji-many .emoji-content,
.chat-message.emoji-many .message-content {
    font-size: 2.2rem !important;
    letter-spacing: 2px !important;
}

/* Responsive Mobile Sizing */
@media (max-width: 768px) {
    #studentChatModal .chat-message.emoji-single .emoji-content,
    #studentChatModal .chat-message.emoji-single .message-content {
        font-size: 4rem !important;
    }
    #studentChatModal .chat-message.emoji-few .emoji-content,
    #studentChatModal .chat-message.emoji-few .message-content {
        font-size: 2.75rem !important;
    }
    #studentChatModal .chat-message.emoji-many .emoji-content,
    #studentChatModal .chat-message.emoji-many .message-content {
        font-size: 1.95rem !important;
    }
}

/* Clean Timestamp beneath Emoji */
#studentChatModal .chat-message.emoji-message .message-time,
.chat-message.emoji-message .message-time {
    font-size: 0.68rem !important;
    opacity: 0.65 !important;
    margin-top: 4px !important;
    padding: 2px 8px !important;
    text-align: center !important;
    width: 100% !important;
    color: rgba(255, 255, 255, 0.75) !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6) !important;
}

/* WhatsApp Send & Arrival Entrance Pop Spring Animation */
#studentChatModal .chat-message.emoji-message,
.chat-message.emoji-message {
    animation: whatsappEmojiSendPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both !important;
}

@keyframes whatsappEmojiSendPop {
    0% {
        transform: scale(0.15) rotate(-16deg);
        opacity: 0;
    }
    55% {
        transform: scale(1.3) rotate(4deg);
        opacity: 1;
    }
    75% {
        transform: scale(0.92) rotate(-2deg);
    }
    90% {
        transform: scale(1.04) rotate(1deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* ── Type-Specific Continuous Living Animations with Vivid Aura Glow ── */

/* ❤️ Hearts - Authentic WhatsApp Double-Pump Heartbeat */
.chat-message.emoji-type-heart .emoji-content,
.chat-message.emoji-type-heart .message-content {
    animation: whatsappHeartbeat 1.25s ease-in-out infinite !important;
    filter: drop-shadow(0 0 18px rgba(244, 63, 94, 0.75)) drop-shadow(0 0 35px rgba(239, 68, 68, 0.45)) !important;
}

@keyframes whatsappHeartbeat {
    0% {
        transform: scale(1);
        filter: drop-shadow(0 0 16px rgba(244, 63, 94, 0.65));
    }
    14% {
        transform: scale(1.32);
        filter: drop-shadow(0 0 34px rgba(244, 63, 94, 0.98)) drop-shadow(0 0 45px rgba(239, 68, 68, 0.7));
    }
    28% {
        transform: scale(1);
        filter: drop-shadow(0 0 16px rgba(244, 63, 94, 0.65));
    }
    42% {
        transform: scale(1.2);
        filter: drop-shadow(0 0 28px rgba(244, 63, 94, 0.88)) drop-shadow(0 0 38px rgba(239, 68, 68, 0.55));
    }
    56% {
        transform: scale(1);
        filter: drop-shadow(0 0 16px rgba(244, 63, 94, 0.65));
    }
    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 16px rgba(244, 63, 94, 0.65));
    }
}

/* ✅ Success / Checkmark / Hundred / Target (Matches Image 1 Checkmark) */
.chat-message.emoji-type-hundred .emoji-content,
.chat-message.emoji-type-hundred .message-content,
.chat-message.emoji-type-success .emoji-content,
.chat-message.emoji-type-success .message-content {
    animation: whatsappSuccessPulse 1.4s ease-in-out infinite !important;
    filter: drop-shadow(0 0 24px rgba(34, 197, 94, 0.9)) drop-shadow(0 0 40px rgba(74, 222, 128, 0.55)) !important;
}

@keyframes whatsappSuccessPulse {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 20px rgba(34, 197, 94, 0.8)) drop-shadow(0 0 35px rgba(34, 197, 94, 0.45));
    }
    50% {
        transform: scale(1.09);
        filter: drop-shadow(0 0 32px rgba(34, 197, 94, 1)) drop-shadow(0 0 50px rgba(74, 222, 128, 0.75));
    }
}

/* 😋 Yummy / Delicious / Food (Matches Image 1 Yummy Face) */
.chat-message.emoji-type-yummy .emoji-content,
.chat-message.emoji-type-yummy .message-content {
    animation: whatsappYummySway 1.5s ease-in-out infinite !important;
    filter: drop-shadow(0 0 24px rgba(245, 158, 11, 0.85)) drop-shadow(0 0 38px rgba(251, 191, 36, 0.5)) !important;
}

@keyframes whatsappYummySway {
    0%, 100% {
        transform: translateY(0) rotate(-4deg) scale(1);
        filter: drop-shadow(0 0 20px rgba(245, 158, 11, 0.8));
    }
    50% {
        transform: translateY(-10px) rotate(4deg) scale(1.08);
        filter: drop-shadow(0 0 34px rgba(245, 158, 11, 1)) drop-shadow(0 0 48px rgba(251, 191, 36, 0.7));
    }
}

/* 😍 Love Faces / Sweet (Matches Image 1 Heart-Eyes) */
.chat-message.emoji-type-love .emoji-content,
.chat-message.emoji-type-love .message-content {
    animation: whatsappLoveFloat 1.6s ease-in-out infinite !important;
    filter: drop-shadow(0 0 24px rgba(244, 63, 94, 0.8)) drop-shadow(0 0 38px rgba(251, 113, 133, 0.5)) !important;
}

@keyframes whatsappLoveFloat {
    0%, 100% {
        transform: translateY(0) rotate(-5deg) scale(1);
        filter: drop-shadow(0 0 20px rgba(244, 63, 94, 0.75));
    }
    50% {
        transform: translateY(-12px) rotate(5deg) scale(1.08);
        filter: drop-shadow(0 0 34px rgba(244, 63, 94, 0.95)) drop-shadow(0 0 46px rgba(251, 113, 133, 0.65));
    }
}

/* 🔥 Fire & Sparkles - Radiant Flame Glow */
.chat-message.emoji-type-fire .emoji-content,
.chat-message.emoji-type-fire .message-content {
    animation: whatsappFireFlicker 0.22s ease-in-out infinite alternate !important;
    filter: drop-shadow(0 0 26px rgba(249, 115, 22, 0.9)) drop-shadow(0 0 40px rgba(234, 179, 8, 0.6)) !important;
}

@keyframes whatsappFireFlicker {
    0% { transform: scale(1) rotate(-3deg); }
    100% { transform: scale(1.09) rotate(3deg); }
}

/* 🎉 Celebration & Party - Joyous Bounce */
.chat-message.emoji-type-celebration .emoji-content,
.chat-message.emoji-type-celebration .message-content {
    animation: whatsappPartyBounce 0.6s ease-in-out infinite alternate !important;
    filter: drop-shadow(0 0 22px rgba(234, 179, 8, 0.85)) drop-shadow(0 0 38px rgba(245, 158, 11, 0.5)) !important;
}

@keyframes whatsappPartyBounce {
    0% { transform: translateY(0) rotate(-4deg) scale(1); }
    100% { transform: translateY(-12px) rotate(4deg) scale(1.08); }
}

/* 👍 Gesture / Thumbs / Hand Wave - Expressive Wave */
.chat-message.emoji-type-gesture .emoji-content,
.chat-message.emoji-type-gesture .message-content {
    animation: whatsappGestureWave 0.85s ease-in-out infinite !important;
    transform-origin: bottom center !important;
    filter: drop-shadow(0 0 20px rgba(16, 185, 129, 0.75)) drop-shadow(0 0 34px rgba(52, 211, 153, 0.45)) !important;
}

@keyframes whatsappGestureWave {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(18deg) scale(1.05); }
    75% { transform: rotate(-18deg) scale(1.05); }
}

/* 😂 Laugh / Giggle - Joyful Wobble Shake */
.chat-message.emoji-type-laugh .emoji-content,
.chat-message.emoji-type-laugh .message-content {
    animation: whatsappLaughShake 0.1s ease-in-out infinite !important;
    filter: drop-shadow(0 0 20px rgba(245, 158, 11, 0.75)) drop-shadow(0 0 32px rgba(251, 191, 36, 0.45)) !important;
}

@keyframes whatsappLaughShake {
    0%, 100% { transform: rotate(-5deg) scale(1); }
    50% { transform: rotate(5deg) scale(1.06); }
}

/* 😢 Sad / Crying - Sympathetic Tearful Ripple */
.chat-message.emoji-type-sad .emoji-content,
.chat-message.emoji-type-sad .message-content {
    animation: whatsappSadTremble 0.12s ease-in-out infinite !important;
    filter: drop-shadow(0 4px 18px rgba(59, 130, 246, 0.75)) drop-shadow(0 0 30px rgba(96, 165, 250, 0.45)) !important;
}

@keyframes whatsappSadTremble {
    0%, 100% { transform: translateX(0) translateY(0); }
    25% { transform: translateX(-2px) translateY(1px); }
    75% { transform: translateX(2px) translateY(1px); }
}

/* Default Single Emoji — Ambient Floating Breathing Halo */
.chat-message.emoji-type-default .emoji-content,
.chat-message.emoji-type-default .message-content {
    animation: whatsappDefaultFloat 1.8s ease-in-out infinite !important;
    filter: drop-shadow(0 0 20px rgba(168, 85, 247, 0.7)) drop-shadow(0 0 35px rgba(216, 180, 254, 0.4)) !important;
}

@keyframes whatsappDefaultFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-8px) scale(1.05); }
}

/* Interactive WhatsApp Tap/Click Burst Pop */
#studentChatModal .chat-message.emoji-message .emoji-content:active,
.chat-message.emoji-message .emoji-content:active {
    transform: scale(0.82) !important;
    transition: transform 0.08s ease !important;
}

.chat-message.emoji-message .emoji-content.burst-pop {
    animation: whatsappBurstPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both !important;
}

@keyframes whatsappBurstPop {
    0% { transform: scale(1); }
    38% { transform: scale(1.4) rotate(8deg); }
    68% { transform: scale(0.92) rotate(-4deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.message-time,
.bubble-time {
    font-size: 0.68rem;
    opacity: 0.65;
    margin-top: 4px;
    display: block;
    text-align: right;
}

/* ── Universal Image Safety Guards in Chat ── */
#studentChatMessages img,
.bhai-messages-container img {
    max-width: 100%;
    height: auto;
}

/* ── AI Response Bubble & Avatar Layout (Zero Blown-up Image Guarantee) ── */
#studentChatModal .bhai-chat-bubble.ai-response,
.bhai-chat-bubble.ai-response {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: 10px !important;
    align-self: flex-start !important;
    background: linear-gradient(135deg, rgba(28, 20, 52, 0.95), rgba(38, 24, 68, 0.95)) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(168, 85, 247, 0.45) !important;
    border-radius: 16px 16px 16px 4px !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35) !important;
    padding: 10px 14px !important;
    max-width: 85% !important;
    margin: 6px 0 !important;
    position: relative !important;
    box-sizing: border-box !important;
}

/* AI Bubble Avatar Container */
.bhai-chat-bubble .bubble-avatar,
.bubble-avatar {
    position: relative !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    max-width: 36px !important;
    max-height: 36px !important;
    border-radius: 50% !important;
    flex-shrink: 0 !important;
    display: inline-block !important;
    overflow: visible !important;
    margin-top: 2px !important;
}

/* AI Avatar Image (Strictly 36x36 circular, never absurd / blown-up) */
.bhai-chat-bubble .bubble-avatar .avatar-img,
.bubble-avatar .avatar-img,
img.avatar-img {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    max-width: 36px !important;
    max-height: 36px !important;
    border-radius: 50% !important;
    border: 2px solid #a855f7 !important;
    object-fit: cover !important;
    display: block !important;
    box-shadow: 0 2px 8px rgba(168, 85, 247, 0.4) !important;
    aspect-ratio: 1 / 1 !important;
}

/* AI Mini Bot Badge */
.bhai-chat-bubble .bubble-avatar .ai-badge,
.bubble-avatar .ai-badge {
    position: absolute !important;
    bottom: -3px !important;
    right: -3px !important;
    font-size: 0.72rem !important;
    background: #1a1a2e !important;
    border: 1.5px solid #a855f7 !important;
    border-radius: 50% !important;
    padding: 1px !important;
    line-height: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 16px !important;
    height: 16px !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6) !important;
}

/* AI Message Content Area */
.bhai-chat-bubble .bubble-content {
    flex: 1 !important;
    min-width: 0 !important;
}

/* AI Sender Label */
.bhai-chat-bubble .bubble-sender {
    color: #c084fc !important;
    font-weight: 700 !important;
    font-size: 0.8rem !important;
    display: block !important;
    margin-bottom: 3px !important;
    letter-spacing: 0.3px !important;
}

/* AI Text Body */
.bhai-chat-bubble .bubble-text {
    color: #f3f4f6 !important;
    margin: 0 !important;
    font-size: 0.92rem !important;
    line-height: 1.45 !important;
    word-break: break-word !important;
}

.bhai-chat-bubble .bubble-text code {
    background: rgba(168, 85, 247, 0.25) !important;
    color: #e9d5ff !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
    font-size: 0.88em !important;
}

.bhai-chat-bubble.ai-response .bubble-time {
    font-size: 0.65rem !important;
    color: rgba(255, 255, 255, 0.55) !important;
    margin-top: 4px !important;
    display: block !important;
    text-align: right !important;
}

/* ── Quoted Replies (In-Chat Transcript) ── */
.quoted-reply {
    padding: 0.45rem 0.75rem;
    border-left: 3px solid #8b5cf6;
    background: rgba(139, 92, 246, 0.12);
    border-radius: 0 8px 8px 0;
    margin-bottom: 0.5rem;
    font-size: 0.78rem;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
    user-select: none;
    -webkit-user-select: none;
}
.quoted-reply:hover {
    background: rgba(139, 92, 246, 0.22);
    transform: translateX(2px);
}
.quoted-reply.admin-quoted {
    border-left-color: #fbbf24;
    background: rgba(251, 191, 36, 0.12);
}
.quoted-reply.admin-quoted:hover {
    background: rgba(251, 191, 36, 0.22);
}
.quoted-reply-sender {
    font-weight: 700;
    color: #c084fc;
    font-size: 0.72rem;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 0.2rem;
}
.quoted-reply.admin-quoted .quoted-reply-sender {
    color: #fbbf24;
}
.quoted-reply-arrow {
    font-size: 0.75rem;
    opacity: 0.85;
}
.quoted-reply-text {
    color: rgba(255, 255, 255, 0.82);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

/* ── Highlight Pulse Animation for Clicked Quoted Reply ── */
@keyframes highlightMsgPulse {
    0% { transform: scale(1); box-shadow: 0 0 0 rgba(139, 92, 246, 0); }
    30% { transform: scale(1.025); box-shadow: 0 0 24px rgba(139, 92, 246, 0.7); background-color: rgba(139, 92, 246, 0.28); }
    60% { transform: scale(1.01); box-shadow: 0 0 16px rgba(139, 92, 246, 0.45); }
    100% { transform: scale(1); box-shadow: 0 0 0 rgba(139, 92, 246, 0); }
}
.chat-message.highlight-msg,
.bhai-chat-bubble.highlight-msg {
    animation: highlightMsgPulse 2s ease-out !important;
}

/* ── Swipe-to-Reply (Touch / Mobile Standard) ── */
.chat-message,
.bhai-chat-bubble {
    position: relative !important;
    touch-action: pan-y;
}
.chat-message.swipe-reply-active,
.bhai-chat-bubble.swipe-reply-active {
    will-change: transform;
}
.chat-message::before,
.bhai-chat-bubble::before {
    content: '↩️';
    position: absolute;
    left: -32px;
    top: 50%;
    transform: translateY(-50%) scale(0.6);
    opacity: 0;
    font-size: 1.15rem;
    transition: opacity 0.15s ease, transform 0.15s ease;
    pointer-events: none;
    z-index: 5;
}
.chat-message.swipe-ready::before,
.bhai-chat-bubble.swipe-ready::before {
    opacity: 1;
    transform: translateY(-50%) scale(1.15);
    filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.8));
}

/* ── Hover Micro-Action Bar (Desktop Standard) ── */
.bubble-action-bar {
    position: absolute;
    top: -13px;
    right: 12px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: rgba(20, 16, 38, 0.96);
    border: 1px solid rgba(139, 92, 246, 0.45);
    border-radius: 18px;
    padding: 2px 5px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 12;
    opacity: 0;
    transform: translateY(3px);
    transition: opacity 0.16s ease, transform 0.16s ease;
    pointer-events: none;
}
.chat-message.user-message .bubble-action-bar,
.bhai-chat-bubble.user-bubble .bubble-action-bar {
    right: auto;
    left: 12px;
}
@media (hover: hover) and (pointer: fine) {
    .chat-message:hover .bubble-action-bar,
    .bhai-chat-bubble:hover .bubble-action-bar {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }
}
.bubble-action-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.78);
    padding: 3px 6px;
    font-size: 0.85rem;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.bubble-action-btn:hover {
    background: rgba(139, 92, 246, 0.35);
    color: #ffffff;
    transform: scale(1.12);
}
.bubble-action-btn:active {
    transform: scale(0.95);
}

/* ── Docked Reply Bar (Positioned Cleanly Above Input Row) ── */
.student-reply-dock,
.student-reply-preview {
    display: none;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    background: linear-gradient(135deg, rgba(24, 18, 44, 0.98), rgba(16, 12, 32, 0.98));
    border-top: 1px solid rgba(139, 92, 246, 0.3);
    border-bottom: 1px solid rgba(139, 92, 246, 0.15);
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
    position: relative;
    z-index: 11;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: replyDockSlideIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes replyDockSlideIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.reply-dock-indicator,
.reply-preview-indicator {
    width: 4px;
    align-self: stretch;
    min-height: 28px;
    background: linear-gradient(180deg, #8b5cf6, #c084fc);
    border-radius: 3px;
    flex-shrink: 0;
}
.reply-dock-indicator.admin,
.reply-preview-indicator.admin {
    background: linear-gradient(180deg, #f59e0b, #fbbf24);
}
.reply-dock-content,
.reply-preview-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.reply-dock-header {
    display: flex;
    align-items: center;
    gap: 5px;
}
.reply-dock-icon {
    font-size: 0.75rem;
    opacity: 0.9;
}
.reply-dock-sender,
.reply-preview-sender {
    font-size: 0.74rem;
    font-weight: 700;
    color: #c084fc;
    letter-spacing: 0.2px;
}
.reply-dock-sender.admin,
.reply-preview-sender.admin {
    color: #fbbf24;
}
.reply-dock-sender.ai,
.reply-preview-sender.ai {
    color: #a855f7;
}
.reply-dock-sender.user,
.reply-preview-sender.user {
    color: #38bdf8;
}
.reply-dock-text,
.reply-preview-text {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.78);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.reply-dock-cancel,
.reply-preview-cancel {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.75);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    flex-shrink: 0;
    transition: all 0.18s ease;
}
.reply-dock-cancel:hover,
.reply-preview-cancel:hover {
    background: rgba(239, 68, 68, 0.28);
    border-color: rgba(239, 68, 68, 0.5);
    color: #ffffff;
    transform: scale(1.1);
}
.reply-dock-cancel:active,
.reply-preview-cancel:active {
    transform: scale(0.92);
}

/* ── Quick Suggestion Chips (Cleanly Disabled & Hidden) ── */
.student-quick-replies {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    overflow: hidden !important;
    pointer-events: none !important;
}
.student-quick-replies::-webkit-scrollbar {
    display: none !important;
}
.quick-reply-chip {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* ── Typing Indicator ── */
.bhai-typing-indicator,
.ai-typing-indicator {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.9rem;
    align-self: flex-start;
    z-index: 4;
    background: rgba(30, 22, 54, 0.85);
    border: 1px solid rgba(139, 92, 246, 0.35);
    border-radius: 16px 16px 16px 4px;
    margin: 0.35rem 0;
    max-width: 85%;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    animation: fadeIn 0.2s ease;
}

.typing-avatar-wrapper {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid #8b5cf6;
    flex-shrink: 0;
}

.typing-avatar-img { width: 100%; height: 100%; object-fit: cover; }

.typing-bubble {
    background: transparent;
    padding: 0;
    border: none;
}

.ai-typing-indicator .typing-dots,
.bhai-typing-indicator .typing-dots {
    display: flex;
    gap: 5px;
    align-items: center;
}

.ai-typing-indicator .dot,
.bhai-typing-indicator .typing-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #c084fc;
    box-shadow: 0 0 8px rgba(192, 132, 252, 0.6);
    animation: typingBounce 1.4s ease-in-out infinite;
}

.ai-typing-indicator .dot:nth-child(2),
.bhai-typing-indicator .typing-dot:nth-child(2) { animation-delay: 0.2s; }

.ai-typing-indicator .dot:nth-child(3),
.bhai-typing-indicator .typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 100% { opacity: 0.3; transform: scale(0.85); }
    50% { opacity: 1; transform: scale(1.25); }
}

.ai-typing-indicator .typing-text,
.bhai-typing-indicator .typing-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #e9d5ff;
    letter-spacing: 0.2px;
}

/* ── BhAI Error / Refund Bubble ── */
.bhai-error-bubble {
    align-self: flex-start;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: 16px 16px 16px 4px;
    padding: 0.75rem 1rem;
    max-width: 85%;
    margin: 0.4rem 0;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.15);
    animation: fadeIn 0.2s ease;
}

.bhai-error-bubble .error-title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.84rem;
    font-weight: 700;
    color: #f87171;
    margin-bottom: 0.3rem;
}

.bhai-error-bubble .error-text {
    margin: 0;
    font-size: 0.84rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.4;
}

.bhai-error-bubble .error-refund-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.45rem;
    padding: 0.2rem 0.5rem;
    background: rgba(16, 185, 129, 0.18);
    border: 1px solid rgba(16, 185, 129, 0.4);
    border-radius: 8px;
    color: #34d399;
    font-size: 0.72rem;
    font-weight: 700;
}

/* ── High-Priority Toast Visibility ── */
.chat-clear-toast {
    z-index: 2147483647 !important;
}


/* ── Input Area ── */
.bhai-input-area {
    display: flex !important;
    visibility: visible !important;
    align-items: center !important;
    gap: 0.65rem !important;
    padding: 0.85rem 1rem !important;
    background: #0d0e1a !important;
    border-top: 1px solid rgba(139, 92, 246, 0.25) !important;
    flex-shrink: 0 !important;
    position: relative !important;
    z-index: 10 !important;
}

.student-action-menu-container {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    z-index: 50 !important;
}

.student-action-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid rgba(139, 92, 246, 0.35);
    background: rgba(139, 92, 246, 0.15);
    color: #ffffff;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.student-action-btn:hover {
    background: rgba(139, 92, 246, 0.3);
    transform: scale(1.08);
}
.student-action-btn .student-action-icon {
    pointer-events: none !important;
    display: inline-block;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    line-height: 1;
}

.student-action-popup {
    display: none;
    position: absolute !important;
    bottom: calc(100% + 10px) !important;
    left: 0 !important;
    min-width: 195px !important;
    background: rgba(20, 16, 40, 0.98) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(139, 92, 246, 0.35) !important;
    border-radius: 14px !important;
    padding: 0.5rem !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(139, 92, 246, 0.2) !important;
    z-index: 1000 !important;
    animation: actionMenuIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.student-action-popup.active {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
}

@keyframes actionMenuIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.action-menu-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: #ffffff;
    font-size: 0.85rem;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease;
}
.action-menu-item:hover { background: rgba(255, 255, 255, 0.1); }
.action-item-badge {
    margin-left: auto;
    background: #f59e0b;
    color: #000;
    font-size: 0.62rem;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 6px;
}

/* Emoji Picker */
.emoji-picker-container { position: relative; }
.emoji-picker {
    position: absolute;
    bottom: 60px;
    left: 0;
    background: linear-gradient(145deg, #181932, #242548);
    border-radius: 18px;
    padding: 12px;
    width: 290px;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(139, 92, 246, 0.3);
    display: none;
    z-index: 105;
}
.emoji-picker.active { display: block; }
.emoji-picker-header {
    font-size: 0.78rem;
    color: #c084fc;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: 700;
}
.emoji-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    max-height: 220px;
    overflow-y: auto;
}
.animated-emoji {
    font-size: 1.7rem;
    cursor: pointer;
    padding: 6px;
    border-radius: 10px;
    text-align: center;
    transition: transform 0.15s ease;
}
.animated-emoji:hover { transform: scale(1.2); background: rgba(255, 255, 255, 0.1); }

/* Textarea & Send */
#studentMessageInput {
    flex: 1;
    min-height: 42px;
    max-height: 120px;
    padding: 0.75rem 1.15rem;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-size: 0.92rem;
    font-family: inherit;
    resize: none;
    line-height: 1.35;
    outline: none;
    box-sizing: border-box;
}
#studentMessageInput:focus {
    border-color: rgba(139, 92, 246, 0.6);
    background: rgba(255, 255, 255, 0.12);
}

.bhai-send-btn {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #8b5cf6, #d946ef);
    color: #ffffff;
    font-size: 1.15rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.bhai-send-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.6);
}

/* ── Floating 'Talk to Bhai' Widget ── */
/* ── Floating 'Talk to Bhai' Widget ── */
.bhai-container {
    position: fixed;
    z-index: 999999;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
    cursor: grab;
    will-change: transform, opacity;
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
    width: 64px;
    height: 64px;
    display: block;
    box-sizing: border-box;
}

.bhai-container:not(.bhai-positioned) {
    bottom: 2rem;
    right: 2rem;
}

/* All Verticals & Ecosystem: Elevated safely above bottom tab bar across all pages */
body[data-auth-theme="learn"] .bhai-container:not(.bhai-positioned),
body:has(.learning-native-tabbar) .bhai-container:not(.bhai-positioned),
.learning-native-tabbar ~ .bhai-container:not(.bhai-positioned),
body[data-auth-theme="ecosystem"] .bhai-container:not(.bhai-positioned),
body:has(.mobile-tab-bar) .bhai-container:not(.bhai-positioned),
.mobile-tab-bar ~ .bhai-container:not(.bhai-positioned),
body.store-page .bhai-container:not(.bhai-positioned),
body:has(.store-native-tabbar) .bhai-container:not(.bhai-positioned),
.store-native-tabbar ~ .bhai-container:not(.bhai-positioned),
body:has(nav[class*="tab-bar"]) .bhai-container:not(.bhai-positioned),
body:has(nav[class*="tabbar"]) .bhai-container:not(.bhai-positioned),
body:has([class*="native-tabbar"]) .bhai-container:not(.bhai-positioned) {
    bottom: calc(var(--store-native-tabbar-height, var(--learn-native-bar-height, 68px)) + max(7px, env(safe-area-inset-bottom, 0px)) + 14px) !important;
    right: max(0.85rem, env(safe-area-inset-right, 0px)) !important;
    z-index: 980 !important;
}

/* Active Dragging State: Instant 1:1 Response & High Z-Index */
.bhai-container.bhai-dragging {
    cursor: grabbing !important;
    transition: none !important;
    z-index: 2147483647 !important;
}

.bhai-container.bhai-dragging .bhai-btn {
    transform: scale(1.08) !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), 0 0 30px rgba(217, 70, 239, 0.7) !important;
}

.bhai-container.bhai-dragging .bhai-tooltip,
.bhai-container.bhai-dragging .bhai-minimize-btn {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Base Refined Size: Sleek 64px Circle (Refined from 88px/100px) */
.bhai-btn {
    position: relative !important;
    top: 0 !important;
    bottom: auto !important;
    left: 0 !important;
    right: auto !important;
    width: 64px;
    height: 64px;
    padding: 2.5px;
    margin: 0 !important;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    background: linear-gradient(135deg, #d946ef, #a855f7, #3b82f6, #06b6d4, #d946ef);
    background-size: 400% 400%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
    animation: rgbGradient 4s linear infinite, rgbGlow 3s ease-in-out infinite, floatInAir 4s ease-in-out infinite;
    box-sizing: border-box;
}

.bhai-btn:hover { transform: scale(1.08); }
.bhai-btn:active { transform: scale(0.95); }

.bhai-btn::before {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: #d946ef;
    border-right-color: #a855f7;
    animation: spinRing 2.2s linear infinite;
    opacity: 0.7;
    pointer-events: none;
}

.bhai-btn::after {
    content: '';
    position: absolute;
    inset: -9px;
    border-radius: 50%;
    border: 1px solid rgba(217, 70, 239, 0.35);
    animation: pulseRing 2s ease-out infinite;
    pointer-events: none;
}

/* Minimize Micro-Button */
.bhai-minimize-btn {
    position: absolute;
    top: -4px;
    left: -4px;
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    max-width: 22px !important;
    min-height: 22px !important;
    max-height: 22px !important;
    border-radius: 50% !important;
    background: rgba(18, 14, 32, 0.94);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1.5px solid rgba(217, 70, 239, 0.6);
    color: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.7);
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s ease, border-color 0.2s ease;
    z-index: 20;
    box-shadow: 0 0 10px rgba(217, 70, 239, 0.35), 0 4px 12px rgba(0, 0, 0, 0.45);
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.bhai-min-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    line-height: 1;
    font-size: 13px;
    font-weight: 700;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
}

/* Expanded 44px+ hit-target for touchscreens, mobile, tablet & stylus (Apple HIG & WCAG compliant) */
.bhai-minimize-btn::after {
    content: '';
    position: absolute;
    top: -11px;
    left: -11px;
    right: -11px;
    bottom: -11px;
    border-radius: 50%;
    pointer-events: auto;
}

.bhai-container:hover .bhai-minimize-btn {
    opacity: 1;
    transform: scale(1);
}

.bhai-minimize-btn:hover {
    background: rgba(217, 70, 239, 0.9);
    color: #ffffff;
    border-color: #ffffff;
    transform: scale(1.15);
    box-shadow: 0 0 14px rgba(217, 70, 239, 0.7), 0 4px 14px rgba(0, 0, 0, 0.5);
}

.bhai-minimize-btn:active {
    background: rgba(217, 70, 239, 0.95) !important;
    transform: scale(0.92) !important;
    box-shadow: 0 0 16px rgba(217, 70, 239, 0.8) !important;
}

/* Touchscreens, iPads, Android Tablets, and Mobile Devices:
   Permanently visible with high-contrast glowing badge so touch users can easily shrink/expand */
@media (hover: none), (pointer: coarse), (max-width: 1024px) {
    .bhai-minimize-btn {
        opacity: 0.95 !important;
        transform: scale(1) !important;
        pointer-events: auto !important;
        display: flex !important;
        top: -4px !important;
        left: -4px !important;
        width: 22px !important;
        height: 22px !important;
        min-width: 22px !important;
        max-width: 22px !important;
        min-height: 22px !important;
        max-height: 22px !important;
        box-sizing: border-box !important;
        padding: 0 !important;
        margin: 0 !important;
        font-size: 13px;
        box-shadow: 0 0 10px rgba(217, 70, 239, 0.5), 0 4px 10px rgba(0, 0, 0, 0.5);
    }
}

.bhai-touch-device .bhai-minimize-btn {
    opacity: 0.95 !important;
    transform: scale(1) !important;
    pointer-events: auto !important;
    display: flex !important;
    top: -4px !important;
    left: -4px !important;
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    max-width: 22px !important;
    min-height: 22px !important;
    max-height: 22px !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 13px;
    box-shadow: 0 0 10px rgba(217, 70, 239, 0.5), 0 4px 10px rgba(0, 0, 0, 0.5);
}

/* Compact Mode (Shrink State: 38px Mini-Orb) */
.bhai-container.bhai-compact {
    width: 38px;
    height: 38px;
}

.bhai-container.bhai-compact .bhai-btn {
    width: 38px;
    height: 38px;
    padding: 1.5px;
    animation: rgbGradient 4s linear infinite; /* Stop float in compact mode */
}

.bhai-container.bhai-compact .bhai-btn::before {
    inset: -3px;
    border-width: 1.5px;
}

.bhai-container.bhai-compact .bhai-btn::after {
    inset: -5px;
}

.bhai-container.bhai-compact .bhai-online {
    width: 10px;
    height: 10px;
    bottom: 0;
    right: 0;
    border-width: 1.5px;
}

.bhai-container.bhai-compact .bhai-unread-badge {
    min-width: 16px;
    height: 16px;
    font-size: 0.6rem;
    top: -4px;
    right: -4px;
}

.bhai-container.bhai-compact .bhai-tooltip {
    display: none !important;
}

.bhai-container.bhai-compact .bhai-minimize-btn {
    opacity: 0.85;
    transform: scale(0.85);
    top: -5px !important;
    left: -5px !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    max-width: 18px !important;
    min-height: 18px !important;
    max-height: 18px !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 11px;
}

.bhai-container.bhai-compact:hover .bhai-minimize-btn {
    opacity: 1;
    transform: scale(1);
}

@media (hover: none), (pointer: coarse), (max-width: 1024px) {
    .bhai-container.bhai-compact .bhai-minimize-btn {
        opacity: 1 !important;
        transform: scale(1) !important;
        width: 18px !important;
        height: 18px !important;
        min-width: 18px !important;
        max-width: 18px !important;
        min-height: 18px !important;
        max-height: 18px !important;
        box-sizing: border-box !important;
        padding: 0 !important;
        margin: 0 !important;
        top: -5px !important;
        left: -5px !important;
        font-size: 11px;
    }
}

.bhai-touch-device.bhai-compact .bhai-minimize-btn {
    opacity: 1 !important;
    transform: scale(1) !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    max-width: 18px !important;
    min-height: 18px !important;
    max-height: 18px !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    margin: 0 !important;
    top: -5px !important;
    left: -5px !important;
    font-size: 11px;
}

/* Docked States (Edge-Tuck Mode) */
.bhai-container.bhai-docked-right {
    opacity: 0.75;
    transform: translate3d(calc(100% - 22px), 0, 0);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
}

.bhai-container.bhai-docked-right:hover {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

.bhai-container.bhai-docked-left {
    opacity: 0.75;
    transform: translate3d(calc(-100% + 22px), 0, 0);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
}

.bhai-container.bhai-docked-left:hover {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}


.bhai-img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: cover !important;
    object-position: top center !important;
    border-radius: 50% !important;
    display: block !important;
    pointer-events: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -webkit-user-drag: none !important;
}

.bhai-online {
    position: absolute;
    bottom: 3px;
    right: 3px;
    width: 14px;
    height: 14px;
    background: #22c55e;
    border: 2px solid #d946ef;
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.8);
    animation: onlinePulse 1.5s ease-in-out infinite;
    pointer-events: none;
}

/* Unread Badge */
.bhai-unread-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 22px;
    height: 22px;
    padding: 0 5px;
    border-radius: 12px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 800;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.6);
    border: 2px solid #ffffff;
    z-index: 5;
    animation: badgePulse 2s infinite;
    pointer-events: none;
}

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

/* Tooltip */
.bhai-tooltip {
    position: absolute;
    right: 80px;
    top: 50%;
    transform: translateY(-50%) translateX(10px);
    background: rgba(18, 14, 32, 0.95);
    backdrop-filter: blur(10px);
    padding: 0.55rem 0.95rem;
    border-radius: 12px;
    border: 1px solid rgba(217, 70, 239, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 600;
    pointer-events: none;
}
.bhai-container:hover .bhai-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

/* ── Image Preview Modal ── */
.student-image-preview-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 2147483645 !important;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
}
.student-image-preview-modal.active { display: flex; }

.student-image-preview-content {
    background: linear-gradient(165deg, rgba(28, 30, 52, 0.98), rgba(18, 20, 40, 0.99));
    border: 1px solid rgba(139, 92, 246, 0.35);
    border-radius: 20px;
    max-width: 440px;
    width: 100%;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.student-image-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.student-image-preview-header h3 { margin: 0; font-size: 1rem; color: #ffffff; }

.student-image-preview-body { padding: 1.25rem; }
.student-image-preview-container {
    background: rgba(0, 0, 0, 0.35);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 220px;
}
.student-image-preview-container img { max-width: 100%; max-height: 220px; object-fit: contain; }

.student-quality-selector { margin-top: 1rem; }
.student-quality-label { font-size: 0.78rem; color: rgba(255, 255, 255, 0.65); margin-bottom: 0.4rem; }
.student-quality-options { display: flex; gap: 0.5rem; }
.student-quality-option {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.78rem;
    color: #ffffff;
}
.student-quality-option.selected {
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.18);
}
.student-quality-option input { display: none; }

.student-image-preview-footer {
    display: flex;
    gap: 0.65rem;
    padding: 0 1.25rem 1.25rem;
}
.student-image-cancel-btn {
    flex: 1;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: #ffffff;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
}
.student-image-send-btn {
    flex: 2;
    padding: 0.75rem;
    background: linear-gradient(135deg, #8b5cf6, #d946ef);
    border: none;
    border-radius: 10px;
    color: #ffffff;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.85rem;
}

/* ── GIF Picker Modal & Fullscreen Stacking (Guaranteed Above Student Chat Modal) ── */
.gif-picker-modal {
    position: fixed !important;
    inset: 0 !important;
    z-index: 2147483646 !important;
    pointer-events: none;
}
.gif-picker-modal.gif-modal-active,
.gif-modal-active {
    pointer-events: auto !important;
    opacity: 1 !important;
    visibility: visible !important;
}
.gif-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    z-index: 2147483647 !important;
}

/* ── Clear Chat Confirmation Modal & Toast (Top Stacking Priority) ── */
#clearChatConfirmModal {
    position: fixed !important;
    inset: 0 !important;
    z-index: 2147483646 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 1rem;
    box-sizing: border-box;
}

.clear-chat-confirm-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.clear-chat-confirm-box {
    position: relative;
    background: linear-gradient(145deg, #18192c, #121528);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 20px;
    padding: 2rem;
    max-width: 380px;
    width: 90%;
    text-align: center;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.7), 0 0 40px rgba(239, 68, 68, 0.2);
    z-index: 1;
    animation: clearModalSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.clear-confirm-icon {
    font-size: 3rem;
    margin-bottom: 0.85rem;
    animation: shake 0.5s ease;
}

.clear-chat-confirm-box h3 {
    color: #fff;
    margin: 0 0 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.clear-chat-confirm-box p {
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.9rem;
    margin: 0 0 1.5rem;
    line-height: 1.5;
}

.clear-confirm-buttons {
    display: flex;
    gap: 0.75rem;
}

.clear-confirm-cancel {
    flex: 1;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clear-confirm-cancel:hover {
    background: rgba(255, 255, 255, 0.18);
}

.clear-confirm-delete {
    flex: 1;
    padding: 0.8rem 1rem;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.clear-confirm-delete:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(239, 68, 68, 0.4);
}

.chat-clear-toast {
    position: fixed !important;
    bottom: 100px !important;
    left: 50% !important;
    transform: translateX(-50%) translateY(20px);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 2147483647 !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: slideUpToast 0.3s ease forwards;
    pointer-events: none;
}

@keyframes clearModalSlideUp {
    from { opacity: 0; transform: translateY(18px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Animation Keyframes ── */
@keyframes rgbGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
@keyframes rgbGlow {
    0%, 100% {
        box-shadow: 0 0 0 3px rgba(217, 70, 239, 0.4), 0 0 20px rgba(217, 70, 239, 0.6);
    }
    50% {
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.4), 0 0 20px rgba(59, 130, 246, 0.6);
    }
}
@keyframes floatInAir {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
@keyframes spinRing {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
@keyframes pulseRing {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(1.25); opacity: 0; }
}
@keyframes onlinePulse {
    0%, 100% { box-shadow: 0 0 8px rgba(34, 197, 94, 0.6); }
    50% { box-shadow: 0 0 16px rgba(34, 197, 94, 1); }
}

/* ── Mobile Responsive (Phones & Small Viewports) ── */
@media (max-width: 768px) {
    /* Full-screen in-place mobile modal */
    #studentChatModal.modal-overlay {
        padding: 0 !important;
        align-items: stretch !important;
        justify-content: stretch !important;
    }

    #studentChatModal .bhai-chat-modal {
        position: fixed !important;
        inset: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        max-height: 100% !important;
        border-radius: 0 !important;
        border: none !important;
        display: flex !important;
        flex-direction: column !important;
        padding-top: env(safe-area-inset-top) !important;
        margin: 0 !important;
        box-shadow: none !important;
        animation: none !important;
    }

    .bhai-chat-header {
        min-height: 54px !important;
        padding: 0.65rem 0.85rem !important;
        padding-left: max(0.85rem, env(safe-area-inset-left)) !important;
        padding-right: max(0.85rem, env(safe-area-inset-right)) !important;
    }

    .bhai-header-avatar { width: 38px !important; height: 38px !important; }
    .bhai-header-info h2 { font-size: 0.95rem !important; }

    .bhai-input-area {
        padding: 0.65rem 0.85rem !important;
        padding-bottom: max(0.65rem, env(safe-area-inset-bottom)) !important;
        padding-left: max(0.85rem, env(safe-area-inset-left)) !important;
        padding-right: max(0.85rem, env(safe-area-inset-right)) !important;
    }

    /* Floating Widget Mobile adjustments */
    .bhai-container {
        width: 54px !important;
        height: 54px !important;
        display: block !important;
        box-sizing: border-box !important;
    }

    .bhai-container:not(.bhai-positioned) {
        bottom: max(1.25rem, env(safe-area-inset-bottom)) !important;
        right: 1rem !important;
    }

    /* All Verticals / Ecosystem / pages with bottom tab bar: sit elevated cleanly above tab bar */
    body[data-auth-theme="learn"] .bhai-container:not(.bhai-positioned),
    body:has(.learning-native-tabbar) .bhai-container:not(.bhai-positioned),
    .learning-native-tabbar ~ .bhai-container:not(.bhai-positioned),
    body[data-auth-theme="ecosystem"] .bhai-container:not(.bhai-positioned),
    body:has(.mobile-tab-bar) .bhai-container:not(.bhai-positioned),
    .mobile-tab-bar ~ .bhai-container:not(.bhai-positioned),
    body.store-page .bhai-container:not(.bhai-positioned),
    body:has(.store-native-tabbar) .bhai-container:not(.bhai-positioned),
    .store-native-tabbar ~ .bhai-container:not(.bhai-positioned),
    body:has(nav[class*="tab-bar"]) .bhai-container:not(.bhai-positioned),
    body:has(nav[class*="tabbar"]) .bhai-container:not(.bhai-positioned),
    body:has([class*="native-tabbar"]) .bhai-container:not(.bhai-positioned) {
        bottom: calc(var(--store-native-tabbar-height, var(--learn-native-bar-height, 68px)) + max(7px, env(safe-area-inset-bottom, 0px)) + 14px) !important;
        right: max(0.85rem, env(safe-area-inset-right, 0px)) !important;
        z-index: 980 !important;
    }

    .bhai-btn {
        width: 54px !important;
        height: 54px !important;
        min-width: 54px !important;
        min-height: 54px !important;
        top: 0 !important;
        bottom: auto !important;
        left: 0 !important;
        right: auto !important;
        margin: 0 !important;
        position: relative !important;
    }

    .bhai-container.bhai-compact {
        width: 36px !important;
        height: 36px !important;
    }

    .bhai-container.bhai-compact .bhai-btn {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        min-height: 36px !important;
    }

    .bhai-online {
        width: 12px !important;
        height: 12px !important;
        border-width: 2px !important;
    }

    .bhai-minimize-btn {
        opacity: 0.95 !important;
        transform: scale(1) !important;
        width: 22px !important;
        height: 22px !important;
        min-width: 22px !important;
        max-width: 22px !important;
        min-height: 22px !important;
        max-height: 22px !important;
        box-sizing: border-box !important;
        padding: 0 !important;
        margin: 0 !important;
        top: -4px !important;
        left: -4px !important;
        display: flex !important;
        pointer-events: auto !important;
        z-index: 20 !important;
    }

    .bhai-tooltip { display: none !important; }
}

/* ============================================
   PASSWORD GATE OVERLAY — ZERO-TRUST CYBERSECURITY
   ============================================ */
.pwd-gate-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483647 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0;
    transition: opacity 0.35s ease;
    padding: 1rem;
}
.pwd-gate-overlay.active {
    opacity: 1;
}

/* Container */
.pwd-gate-container {
    position: relative;
    background: linear-gradient(145deg, rgba(26, 20, 50, 0.95), rgba(15, 12, 35, 0.98));
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 24px;
    padding: 2.5rem 2rem 2rem;
    max-width: 380px;
    width: 100%;
    text-align: center;
    overflow: hidden;
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(139, 92, 246, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.pwd-gate-overlay.active .pwd-gate-container {
    transform: scale(1) translateY(0);
}

/* Floating particles */
.pwd-gate-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}
.pwd-gate-particles span {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(139, 92, 246, 0.4);
    border-radius: 50%;
    animation: pwdParticleFloat 6s infinite ease-in-out;
}
.pwd-gate-particles span:nth-child(1) { left: 10%; top: 20%; animation-delay: 0s; }
.pwd-gate-particles span:nth-child(2) { left: 80%; top: 15%; animation-delay: 1.5s; animation-duration: 7s; }
.pwd-gate-particles span:nth-child(3) { left: 50%; top: 70%; animation-delay: 3s; animation-duration: 5s; }
.pwd-gate-particles span:nth-child(4) { left: 20%; top: 80%; animation-delay: 0.8s; animation-duration: 8s; }
.pwd-gate-particles span:nth-child(5) { left: 70%; top: 60%; animation-delay: 2s; }
.pwd-gate-particles span:nth-child(6) { left: 90%; top: 40%; animation-delay: 4s; animation-duration: 6s; }

@keyframes pwdParticleFloat {
    0%, 100% { transform: translateY(0) scale(1); opacity: 0.3; }
    50% { transform: translateY(-15px) scale(1.5); opacity: 0.7; }
}

/* Lock Icon */
.pwd-gate-lock {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.2rem;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(168, 85, 247, 0.1));
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(168, 132, 252, 0.9);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: pwdLockPulse 3s infinite ease-in-out;
}
.pwd-gate-lock svg {
    width: 28px;
    height: 28px;
}
.pwd-gate-lock.unlocked {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.3), rgba(22, 163, 74, 0.2));
    border-color: rgba(34, 197, 94, 0.5);
    color: #4ade80;
    transform: scale(1.15);
    animation: none;
    box-shadow: 0 0 30px rgba(34, 197, 94, 0.3);
}
.pwd-gate-lock.wrong {
    border-color: rgba(239, 68, 68, 0.5);
    color: #ef4444;
    animation: none;
}

@keyframes pwdLockPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.15); }
    50% { box-shadow: 0 0 20px 5px rgba(139, 92, 246, 0.1); }
}

/* Title */
.pwd-gate-title {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 0.3rem;
    letter-spacing: -0.02em;
}
.pwd-gate-subtitle {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    margin: 0 0 1.5rem;
    line-height: 1.4;
}

/* Input wrapper */
.pwd-gate-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1.5px solid rgba(139, 92, 246, 0.25);
    border-radius: 14px;
    overflow: hidden;
    transition: all 0.3s ease;
    margin-bottom: 0.5rem;
}
.pwd-gate-input-wrap:focus-within {
    border-color: rgba(139, 92, 246, 0.6);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.1);
}
.pwd-gate-input-wrap.shake {
    animation: pwdShake 0.5s ease;
    border-color: rgba(239, 68, 68, 0.5);
}
@keyframes pwdShake {
    0%, 100% { transform: translateX(0); }
    15% { transform: translateX(-8px); }
    30% { transform: translateX(8px); }
    45% { transform: translateX(-6px); }
    60% { transform: translateX(6px); }
    75% { transform: translateX(-3px); }
    90% { transform: translateX(3px); }
}

.pwd-gate-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 1rem;
    padding: 0.9rem 1rem;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    letter-spacing: 0.05em;
}
.pwd-gate-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 0;
}

/* Eye toggle */
.pwd-gate-eye {
    background: transparent;
    border: none;
    padding: 0.8rem;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.4);
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.pwd-gate-eye:hover {
    color: rgba(255, 255, 255, 0.8);
}

/* Error message */
.pwd-gate-error {
    font-size: 0.8rem;
    color: #ef4444;
    min-height: 1.2rem;
    margin: 0 0 0.8rem;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.3s ease;
}
.pwd-gate-error.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Action buttons */
.pwd-gate-actions {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.pwd-gate-btn {
    border: none;
    border-radius: 12px;
    padding: 0.85rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.pwd-gate-btn.primary {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: #fff;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}
.pwd-gate-btn.primary:hover {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4);
}
.pwd-gate-btn.primary.success {
    background: linear-gradient(135deg, #22c55e, #16a34a) !important;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.4);
    pointer-events: none;
}
.pwd-gate-btn.secondary {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.pwd-gate-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}
.pwd-gate-btn-icon {
    font-size: 1.1rem;
    transition: transform 0.3s;
}
.pwd-gate-btn.primary:hover .pwd-gate-btn-icon {
    transform: translateX(3px);
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .pwd-gate-container {
        padding: 2rem 1.5rem 1.5rem;
        border-radius: 20px;
        margin: 0 0.5rem;
    }
    .pwd-gate-lock {
        width: 56px;
        height: 56px;
    }
    .pwd-gate-lock svg {
        width: 24px;
        height: 24px;
    }
    .pwd-gate-title {
        font-size: 1.2rem;
    }
}
