/* ═══════════════════════════════════════════════════════════════════════════
   TABOO - CYBER ENCRYPTED CHAT
   Premium Dark UI with Neon Accents
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
    --bg-dark: #050508;
    --bg-surface: #0a0a0f;
    --bg-card: rgba(15, 15, 25, 0.8);
    --bg-glass: rgba(20, 20, 35, 0.6);

    --border-dim: rgba(255, 255, 255, 0.05);
    --border-light: rgba(255, 255, 255, 0.1);

    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --text-muted: rgba(255, 255, 255, 0.35);

    --accent-green: #00ff88;
    --accent-cyan: #00d4ff;
    --accent-purple: #a855f7;
    --accent-pink: #ff0080;
    --accent-red: #ff3366;

    --glow-green: 0 0 20px rgba(0, 255, 136, 0.4);
    --glow-cyan: 0 0 20px rgba(0, 212, 255, 0.4);
    --glow-purple: 0 0 20px rgba(168, 85, 247, 0.4);

    --font-display: 'Orbitron', monospace;
    --font-mono: 'JetBrains Mono', monospace;
    --font-body: 'Inter', -apple-system, sans-serif;

    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    height: 100%;
    height: 100dvh; /* Dynamic viewport height for mobile */
}

body {
    height: 100%;
    height: 100dvh;
    overflow: hidden;
    font-family: var(--font-body);
    background: var(--bg-dark);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    /* Prevent pull-to-refresh on mobile */
    overscroll-behavior: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ANIMATED CYBER BACKGROUND
   ═══════════════════════════════════════════════════════════════════════════ */

.cyber-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    background: linear-gradient(180deg, var(--bg-dark) 0%, #0a0a12 100%);
}

.grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 212, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% { transform: translateY(0); }
    100% { transform: translateY(50px); }
}

.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
    opacity: 0.3;
    animation: scanLine 4s linear infinite;
}

@keyframes scanLine {
    0% { top: -2px; }
    100% { top: 100%; }
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: orbFloat 15s ease-in-out infinite;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--accent-green) 0%, transparent 70%);
    top: -200px;
    left: -100px;
    animation-delay: 0s;
}

.orb-2 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, var(--accent-cyan) 0%, transparent 70%);
    bottom: -150px;
    right: -100px;
    animation-delay: -5s;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--accent-purple) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -10s;
    opacity: 0.2;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -30px) scale(1.1); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(20px, 10px) scale(1.05); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   APP & SCREENS
   ═══════════════════════════════════════════════════════════════════════════ */

#app {
    height: 100%;
    height: 100dvh;
    position: relative;
    display: flex;
    flex-direction: column;
}

.screen {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.4s var(--ease-out-expo);
}

.screen.active {
    display: flex;
    opacity: 1;
}

/* Login screen scrolls! */
#screenLogin {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.screen-content {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 2rem;
    padding-top: 2rem;
    padding-bottom: 3rem;
    gap: 1.5rem;
}

/* Center content on larger screens */
@media (min-height: 700px) {
    .screen-content {
        justify-content: center;
        padding-top: 2rem;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   HERO / LOGO SECTION
   ═══════════════════════════════════════════════════════════════════════════ */

.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

.logo-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-glow {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(0, 255, 136, 0.3) 0%, transparent 70%);
    filter: blur(20px);
    animation: logoGlow 3s ease-in-out infinite;
}

@keyframes logoGlow {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

.logo-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid;
    animation: ringPulse 3s ease-out infinite;
}

.ring-1 {
    width: 80%;
    height: 80%;
    border-color: rgba(0, 255, 136, 0.4);
    animation-delay: 0s;
}

.ring-2 {
    width: 100%;
    height: 100%;
    border-color: rgba(0, 212, 255, 0.3);
    animation-delay: 1s;
}

.ring-3 {
    width: 120%;
    height: 120%;
    border-color: rgba(168, 85, 247, 0.2);
    animation-delay: 2s;
}

@keyframes ringPulse {
    0% { transform: scale(0.8); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

.logo-core {
    position: relative;
    z-index: 1;
    width: 70px;
    height: 70px;
    animation: logoSpin 20s linear infinite;
}

@keyframes logoSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.logo-icon {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 10px rgba(0, 255, 136, 0.5));
}

.logo-sphere {
    width: 120%;
    height: 120%;
    object-fit: contain;
    filter: drop-shadow(0 0 30px rgba(168, 85, 247, 0.8))
            drop-shadow(0 0 60px rgba(168, 85, 247, 0.4));
    animation: spherePulse 3s ease-in-out infinite;
}

@keyframes spherePulse {
    0%, 100% {
        filter: drop-shadow(0 0 30px rgba(168, 85, 247, 0.8))
                drop-shadow(0 0 60px rgba(168, 85, 247, 0.4));
        transform: scale(1);
    }
    50% {
        filter: drop-shadow(0 0 40px rgba(168, 85, 247, 1))
                drop-shadow(0 0 80px rgba(168, 85, 247, 0.6));
        transform: scale(1.05);
    }
}

.brand-title {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: 0.3em;
    margin-left: 0.3em;
}

.glitch {
    position: relative;
    color: var(--text-primary);
    text-shadow:
        0 0 10px rgba(0, 212, 255, 0.8),
        0 0 20px rgba(0, 212, 255, 0.4);
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
}

.glitch::before {
    color: var(--accent-cyan);
    animation: glitch1 3s infinite;
}

.glitch::after {
    color: var(--accent-pink);
    animation: glitch2 3s infinite;
}

@keyframes glitch1 {
    0%, 90%, 100% { opacity: 0; transform: translate(0); }
    91% { opacity: 0.8; transform: translate(-2px, 1px); }
    93% { opacity: 0.8; transform: translate(2px, -1px); }
    95% { opacity: 0; transform: translate(0); }
}

@keyframes glitch2 {
    0%, 90%, 100% { opacity: 0; transform: translate(0); }
    92% { opacity: 0.6; transform: translate(2px, 1px); }
    94% { opacity: 0.6; transform: translate(-2px, -1px); }
    96% { opacity: 0; transform: translate(0); }
}

.brand-tagline {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 0.2em;
    color: var(--text-secondary);
    display: flex;
    gap: 0.5rem;
}

.tag-bracket {
    color: var(--accent-green);
}

.tag-text {
    color: var(--text-secondary);
}

/* ═══════════════════════════════════════════════════════════════════════════
   AUTH CARD
   ═══════════════════════════════════════════════════════════════════════════ */

.auth-card {
    width: 100%;
    max-width: 340px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    color: var(--accent-green);
}

.status-indicator {
    width: 6px;
    height: 6px;
    background: var(--accent-green);
    border-radius: 50%;
    box-shadow: var(--glow-green);
}

.status-indicator.pulse {
    animation: statusPulse 2s ease-in-out infinite;
}

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

/* ═══════════════════════════════════════════════════════════════════════════
   FORM ELEMENTS
   ═══════════════════════════════════════════════════════════════════════════ */

.form-group {
    margin-bottom: 1.25rem;
}

.input-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.label-icon {
    color: var(--accent-cyan);
    font-size: 0.8rem;
}

.input-wrapper {
    position: relative;
}

.input-wrapper input {
    width: 100%;
    padding: 1.2rem 1.25rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--text-primary);
    outline: none;
    transition: all 0.3s ease;
}

.input-wrapper input::placeholder {
    color: var(--text-muted);
}

.input-wrapper input:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.input-wrapper.large input {
    padding: 1rem 1.25rem;
    font-size: 1rem;
}

.input-border {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-green), var(--accent-cyan));
    transform: translateX(-50%);
    transition: width 0.3s var(--ease-out-expo);
}

.input-wrapper input:focus ~ .input-border {
    width: 100%;
}

/* Password Toggle Button */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    padding-right: 50px;
}

.btn-toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--text-muted);
    transition: color 0.2s ease;
    z-index: 2;
}

.btn-toggle-password:hover {
    color: var(--accent-cyan);
}

.btn-toggle-password svg {
    width: 20px;
    height: 20px;
}

.btn-toggle-password .eye-open,
.btn-toggle-password .eye-closed {
    display: block;
}

.btn-toggle-password .eye-closed.hidden,
.btn-toggle-password .eye-open.hidden {
    display: none;
}

/* Modal password wrapper */
.modal-password {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.modal-password:focus-within {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.modal-password input {
    width: 100%;
    padding: 1rem 50px 1rem 1rem;
    background: transparent;
    border: none;
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--text-primary);
    outline: none;
}

.modal-password input::placeholder {
    color: var(--text-muted);
}

.input-hint {
    display: block;
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    font-family: var(--font-mono);
}

/* Password Strength Bars - Minimal */
.password-bars {
    display: flex;
    gap: 3px;
    margin-top: 0.5rem;
    height: 6px;
}

.password-bars.hidden {
    display: none;
}

.password-bars .bar {
    width: 8px;
    height: 100%;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 1px;
    transition: background 0.15s ease;
}

/* Colors based on strength */
.password-bars.red .bar.active {
    background: #ef4444;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.5);
}

.password-bars.yellow .bar.active {
    background: #fbbf24;
    box-shadow: 0 0 6px rgba(251, 191, 36, 0.5);
}

.password-bars.cyan .bar.active {
    background: #22d3ee;
    box-shadow: 0 0 6px rgba(34, 211, 238, 0.5);
}

.password-bars.green .bar.active {
    background: #10b981;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
}

.reset-link {
    display: block;
    text-align: center;
    margin-top: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
}

.reset-link:hover {
    color: var(--accent-cyan);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    backdrop-filter: blur(20px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    transition: all 0.4s var(--ease-out-expo);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.error {
    border-color: var(--accent-red);
}

.toast.success {
    border-color: var(--accent-green);
}

.toast.warning {
    border-color: #f59e0b;
}

.toast.warning .toast-icon::before {
    content: '⚠️';
}

.toast-icon {
    font-size: 1.2rem;
}

.toast.error .toast-icon::before {
    content: '⚠️';
}

.toast.success .toast-icon::before {
    content: '✓';
    color: var(--accent-green);
}

.toast-msg {
    font-size: 0.95rem;
    color: var(--text-primary);
}

/* ═══════════════════════════════════════════════════════════════════════════
   CYBER BUTTON
   ═══════════════════════════════════════════════════════════════════════════ */

.btn-cyber {
    position: relative;
    width: 100%;
    padding: 1.3rem 1.5rem;
    background: transparent;
    border: 2px solid var(--accent-cyan);
    border-radius: 12px;
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    color: var(--accent-cyan);
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-cyber .btn-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--accent-green), var(--accent-cyan));
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.btn-cyber .btn-text {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.btn-cyber .btn-glitch {
    pointer-events: none;
    gap: 0.5rem;
}

.btn-cyber .btn-icon-left {
    width: 18px;
    height: 18px;
}

.btn-cyber .btn-icon-left svg {
    width: 100%;
    height: 100%;
}

.btn-cyber:hover {
    border-color: transparent;
    color: var(--bg-dark);
    box-shadow: var(--glow-cyan);
    transform: translateY(-2px);
}

.btn-cyber:hover .btn-bg {
    opacity: 1;
}

.btn-cyber:active {
    transform: translateY(0);
}

.btn-cyber.primary {
    border-color: var(--accent-green);
    color: var(--accent-green);
}

.btn-cyber.primary:hover {
    box-shadow: var(--glow-green);
}

.btn-cyber.accept {
    border-color: var(--accent-green);
    color: var(--accent-green);
}

.btn-cyber.danger {
    border-color: var(--accent-red);
    color: var(--accent-red);
}

.btn-cyber.danger .btn-bg {
    background: var(--accent-red);
}

.btn-cyber.danger:hover {
    color: #fff;
}

/* Ghost Button */
.btn-ghost {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-ghost:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

.btn-ghost.reject:hover {
    border-color: var(--accent-red);
    color: var(--accent-red);
}

/* Icon Buttons */
.btn-icon-glass {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-icon-glass svg {
    width: 20px;
    height: 20px;
}

.btn-icon-glass:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    box-shadow: var(--glow-cyan);
}

.btn-icon-glass.small {
    width: 38px;
    height: 38px;
}

.btn-icon-glass.small svg {
    width: 18px;
    height: 18px;
}

.btn-icon-glass.danger:hover {
    border-color: var(--accent-red);
    color: var(--accent-red);
    box-shadow: 0 0 20px rgba(255, 51, 102, 0.3);
}

/* ═══════════════════════════════════════════════════════════════════════════
   SECURITY BADGE
   ═══════════════════════════════════════════════════════════════════════════ */

.security-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: rgba(0, 255, 136, 0.05);
    border: 1px solid rgba(0, 255, 136, 0.2);
    border-radius: 50px;
}

.badge-icon {
    width: 24px;
    height: 24px;
    color: var(--accent-green);
}

.badge-icon svg {
    width: 100%;
    height: 100%;
}

.badge-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.badge-title {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--accent-green);
}

.badge-desc {
    font-size: 0.6rem;
    color: var(--text-muted);
}

/* Protocol Info */
.protocol-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text-muted);
}

.proto-item {
    padding: 0.25rem 0.5rem;
    background: var(--bg-glass);
    border-radius: 4px;
}

.proto-sep {
    color: var(--border-light);
}

/* ═══════════════════════════════════════════════════════════════════════════
   PROFILE CARD
   ═══════════════════════════════════════════════════════════════════════════ */

.profile-card {
    width: 100%;
    max-width: 360px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    overflow: hidden;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-dim);
}

.profile-avatar {
    position: relative;
    width: 48px;
    height: 48px;
}

.avatar-ring {
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-green), var(--accent-cyan));
    animation: avatarRing 3s linear infinite;
}

@keyframes avatarRing {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.avatar-icon {
    position: relative;
    width: 100%;
    height: 100%;
    background: var(--bg-surface);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-cyan);
}

.avatar-icon svg {
    width: 24px;
    height: 24px;
}

.profile-avatar.clickable {
    cursor: pointer;
}

.profile-avatar.clickable .avatar-ring,
.profile-avatar.clickable .avatar-icon,
.profile-avatar.clickable .avatar-image,
.profile-avatar.clickable .avatar-edit {
    pointer-events: none;
}

.profile-avatar.clickable:hover .avatar-edit {
    opacity: 1;
}

.avatar-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    z-index: 1;
}

.avatar-image.hidden {
    display: none;
}

.avatar-edit {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 20px;
    height: 20px;
    background: var(--accent-purple);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    z-index: 2;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

/* Peer avatar in chat header */
.peer-avatar-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.peer-avatar-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.peer-avatar-image.hidden {
    display: none;
}

.profile-info {
    flex: 1;
}

.profile-name {
    display: block;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.profile-status {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    color: var(--accent-green);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-dot.online {
    background: var(--accent-green);
    box-shadow: var(--glow-green);
}

.status-dot.offline {
    background: #6b7280;
    box-shadow: none;
}

.fingerprint-section {
    padding: 1rem 1.25rem;
    background: rgba(0, 0, 0, 0.3);
}

.fp-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.fp-icon {
    width: 14px;
    height: 14px;
    color: var(--accent-purple);
}

.fp-header span {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.15em;
    color: var(--text-muted);
}

.fp-code {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    color: var(--accent-cyan);
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
    word-break: break-all;
    line-height: 1.5;
}

.fp-code.small {
    font-size: 0.75rem;
}

.fp-hint {
    display: block;
    font-size: 0.6rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CONNECT CARD
   ═══════════════════════════════════════════════════════════════════════════ */

.connect-card {
    width: 100%;
    max-width: 360px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--accent-green);
    border-radius: 16px;
    padding: 1.25rem;
    position: relative;
}

.connect-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent-green), var(--accent-cyan));
    opacity: 0.1;
    z-index: -1;
}

.connect-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.connect-icon {
    width: 32px;
    height: 32px;
    background: rgba(0, 255, 136, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-green);
}

.connect-icon svg {
    width: 18px;
    height: 18px;
}

.connect-header h3 {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--accent-green);
}

/* ═══════════════════════════════════════════════════════════════════════════
   WAITING CARD
   ═══════════════════════════════════════════════════════════════════════════ */

.waiting-card {
    width: 100%;
    max-width: 360px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--accent-cyan);
    border-radius: 16px;
    padding: 2rem 1.5rem;
    text-align: center;
}

.waiting-card.hidden {
    display: none;
}

.waiting-animation {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
}

.pulse-ring {
    position: absolute;
    inset: 0;
    border: 2px solid var(--accent-cyan);
    border-radius: 50%;
    animation: waitingPulse 2s ease-out infinite;
}

.pulse-ring.delay-1 { animation-delay: 0.66s; }
.pulse-ring.delay-2 { animation-delay: 1.33s; }

@keyframes waitingPulse {
    0% { transform: scale(0.5); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

.waiting-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 36px;
    color: var(--accent-cyan);
}

.waiting-icon svg {
    width: 100%;
    height: 100%;
}

.waiting-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.waiting-text strong {
    color: var(--text-primary);
}

/* ═══════════════════════════════════════════════════════════════════════════
   CHAT SCREEN
   ═══════════════════════════════════════════════════════════════════════════ */

#screenChat {
    background: var(--bg-dark);
}

#screenChat.drag-over {
    position: relative;
}

#screenChat.drag-over::after {
    content: 'Rilascia per allegare';
    position: absolute;
    inset: 0;
    background: rgba(0, 212, 255, 0.1);
    border: 3px dashed var(--accent-cyan);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--accent-cyan);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-dim);
    backdrop-filter: blur(20px);
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chat-peer-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.peer-avatar-small {
    position: relative;
    width: 40px;
    height: 40px;
    background: var(--bg-surface);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-cyan);
}

.peer-avatar-small svg {
    width: 20px;
    height: 20px;
}

.avatar-pulse {
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    border: 2px solid var(--accent-green);
    animation: avatarPulse 2s ease-in-out infinite;
}

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

/* My avatar in chat header */
.my-avatar-small {
    position: relative;
    width: 36px;
    height: 36px;
    background: var(--bg-surface);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-purple);
    border: 2px solid var(--accent-purple);
    margin-left: 0.5rem;
}

.my-avatar-small .my-avatar-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.my-avatar-small .my-avatar-icon svg {
    width: 100%;
    height: 100%;
}

.my-avatar-small .my-avatar-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.my-avatar-small .my-avatar-image.hidden {
    display: none;
}

.my-avatar-small.clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.my-avatar-small.clickable:hover {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

/* Avatar wrapper for popup positioning */
.my-avatar-wrapper {
    position: relative;
}

/* Profile Info Popup */
.profile-popup {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 280px;
    background: rgba(10, 10, 20, 0.98);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow: hidden;
    animation: popupSlide 0.2s ease;
}

.profile-popup.hidden {
    display: none;
}

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

.profile-popup-header {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
    padding: 0.75rem 1rem;
}

.popup-title {
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 2px;
}

.profile-popup-body {
    padding: 0.75rem;
}

.popup-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.5rem;
    border-bottom: 1px solid var(--border-dim);
}

.popup-info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.info-value {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-primary);
    text-align: right;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.info-value.fingerprint {
    color: var(--accent-cyan);
    font-size: 0.7rem;
}

/* Panic Button - uses Aqua Metal style, only icon colors on hover */
.panic-btn.active {
    background: #1e40af !important;
    color: white;
}

.panic-btn.active svg {
    color: white !important;
}

.panic-btn .panic-icon-hide,
.panic-btn .panic-icon-show {
    width: 16px;
    height: 16px;
}

.panic-btn .hidden {
    display: none;
}

/* Messages hidden state (panic mode) */
.chat-messages.panic-mode .message-bubble {
    filter: blur(10px);
    user-select: none;
    pointer-events: none;
}

.chat-messages.panic-mode .message-media {
    filter: blur(20px);
}

.chat-messages.panic-mode::before {
    content: 'Messaggi nascosti - Clicca l\'icona occhio per mostrare';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    color: var(--text-muted);
    padding: 1rem 2rem;
    border-radius: 12px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    z-index: 100;
    border: 1px solid var(--border-light);
}

.peer-details {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.peer-name {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
}

.peer-status {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.65rem;
    color: var(--accent-green);
}

.peer-status.disconnected {
    color: var(--accent-red);
}

.peer-status.disconnected .status-dot {
    background: var(--accent-red);
}

.chat-actions {
    display: flex;
    gap: 0.5rem;
}

/* Chat Messages - Aqua Metal Inset Panel */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    /* Inset panel background */
    background:
        /* Inner shadow gradient from top */
        linear-gradient(
            180deg,
            rgba(0,0,0,0.4) 0%,
            rgba(0,0,0,0.2) 3%,
            rgba(0,0,0,0.05) 10%,
            transparent 20%
        ),
        /* Inner shadow gradient from bottom */
        linear-gradient(
            0deg,
            rgba(0,0,0,0.3) 0%,
            rgba(0,0,0,0.1) 5%,
            transparent 15%
        ),
        /* Base dark color */
        linear-gradient(
            180deg,
            #141414 0%,
            #1a1a1a 20%,
            #1c1c1c 50%,
            #1a1a1a 80%,
            #141414 100%
        );
    /* Inset shadow effect */
    box-shadow:
        inset 0 3px 8px rgba(0,0,0,0.6),
        inset 0 1px 3px rgba(0,0,0,0.8),
        inset 3px 0 8px rgba(0,0,0,0.2),
        inset -3px 0 8px rgba(0,0,0,0.2),
        inset 0 -2px 6px rgba(0,0,0,0.3);
    /* Subtle border for depth */
    border-left: 1px solid #0a0a0a;
    border-right: 1px solid #0a0a0a;
}

/* Aqua scrollbar for messages */
.chat-messages::-webkit-scrollbar {
    width: 10px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #0f0f0f;
    border-left: 1px solid #1a1a1a;
}

.chat-messages::-webkit-scrollbar-thumb {
    background:
        linear-gradient(
            180deg,
            rgba(255,255,255,0.1) 0%,
            rgba(255,255,255,0.05) 50%,
            rgba(0,0,0,0.1) 100%
        ),
        linear-gradient(180deg, #4a4a4a 0%, #333 100%);
    border-radius: 5px;
    border: 1px solid #222;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background:
        linear-gradient(180deg, #555 0%, #3a3a3a 100%);
}

.chat-banner {
    text-align: center;
    padding: 2rem 1rem;
    margin-bottom: 1rem;
}

.banner-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    color: var(--accent-green);
    opacity: 0.6;
}

.banner-icon svg {
    width: 100%;
    height: 100%;
}

.banner-title {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    color: var(--accent-green);
    margin-bottom: 0.5rem;
}

.banner-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Message Bubbles */
.message {
    max-width: 80%;
    animation: msgIn 0.3s var(--ease-out-back);
}

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

.message.sent {
    align-self: flex-end;
}

.message.received {
    align-self: flex-start;
}

/* Message Bubbles - iChat Aqua Style */
.message-bubble {
    padding: 0.5rem 0.85rem;
    border-radius: 18px;
    font-size: 0.9rem;
    line-height: 1.5;
    word-wrap: break-word;
    position: relative;
}

/* Sent messages - iChat green Aqua bubble */
.message.sent .message-bubble {
    background:
        /* Aqua gel highlight */
        linear-gradient(
            180deg,
            rgba(255,255,255,0.5) 0%,
            rgba(255,255,255,0.25) 15%,
            rgba(255,255,255,0.1) 30%,
            transparent 50%
        ),
        /* Green base gradient */
        linear-gradient(
            180deg,
            #6de26d 0%,
            #4ecc4e 20%,
            #35b535 50%,
            #2a9e2a 80%,
            #238f23 100%
        );
    color: #fff;
    text-shadow: 0 1px 1px rgba(0,80,0,0.3);
    border: 0.5px solid rgba(26,122,26,0.6);
    border-top-color: #5cd05c;
    border-bottom-right-radius: 6px;
    box-shadow:
        0 2px 4px rgba(0,0,0,0.3),
        0 4px 8px rgba(0,0,0,0.2),
        inset 0 1px 0 rgba(255,255,255,0.4);
}

/* Received messages - iChat silver/gray Aqua bubble */
.message.received .message-bubble {
    background:
        /* Aqua gel highlight */
        linear-gradient(
            180deg,
            rgba(255,255,255,0.7) 0%,
            rgba(255,255,255,0.4) 15%,
            rgba(255,255,255,0.15) 30%,
            transparent 50%
        ),
        /* Silver/gray base gradient */
        linear-gradient(
            180deg,
            #e8e8e8 0%,
            #d8d8d8 20%,
            #c4c4c4 50%,
            #b0b0b0 80%,
            #a0a0a0 100%
        );
    color: #222;
    text-shadow: 0 1px 0 rgba(255,255,255,0.5);
    border: 0.5px solid rgba(136,136,136,0.5);
    border-top-color: #ddd;
    border-bottom-left-radius: 6px;
    box-shadow:
        0 2px 4px rgba(0,0,0,0.25),
        0 4px 8px rgba(0,0,0,0.15),
        inset 0 1px 0 rgba(255,255,255,0.8);
}

.message-time {
    font-size: 0.6rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    padding: 0 0.25rem;
}

.message.sent .message-time {
    text-align: right;
}

/* Read Receipt Checkmark */
.read-receipt {
    margin-left: 6px;
    font-size: 0.85rem;
    font-weight: bold;
    opacity: 0.5;
    color: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

.read-receipt.read {
    opacity: 1;
    color: #fff;
    font-weight: bold;
    text-shadow:
        0 0 8px rgba(255, 255, 255, 1),
        0 0 15px rgba(255, 255, 255, 0.8),
        0 0 25px rgba(255, 255, 255, 0.5);
}

/* Typing Indicator */
.typing-indicator {
    padding: 0.5rem 1rem;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
}

.typing-indicator.hidden {
    display: none;
}

.typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: rgba(100, 100, 100, 0.3);
    border-radius: 18px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: #ccc;
    border-radius: 50%;
    animation: typingDot 1.4s infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot {
    0%, 60%, 100% { opacity: 0.4; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-4px); }
}

/* Chat Input - Aqua Metal Style */
.chat-input-area {
    position: relative;
    padding: 0.75rem 1rem;
    background:
        /* Brushed metal noise texture simulation */
        repeating-linear-gradient(
            90deg,
            transparent 0px,
            rgba(255,255,255,0.02) 1px,
            transparent 2px,
            rgba(0,0,0,0.03) 3px,
            transparent 4px
        ),
        /* Base dark metal gradient */
        linear-gradient(
            0deg,
            #4a4a4a 0%,
            #404040 3%,
            #383838 10%,
            #303030 50%,
            #282828 90%,
            #222222 97%,
            #1a1a1a 100%
        );
    border-top: 1px solid #1a1a1a;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.1),
        0 -1px 3px rgba(0,0,0,0.3);
}

.message-composer {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
}

#messageInput {
    flex: 1;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-light);
    border-radius: 24px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text-primary);
    resize: none;
    max-height: 120px;
    outline: none;
    transition: border-color 0.3s ease;
}

#messageInput::placeholder {
    color: var(--text-muted);
}

#messageInput:focus {
    border-color: var(--accent-cyan);
}

/* Send Button - Aqua Metal Style with green icon */
.btn-send {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    background:
        linear-gradient(
            180deg,
            rgba(255,255,255,0.25) 0%,
            rgba(255,255,255,0.1) 45%,
            rgba(255,255,255,0.0) 50%,
            rgba(0,0,0,0.1) 100%
        ),
        linear-gradient(
            180deg,
            #505050 0%,
            #454545 45%,
            #383838 55%,
            #303030 100%
        );
    border: 1px solid #222;
    border-radius: 50%;
    color: #bbb;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    box-shadow:
        0 1px 3px rgba(0,0,0,0.5),
        inset 0 1px 0 rgba(255,255,255,0.15),
        inset 0 -1px 1px rgba(0,0,0,0.2);
}

.btn-send svg {
    width: 20px;
    height: 20px;
    transition: all 0.15s ease;
}

.btn-send:hover svg {
    color: #50ff80;
    filter: drop-shadow(0 0 5px rgba(80,255,128,0.8));
}

.btn-send:active {
    transform: scale(0.95);
    box-shadow:
        inset 0 2px 4px rgba(0,0,0,0.3),
        inset 0 0 3px rgba(0,0,0,0.2);
}

/* Media buttons - Aqua Metal Style */
.btn-attach,
.btn-voice {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    background:
        linear-gradient(
            180deg,
            rgba(255,255,255,0.25) 0%,
            rgba(255,255,255,0.1) 45%,
            rgba(255,255,255,0.0) 50%,
            rgba(0,0,0,0.1) 100%
        ),
        linear-gradient(
            180deg,
            #505050 0%,
            #454545 45%,
            #383838 55%,
            #303030 100%
        );
    border: 1px solid #222;
    border-radius: 50%;
    color: #bbb;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    box-shadow:
        0 1px 3px rgba(0,0,0,0.5),
        inset 0 1px 0 rgba(255,255,255,0.15),
        inset 0 -1px 1px rgba(0,0,0,0.2);
}

.btn-attach:hover svg {
    color: #00d4ff;
    filter: drop-shadow(0 0 4px rgba(0,212,255,0.6));
}

.btn-voice:hover svg {
    color: #ff5050;
    filter: drop-shadow(0 0 4px rgba(255,80,80,0.6));
}

.btn-attach svg,
.btn-voice svg {
    width: 18px;
    height: 18px;
    transition: all 0.15s ease;
}

.btn-voice.recording {
    background: linear-gradient(180deg, #a03030, #701818) !important;
    border-color: #501010 !important;
    box-shadow: 0 0 10px rgba(255,50,50,0.5);
}

.btn-voice.recording svg {
    color: white !important;
    filter: none !important;
    animation: pulse-recording 1s infinite;
}

@keyframes pulse-recording {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Media preview */
.media-preview {
    position: relative;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    margin-bottom: 0.5rem;
}

.media-preview.hidden {
    display: none;
}

.preview-content img,
.preview-content video {
    max-width: 200px;
    max-height: 150px;
    border-radius: 8px;
    object-fit: cover;
}

.preview-content audio {
    width: 200px;
}

.file-preview {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 8px;
    min-width: 200px;
}

.file-icon {
    font-size: 1.5rem;
}

.file-name {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.file-size {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* File attachment in messages */
.file-attachment {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.85rem;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.file-attachment:hover {
    background: rgba(0, 212, 255, 0.2);
    border-color: var(--accent-cyan);
}

.file-attachment .file-icon {
    font-size: 1.3rem;
}

.file-attachment .file-name {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.file-attachment .file-download {
    font-size: 1rem;
    opacity: 0.6;
}

.file-attachment:hover .file-download {
    opacity: 1;
}

.btn-remove-media {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: var(--accent-red);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Upload Progress */
.upload-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 0 0 12px 12px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.upload-progress.hidden {
    display: none;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
    border-radius: 3px;
    transition: width 0.2s ease;
}

.progress-text {
    font-size: 0.75rem;
    color: var(--accent-cyan);
    min-width: 35px;
    text-align: right;
}

/* Recording indicator */
.recording-indicator {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 51, 102, 0.1);
    border: 1px solid var(--accent-red);
    border-radius: 12px;
    margin-bottom: 0.5rem;
}

.recording-indicator.hidden {
    display: none;
}

.recording-pulse {
    width: 12px;
    height: 12px;
    background: var(--accent-red);
    border-radius: 50%;
    animation: pulse-recording 1s infinite;
}

.recording-time {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--accent-red);
}

.btn-stop-recording {
    margin-left: auto;
    padding: 0.5rem 1rem;
    background: var(--accent-red);
    border: none;
    border-radius: 8px;
    color: white;
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    cursor: pointer;
}

/* Message media */
/* ═══════════════════════════════════════════════════════════════════════════
   VIDEO & IMAGE - APPLE-LIKE STYLE
   ═══════════════════════════════════════════════════════════════════════════ */

.message-media {
    margin-top: 0.5rem;
    max-width: 420px;
    width: 100%;
}

.message-media img {
    width: 100%;
    max-width: 420px;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

.message-media video {
    width: 100%;
    max-width: 420px;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    object-fit: contain;
    background: #000;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

.message-media audio {
    display: none;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .message-media {
        max-width: 85vw;
    }
    .message-media img,
    .message-media video {
        max-width: 85vw;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   MEDIA VIEWER FULLSCREEN MODAL
   ═══════════════════════════════════════════════════════════════════════════ */

#mediaViewer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

#mediaViewer.hidden {
    display: none;
}

#viewerContent {
    max-width: 85vw;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

#viewerContent img {
    max-width: 85vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

#viewerContent video {
    max-width: 85vw;
    max-height: 85vh;
    aspect-ratio: 16 / 9;
    object-fit: contain;
    border-radius: 12px;
    background: #000;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

/* Close hint */
#mediaViewer::after {
    content: '✕';
    position: absolute;
    top: 20px;
    right: 24px;
    font-size: 24px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: color 0.2s;
}

#mediaViewer:hover::after {
    color: #fff;
}
/* Custom Audio Player - Telegram/WhatsApp Style */
/* ═══════════════════════════════════════════════════════════════════════════
   AUDIO PLAYER - AQUA METAL STYLE
   ═══════════════════════════════════════════════════════════════════════════ */

.audio-player {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.75rem 1rem;
    min-width: 260px;
    max-width: 320px;
    
    /* Aqua Metal Background */
    background: linear-gradient(180deg, 
        rgba(200, 210, 220, 0.95) 0%,
        rgba(160, 175, 190, 0.95) 45%,
        rgba(140, 155, 170, 0.95) 55%,
        rgba(170, 185, 200, 0.95) 100%);
    
    /* Metallic border */
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-bottom-color: rgba(0, 0, 0, 0.2);
    border-right-color: rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    
    /* Glossy highlight */
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.3),
        0 1px 3px rgba(0, 0, 0, 0.2);
}

.audio-play-btn {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    
    /* Aqua Metal Button */
    background: linear-gradient(180deg,
        #e8f4fc 0%,
        #b8d4e8 30%,
        #6aace0 50%,
        #4a9ad4 70%,
        #5babdf 100%);
    border: 1px solid rgba(0, 90, 160, 0.4);
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        inset 0 -1px 2px rgba(0, 80, 140, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.25);
    color: #1a3a5c;
}

.audio-play-btn:hover {
    background: linear-gradient(180deg,
        #f0f8ff 0%,
        #c8e0f0 30%,
        #7abcec 50%,
        #5aaae4 70%,
        #6bbbef 100%);
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 -1px 2px rgba(0, 80, 140, 0.3),
        0 3px 8px rgba(0, 100, 180, 0.35);
}

.audio-play-btn:active {
    background: linear-gradient(180deg,
        #5aaae4 0%,
        #4a9ad4 30%,
        #3a8ac4 70%,
        #4a9ad4 100%);
    box-shadow: 
        inset 0 2px 4px rgba(0, 50, 100, 0.4),
        0 1px 2px rgba(0, 0, 0, 0.2);
}

.audio-play-btn svg {
    width: 20px;
    height: 20px;
    margin-left: 2px;
    filter: drop-shadow(0 1px 1px rgba(255, 255, 255, 0.5));
}

.audio-play-btn .icon-pause {
    display: none;
    margin-left: 0;
}

.audio-play-btn.playing .icon-play {
    display: none;
}

.audio-play-btn.playing .icon-pause {
    display: block;
}

.audio-waveform {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
}

.waveform-bars {
    display: flex;
    align-items: flex-end;
    gap: 2.5px;
    height: 32px;
    cursor: pointer;
    position: relative;
    padding: 4px 0;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 4px;
    padding: 4px 6px;
}

.waveform-bar {
    flex: 1;
    background: rgba(60, 80, 100, 0.35);
    border-radius: 2px;
    min-width: 3px;
    max-width: 4px;
    transition: all 0.15s ease;
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.3);
}

.waveform-bar.active {
    background: linear-gradient(180deg, #4a9ad4, #2a7ab4);
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        0 0 4px rgba(74, 154, 212, 0.5);
}

.audio-player.playing .waveform-bar.active {
    animation: waveformGlowAqua 0.8s ease-in-out infinite;
    animation-delay: calc(var(--i) * 0.04s);
}

@keyframes waveformGlowAqua {
    0%, 100% {
        opacity: 1;
        filter: brightness(1);
    }
    50% {
        opacity: 0.85;
        filter: brightness(1.2);
    }
}

.audio-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2px;
}

.audio-time {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: #1a4a6a;
    font-weight: 700;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

.audio-duration {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: rgba(40, 60, 80, 0.6);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* Sent message audio style - Green Aqua */
.message.sent .audio-player {
    background: linear-gradient(180deg, 
        rgba(180, 220, 200, 0.95) 0%,
        rgba(140, 190, 165, 0.95) 45%,
        rgba(120, 170, 145, 0.95) 55%,
        rgba(150, 200, 175, 0.95) 100%);
    border-color: rgba(255, 255, 255, 0.5);
    border-bottom-color: rgba(0, 60, 30, 0.2);
}

.message.sent .audio-play-btn {
    background: linear-gradient(180deg,
        #e0f5e8 0%,
        #a0d4b0 30%,
        #50b878 50%,
        #40a868 70%,
        #50b878 100%);
    border-color: rgba(0, 100, 50, 0.4);
    color: #1a4a2a;
}

.message.sent .audio-play-btn:hover {
    background: linear-gradient(180deg,
        #e8fff0 0%,
        #b0e4c0 30%,
        #60c888 50%,
        #50b878 70%,
        #60c888 100%);
}

.message.sent .waveform-bar.active {
    background: linear-gradient(180deg, #50b878, #308858);
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        0 0 4px rgba(80, 184, 120, 0.5);
}

.message.sent .audio-time {
    color: #1a5a3a;
}

/* Loading state */
.audio-player.loading .waveform-bar {
    animation: waveformLoading 1s ease-in-out infinite;
    animation-delay: calc(var(--i) * 0.05s);
}

@keyframes waveformLoading {
    0%, 100% { opacity: 0.3; height: 20%; }
    50% { opacity: 0.6; height: 60%; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════════════════════════════════════ */

.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 1rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal.hidden {
    display: none;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
}

.modal-card {
    position: relative;
    width: 100%;
    max-width: 360px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 1.5rem;
    margin: auto;
    animation: modalIn 0.4s var(--ease-out-back);
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-card.warning {
    border-color: var(--accent-red);
}

.modal-card.warning::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--accent-red), transparent);
    opacity: 0.1;
    z-index: -1;
}

.modal-header {
    text-align: center;
    margin-bottom: 1.25rem;
}

.modal-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-icon.incoming {
    background: rgba(0, 212, 255, 0.1);
    color: var(--accent-cyan);
}

.modal-icon.verify {
    background: rgba(0, 255, 136, 0.1);
    color: var(--accent-green);
}

.modal-icon.warning {
    background: rgba(255, 51, 102, 0.1);
    color: var(--accent-red);
}

.modal-icon.browser {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(168, 85, 247, 0.2));
    font-size: 1.5rem;
}

.modal-card.browser-warning {
    border-color: var(--accent-cyan);
}

.modal-card.browser-warning::before {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
}

.browser-msg {
    text-align: center;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.browser-info {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.browser-info strong {
    color: var(--accent-cyan);
}

/* Welcome Modal */
.modal-card.welcome {
    max-width: 420px;
    border-color: var(--accent-green);
}

.modal-card.welcome::before {
    background: linear-gradient(135deg, var(--accent-green), var(--accent-cyan));
}

.modal-icon.welcome {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(0, 212, 255, 0.2));
}

.modal-icon.welcome svg {
    stroke: var(--accent-green);
}

.welcome-intro {
    text-align: center;
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.welcome-details {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.welcome-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.welcome-item:last-child {
    border-bottom: none;
}

.welcome-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    font-weight: 500;
}

.welcome-value {
    font-size: 1.1rem;
    color: var(--accent-cyan);
    font-weight: 600;
    font-family: var(--font-display);
}

.welcome-value.fingerprint {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent-green);
    letter-spacing: 0.05em;
}

.welcome-warning {
    background: rgba(234, 179, 8, 0.1);
    border: 1px solid rgba(234, 179, 8, 0.3);
    border-radius: 10px;
    padding: 1rem;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.welcome-warning .warning-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.welcome-warning p {
    font-size: 0.8rem;
    color: rgba(234, 179, 8, 0.9);
    line-height: 1.5;
    margin: 0;
}

.welcome-warning strong {
    color: #eab308;
}

/* Returning User Modal - Cyan theme */
.modal-card.returning {
    border-color: var(--accent-cyan);
}

.modal-card.returning::before {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
}

.modal-card.returning .modal-icon {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(168, 85, 247, 0.2));
}

.modal-card.returning .modal-icon svg {
    stroke: var(--accent-cyan);
}

.welcome-warning.info {
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
}

.welcome-warning.info .warning-icon {
    font-size: 1.5rem;
}

.welcome-warning.info p {
    color: rgba(0, 212, 255, 0.9);
    margin: 0;
}

.welcome-warning.info p:first-child {
    margin-bottom: 0.5rem;
}

.welcome-warning.info strong {
    color: var(--accent-cyan);
}

/* ═══════════════════════════════════════════════════════════════════════════
   MNEMONIC DISPLAY (12 words grid)
   ═══════════════════════════════════════════════════════════════════════════ */

.mnemonic-section {
    margin: 1.5rem 0;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 12px;
    overflow: hidden;
    box-sizing: border-box;
}

.mnemonic-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.mnemonic-word {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 8px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 6px;
    font-family: var(--font-mono);
}

.mnemonic-word .word-num {
    font-size: 0.6rem;
    color: var(--text-muted);
}

.mnemonic-word .word-text {
    font-size: 0.75rem;
    color: #f59e0b;
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RECOVERY MODAL
   ═══════════════════════════════════════════════════════════════════════════ */

.modal-card.recovery {
    max-width: 540px;
    width: calc(100% - 2rem);
}

.modal-card.recovery .modal-header {
    position: relative;
}

.btn-close-modal {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s;
}

.btn-close-modal:hover {
    color: var(--text-primary);
}

.recovery-intro {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.mnemonic-input-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 1.5rem;
}

.mnemonic-input-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    transition: border-color 0.2s;
}

.mnemonic-input-wrap:focus-within {
    border-color: var(--accent-cyan);
}

.mnemonic-input-wrap span {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    min-width: 18px;
}

.mnemonic-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    outline: none;
    min-width: 0;
}

.mnemonic-input::placeholder {
    color: var(--text-muted);
}

.recovery-password {
    margin-bottom: 1rem;
}

.recovery-password label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.recovery-password input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.recovery-password input:focus {
    border-color: var(--accent-cyan);
}

.recovery-warning {
    display: flex;
    gap: 10px;
    padding: 12px;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.recovery-warning span {
    font-size: 1.2rem;
}

.modal-actions.stacked {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-ghost.danger {
    color: var(--accent-red);
}

.btn-ghost.danger:hover {
    background: rgba(255, 51, 102, 0.1);
}

.modal-icon svg {
    width: 24px;
    height: 24px;
}

.modal-header h3 {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.1em;
}

.modal-body {
    margin-bottom: 1.5rem;
}

.modal-body .form-group {
    margin-bottom: 1rem;
}

.modal-body .input-wrapper textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    resize: vertical;
    min-height: 80px;
}

.modal-body .input-wrapper textarea:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.2);
}

.modal-body .input-wrapper textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

.requester-info {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.requester-info strong {
    color: var(--text-primary);
}

.fp-display {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
}

.fp-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.fp-compare {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.fp-block {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 0.75rem 1rem;
}

.fp-block.old {
    border: 1px solid rgba(255, 51, 102, 0.3);
}

.fp-block.old .fp-code {
    color: var(--accent-red);
    text-decoration: line-through;
    opacity: 0.7;
}

.fp-block.new {
    border: 1px solid rgba(0, 255, 136, 0.3);
}

.verify-hint,
.warning-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.6;
    text-align: center;
    margin-top: 1rem;
}

.warning-text {
    color: var(--text-secondary);
    margin-top: 0;
    margin-bottom: 1rem;
}

.warning-subtext {
    font-size: 0.7rem;
    color: var(--text-muted);
    opacity: 0.8;
    text-align: center;
    margin-top: 0.5rem;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
}

.modal-actions.centered {
    justify-content: center;
}

.modal-actions.stacked {
    flex-direction: column;
}

.modal-actions .btn-cyber,
.modal-actions .btn-ghost {
    flex: 1;
}

/* Password Change Form */
.password-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.password-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.password-form label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.password-form input {
    background: rgba(0, 0, 0, 0.3);
    
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.password-form input:focus {
    outline: none;
    border-color: var(--accent-cyan);
}

.password-form input::placeholder {
    color: var(--text-muted);
}

.password-hint {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   UTILITY CLASSES
   ═══════════════════════════════════════════════════════════════════════════ */

.hidden {
    display: none !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SCROLLBAR
   ═══════════════════════════════════════════════════════════════════════════ */

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 480px) {
    .brand-title {
        font-size: 2rem;
    }

    .logo-wrapper {
        width: 100px;
        height: 100px;
    }

    .logo-core {
        width: 60px;
        height: 60px;
    }

    .screen-content {
        padding: 1.5rem;
    }

    .auth-card,
    .profile-card,
    .connect-card,
    .waiting-card {
        max-width: 100%;
    }

    .message {
        max-width: 88%;
    }
}

@media (max-height: 750px) {
    .logo-wrapper {
        width: 50px;
        height: 50px;
    }

    .logo-core {
        width: 35px;
        height: 35px;
    }

    .brand-title {
        font-size: 1.4rem;
    }

    .screen-content {
        gap: 0.5rem;
        padding: 0.75rem;
        padding-top: 0.5rem;
    }

    .auth-card {
        padding: 1rem;
    }

    .hero {
        gap: 0.25rem;
    }

    /* Hide decorative elements on small screens */
    .security-badge,
    .protocol-info,
    .tor-access,
    .brand-tagline {
        display: none;
    }

    .form-group {
        margin-bottom: 0.5rem;
    }

    .input-wrapper input {
        padding: 0.75rem 1rem;
    }

    .btn-cyber {
        padding: 0.75rem 1.5rem;
    }

    .reset-link {
        margin-top: 0.5rem;
        font-size: 0.7rem;
    }
}

/* Very small screens (iPhone SE, small Android) */
@media (max-height: 600px) {
    .logo-wrapper {
        width: 60px;
        height: 60px;
    }

    .logo-core {
        width: 40px;
        height: 40px;
    }

    .brand-title {
        font-size: 1.5rem;
    }

    .brand-tagline {
        font-size: 0.6rem;
    }

    .screen-content {
        gap: 0.75rem;
        padding: 0.75rem;
        padding-top: 1rem;
    }

    .form-group {
        margin-bottom: 0.75rem;
    }

    .input-wrapper input {
        padding: 0.9rem 1rem;
    }

    .btn-cyber {
        padding: 1rem 1.25rem;
    }

    .security-badge,
    .protocol-info {
        display: none;
    }
}

/* iOS Safe Areas & Mobile Viewport Fix */
@supports (padding: env(safe-area-inset-bottom)) {
    .chat-input-area {
        padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
    }

    .chat-header {
        padding-top: calc(0.75rem + env(safe-area-inset-top));
    }

    .screen-content {
        padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
    }

    #screenLogin .screen-content,
    #screenMain .screen-content {
        padding-top: calc(1.5rem + env(safe-area-inset-top));
    }
}

/* Mobile viewport height fix */
@supports (height: 100dvh) {
    html, body, #app {
        height: 100dvh;
    }

    .screen {
        height: 100dvh;
    }
}

/* Fallback for browsers without dvh support */
@supports not (height: 100dvh) {
    html, body, #app, .screen {
        height: -webkit-fill-available;
    }
}

/* Prevent zoom on iOS */
input, textarea {
    font-size: 16px !important;
}

@media (min-width: 481px) {
    input, textarea {
        font-size: inherit !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   SECURITY METRICS PANEL
   ═══════════════════════════════════════════════════════════════════════════ */

/* Metrics Button - Aqua Metal Style */
.btn-metrics {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background:
        linear-gradient(
            180deg,
            rgba(255,255,255,0.25) 0%,
            rgba(255,255,255,0.1) 45%,
            rgba(255,255,255,0.0) 50%,
            rgba(0,0,0,0.1) 100%
        ),
        linear-gradient(
            180deg,
            #505050 0%,
            #454545 45%,
            #383838 55%,
            #303030 100%
        );
    border: 1px solid #222;
    color: #bbb;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    box-shadow:
        0 1px 3px rgba(0,0,0,0.5),
        inset 0 1px 0 rgba(255,255,255,0.15),
        inset 0 -1px 1px rgba(0,0,0,0.2);
}

.btn-metrics:hover svg {
    color: #00d4ff;
    filter: drop-shadow(0 0 4px rgba(0,212,255,0.6));
}

.btn-metrics svg {
    width: 18px;
    height: 18px;
    transition: all 0.15s ease;
}

.metrics-dot {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 8px;
    height: 8px;
    background: var(--accent-green);
    border-radius: 50%;
    animation: metricsPulse 2s ease-in-out infinite;
}

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

.metrics-panel {
    position: absolute;
    bottom: 80px;
    left: 1rem;
    right: 1rem;
    max-height: 70vh;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    backdrop-filter: blur(20px);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
    z-index: 100;
    overflow: hidden;
    animation: slideUp 0.3s var(--ease-out-expo);
}

.metrics-panel.hidden {
    display: none;
}

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

.metrics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-dim);
    background: linear-gradient(90deg, rgba(0, 212, 255, 0.1), rgba(168, 85, 247, 0.1));
}

.metrics-header h3 {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-cyan);
    letter-spacing: 0.05em;
}

.btn-close-metrics {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 51, 102, 0.2);
    border: 1px solid var(--accent-red);
    color: var(--accent-red);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-close-metrics:hover {
    background: var(--accent-red);
    color: white;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    padding: 1rem;
    max-height: calc(70vh - 60px);
    overflow-y: auto;
}

.metric-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-dim);
    border-radius: 12px;
    padding: 0.75rem;
}

.metric-card.traffic,
.metric-card.security-events {
    grid-column: span 2;
}

.metric-label {
    font-family: var(--font-display);
    font-size: 0.6rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.metric-value {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Key Verification */
.key-icons {
    display: flex;
    gap: 0.25rem;
}

.key-icon {
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.key-verify.verified .key-icon {
    filter: hue-rotate(0deg);
}

.key-verify.mismatch .key-icon:nth-child(1) { content: "🔴"; }
.key-verify.mismatch .key-icon:nth-child(2) { content: "🟡"; }
.key-verify.mismatch .key-icon:nth-child(3) { content: "🔵"; }

.key-status {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-green);
}

.key-status.mismatch {
    color: var(--accent-red);
}

.metric-detail {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
    font-family: var(--font-mono);
}

/* Encryption */
.cipher-name {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-green);
    background: rgba(0, 255, 136, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* Security Dashboard - Terminal + Radar */
.metric-card.security-dashboard {
    grid-column: span 2;
    padding: 0.5rem;
}

.dashboard-split {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
}

/* Mac OS X Aqua Terminal */
.macos-terminal {
    flex: 2;
    min-width: 320px;
    background: linear-gradient(180deg, #c8c8c8 0%, #a8a8a8 100%);
    border-radius: 8px;
    overflow: hidden;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.terminal-titlebar {
    background: linear-gradient(180deg, #e8e8e8 0%, #d0d0d0 50%, #c0c0c0 100%);
    padding: 6px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #999;
}

.terminal-buttons {
    display: flex;
    gap: 6px;
}

.term-btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.2);
}

.term-btn.close {
    background: linear-gradient(180deg, #22d3ee 0%, #0891b2 100%);
    border: 1px solid #0e7490;
}

.term-btn.minimize {
    background: linear-gradient(180deg, #1a1a1a 0%, #000000 100%);
    border: 1px solid #333;
}

.term-btn.maximize {
    background: linear-gradient(180deg, #10b981 0%, #059669 100%);
    border: 1px solid #047857;
}

.terminal-title {
    font-size: 11px;
    font-weight: 600;
    color: #333;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
    flex: 1;
    text-align: center;
    font-family: 'Lucida Grande', sans-serif;
}

.terminal-body {
    background: #1a1a1a;
    padding: 12px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #00ff00;
    height: 280px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #444 #1a1a1a;
}

.terminal-body::-webkit-scrollbar {
    width: 6px;
}

.terminal-body::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.terminal-body::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 3px;
}

.term-line {
    white-space: nowrap;
    animation: termFadeIn 0.3s ease;
}

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

.term-prompt {
    color: #00aaff;
    margin-right: 6px;
}

.term-ok {
    color: #00ff88;
}

.term-warn {
    color: #ffcc00;
}

.term-error {
    color: #ff4444;
}

.term-info {
    color: #888;
}

.term-highlight {
    color: #00ffff;
}

/* Radar Side */
.radar-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 140px;
}

#radarCanvas {
    max-width: 160px;
    max-height: 160px;
}

.radar-legend {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    margin-top: 0.25rem;
}

.radar-score {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(90deg, var(--accent-green), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.radar-score.warning {
    background: linear-gradient(90deg, #ffbb00, var(--accent-cyan));
    -webkit-background-clip: text;
    background-clip: text;
}

.radar-score.danger {
    background: linear-gradient(90deg, var(--accent-red), #ffbb00);
    -webkit-background-clip: text;
    background-clip: text;
}

.radar-label {
    font-family: var(--font-display);
    font-size: 0.6rem;
    color: var(--text-muted);
    letter-spacing: 0.15em;
}

/* Traffic Stats */
.traffic-stats {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.traffic-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
}

.traffic-dir {
    color: var(--text-muted);
    width: 80px;
}

.traffic-row:first-child .traffic-dir {
    color: var(--accent-cyan);
}

.traffic-row:last-child .traffic-dir {
    color: var(--accent-green);
}

.traffic-count {
    font-weight: 600;
    color: var(--text-primary);
    min-width: 40px;
}

.traffic-bytes {
    color: var(--text-secondary);
    margin-left: auto;
}

.traffic-graph {
    background: var(--bg-surface);
    border-radius: 8px;
    padding: 0.5rem;
    overflow: hidden;
}

#trafficCanvas {
    width: 100%;
    height: 60px;
}

/* Latency */
.latency-value {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-green);
}

.latency-unit {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.latency-bar {
    height: 4px;
    background: var(--bg-surface);
    border-radius: 2px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.latency-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-green), var(--accent-cyan));
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 20%;
}

.latency-fill.medium {
    background: linear-gradient(90deg, var(--accent-cyan), #ffbb00);
    width: 50%;
}

.latency-fill.high {
    background: linear-gradient(90deg, #ffbb00, var(--accent-red));
    width: 80%;
}

/* Session */
.session-time {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent-purple);
}

/* Security Events */
.security-log {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.security-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    background: rgba(0, 255, 136, 0.05);
    border: 1px solid rgba(0, 255, 136, 0.2);
}

.security-item.ok .security-icon {
    color: var(--accent-green);
}

.security-item.warning {
    background: rgba(255, 187, 0, 0.1);
    border-color: rgba(255, 187, 0, 0.3);
}

.security-item.warning .security-icon {
    color: #ffbb00;
}

.security-item.error {
    background: rgba(255, 51, 102, 0.1);
    border-color: rgba(255, 51, 102, 0.3);
}

.security-item.error .security-icon {
    color: var(--accent-red);
}

.security-text {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 400px) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .metric-card.traffic,
    .metric-card.security-events {
        grid-column: span 1;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   EMOJI & GIF PICKER
   ═══════════════════════════════════════════════════════════════════════════ */

/* Emoji Button - Aqua Metal Style */
.btn-emoji {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background:
        linear-gradient(
            180deg,
            rgba(255,255,255,0.25) 0%,
            rgba(255,255,255,0.1) 45%,
            rgba(255,255,255,0.0) 50%,
            rgba(0,0,0,0.1) 100%
        ),
        linear-gradient(
            180deg,
            #505050 0%,
            #454545 45%,
            #383838 55%,
            #303030 100%
        );
    border: 1px solid #222;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    transition: all 0.15s;
    box-shadow:
        0 1px 3px rgba(0,0,0,0.5),
        inset 0 1px 0 rgba(255,255,255,0.15),
        inset 0 -1px 1px rgba(0,0,0,0.2);
}

.btn-emoji:hover {
    transform: scale(1.05);
}

.btn-emoji:hover span {
    filter: drop-shadow(0 0 4px rgba(255,200,50,0.8));
}

.btn-emoji.active {
    box-shadow:
        0 0 10px rgba(168, 85, 247, 0.4),
        inset 0 1px 0 rgba(255,255,255,0.15);
}

.emoji-picker {
    width: 340px;
    max-width: calc(100vw - 2rem);
    background: var(--bg-card);
    
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    position: fixed !important;
    bottom: 80px !important;
    right: 1rem !important;
    transform: none !important;
    z-index: 9999 !important;
}

.emoji-picker-OLD {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 340px;
    max-width: calc(100vw - 2rem);
    background: var(--bg-card);
    
    border-radius: 16px;
    margin-bottom: 0.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    z-index: 100;
}

.picker-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.picker-tab {
    flex: 1;
    padding: 0.75rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.picker-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.picker-tab.active {
    color: var(--accent-cyan);
    background: rgba(34, 211, 238, 0.1);
    border-bottom: 2px solid var(--accent-cyan);
}

.picker-content {
    height: 280px;
    overflow: hidden;
}

/* Emoji Panel */
.emoji-panel {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.emoji-categories {
    display: flex;
    padding: 0.5rem;
    gap: 0.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    overflow-x: auto;
}

.emoji-cat {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.emoji-cat:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.emoji-cat.active {
    background: var(--accent-purple);
}

.emoji-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
    padding: 0.5rem;
    overflow-y: auto;
}

.emoji-item {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    background: none;
    border: none;
}

.emoji-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.2);
}

/* Animated emojis */
.emoji-item.animated:hover {
    animation: emoji-bounce 0.5s ease;
}

@keyframes emoji-bounce {
    0%, 100% { transform: scale(1.2); }
    50% { transform: scale(1.4); }
}

.emoji-item.pulse:hover {
    animation: emoji-pulse 0.6s ease infinite;
}

@keyframes emoji-pulse {
    0%, 100% { transform: scale(1.2); }
    50% { transform: scale(1.35); }
}

.emoji-item.shake:hover {
    animation: emoji-shake 0.4s ease;
}

@keyframes emoji-shake {
    0%, 100% { transform: scale(1.2) rotate(0); }
    25% { transform: scale(1.2) rotate(-10deg); }
    75% { transform: scale(1.2) rotate(10deg); }
}

/* GIF Panel */
.gif-panel {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.gif-search {
    padding: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.gif-search input {
    width: 100%;
    padding: 0.5rem 0.85rem;
    background: rgba(0, 0, 0, 0.3);
    
    border-radius: 20px;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.gif-search input:focus {
    outline: none;
    border-color: var(--accent-cyan);
}

.gif-search input::placeholder {
    color: var(--text-muted);
}

.gif-trending,
.gif-results {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    padding: 0.5rem;
    overflow-y: auto;
}

.gif-item {
    aspect-ratio: 16/9;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
    background: rgba(255, 255, 255, 0.05);
}

.gif-item:hover {
    transform: scale(1.05);
    z-index: 1;
}

.gif-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gif-loading {
    grid-column: span 2;
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

/* Mobile responsive */
@media (max-width: 400px) {
    .emoji-picker {
    width: 340px;
    max-width: calc(100vw - 2rem);
    background: var(--bg-card);
    
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    position: fixed !important;
    bottom: 80px !important;
    right: 1rem !important;
    transform: none !important;
    z-index: 9999 !important;
}

.emoji-picker-OLD {
        width: calc(100vw - 1rem);
        left: 0;
        right: 0;
        transform: none;
        margin: 0 0.5rem 0.5rem;
    }

    .emoji-grid {
        grid-template-columns: repeat(7, 1fr);
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   THEME TOGGLE BUTTON
   ═══════════════════════════════════════════════════════════════════════════ */

/* Theme Toggle - Aqua Metal Style */
.btn-theme-toggle {
    width: 32px;
    height: 32px;
    background:
        linear-gradient(
            180deg,
            rgba(255,255,255,0.25) 0%,
            rgba(255,255,255,0.1) 45%,
            rgba(255,255,255,0.0) 50%,
            rgba(0,0,0,0.1) 100%
        ),
        linear-gradient(
            180deg,
            #505050 0%,
            #454545 45%,
            #383838 55%,
            #303030 100%
        );
    border: 1px solid #222;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.5rem;
    flex-shrink: 0;
    box-shadow:
        0 1px 3px rgba(0,0,0,0.5),
        inset 0 1px 0 rgba(255,255,255,0.15),
        inset 0 -1px 1px rgba(0,0,0,0.2);
}

.btn-theme-toggle:hover {
    transform: scale(1.05);
}

.btn-theme-toggle:hover .theme-icon {
    filter: drop-shadow(0 0 4px rgba(0,200,255,0.8));
}

.btn-theme-toggle:active {
    transform: scale(0.95);
    box-shadow:
        inset 0 2px 4px rgba(0,0,0,0.3),
        inset 0 0 3px rgba(0,0,0,0.2);
}

.btn-theme-toggle.active {
    box-shadow:
        0 0 10px rgba(0, 170, 255, 0.4),
        inset 0 1px 0 rgba(255,255,255,0.15);
}

.btn-theme-toggle .theme-icon {
    font-size: 0.9rem;
    line-height: 1;
    transition: filter 0.15s ease;
}

/* Clear Chat Button - Aqua Metal Style */
.btn-clear-chat {
    width: 32px;
    height: 32px;
    background:
        linear-gradient(
            180deg,
            rgba(255,255,255,0.25) 0%,
            rgba(255,255,255,0.1) 45%,
            rgba(255,255,255,0.0) 50%,
            rgba(0,0,0,0.1) 100%
        ),
        linear-gradient(
            180deg,
            #505050 0%,
            #454545 45%,
            #383838 55%,
            #303030 100%
        );
    border: 1px solid #222;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.5rem;
    flex-shrink: 0;
    box-shadow:
        0 1px 3px rgba(0,0,0,0.5),
        inset 0 1px 0 rgba(255,255,255,0.15),
        inset 0 -1px 1px rgba(0,0,0,0.2);
}

.btn-clear-chat svg {
    width: 16px;
    height: 16px;
    stroke: #aaa;
    transition: all 0.15s ease;
}

.btn-clear-chat:hover {
    transform: scale(1.05);
}

.btn-clear-chat:hover svg {
    stroke: #ff6b6b;
    filter: drop-shadow(0 0 4px rgba(255,107,107,0.8));
}

.btn-clear-chat:active {
    transform: scale(0.95);
    box-shadow:
        inset 0 2px 4px rgba(0,0,0,0.3),
        inset 0 0 3px rgba(0,0,0,0.2);
}

/* ═══════════════════════════════════════════════════════════════════════════
   CONTEXT MENU
   ═══════════════════════════════════════════════════════════════════════════ */

.context-menu {
    position: fixed;
    background: linear-gradient(180deg, #1a1a2e 0%, #16162a 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 0.5rem;
    min-width: 150px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.context-menu.hidden {
    display: none;
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.context-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.context-menu-item.danger:hover {
    background: rgba(255, 59, 48, 0.2);
    color: #ff3b30;
}

.ctx-icon {
    font-size: 1rem;
}

/* Edit Modal */
#editMessageModal .modal-card {
    max-width: 400px;
}

#editMessageText {
    width: 100%;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.3);
    
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    resize: none;
    font-family: inherit;
}

#editMessageText:focus {
    outline: none;
    border-color: var(--accent-cyan);
}

/* Edited indicator */
.edited-indicator {
    font-size: 0.55rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Message delete animation */
.message-deleted {
    animation: messageDelete 0.3s ease forwards;
}

@keyframes messageDelete {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.8);
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   LIQUID BLUE THEME
   ═══════════════════════════════════════════════════════════════════════════ */

body.theme-liquid-blue {
    --bg-dark: #020d1a;
    --bg-darker: #010810;
    --bg-card: rgba(0, 40, 80, 0.4);
    --border-color: rgba(0, 136, 255, 0.2);
    --border-light: rgba(0, 136, 255, 0.15);
    --accent-cyan: #00aaff;
    --accent-green: #00ccff;
    --accent-purple: #0066cc;
}

body.theme-liquid-blue::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 80%, rgba(0, 100, 200, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(0, 150, 255, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(0, 50, 100, 0.2) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* Animated Floating Spheres */
body.theme-liquid-blue .cyber-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 10% 90%, rgba(0, 150, 255, 0.6) 0%, transparent 8%),
        radial-gradient(circle at 90% 80%, rgba(0, 100, 200, 0.5) 0%, transparent 6%),
        radial-gradient(circle at 50% 70%, rgba(0, 180, 255, 0.4) 0%, transparent 10%),
        radial-gradient(circle at 20% 50%, rgba(0, 120, 220, 0.5) 0%, transparent 7%),
        radial-gradient(circle at 80% 30%, rgba(0, 160, 255, 0.4) 0%, transparent 9%),
        radial-gradient(circle at 30% 20%, rgba(0, 140, 240, 0.3) 0%, transparent 5%),
        radial-gradient(circle at 70% 60%, rgba(0, 100, 200, 0.35) 0%, transparent 8%);
    animation: liquidSpheres 20s ease-in-out infinite;
    pointer-events: none;
}

@keyframes liquidSpheres {
    0%, 100% {
        background-position:
            0% 100%,
            100% 80%,
            50% 70%,
            20% 50%,
            80% 30%,
            30% 20%,
            70% 60%;
        opacity: 0.8;
    }
    25% {
        background-position:
            10% 80%,
            85% 90%,
            45% 50%,
            25% 40%,
            75% 20%,
            35% 30%,
            65% 70%;
        opacity: 1;
    }
    50% {
        background-position:
            5% 60%,
            95% 70%,
            55% 40%,
            15% 60%,
            85% 40%,
            40% 10%,
            60% 80%;
        opacity: 0.9;
    }
    75% {
        background-position:
            15% 90%,
            80% 85%,
            40% 60%,
            30% 45%,
            70% 25%,
            25% 25%,
            75% 65%;
        opacity: 1;
    }
}

/* Rising Bubbles */
body.theme-liquid-blue .glow-orb {
    background: radial-gradient(circle, rgba(0, 180, 255, 0.8) 0%, rgba(0, 100, 200, 0.4) 40%, transparent 70%);
    animation: riseBubble 15s ease-in-out infinite;
    filter: blur(2px);
}

body.theme-liquid-blue .glow-orb.orb-1 {
    width: 80px;
    height: 80px;
    left: 10%;
    animation-delay: 0s;
    animation-duration: 12s;
}

body.theme-liquid-blue .glow-orb.orb-2 {
    width: 50px;
    height: 50px;
    left: 50%;
    animation-delay: -4s;
    animation-duration: 18s;
}

body.theme-liquid-blue .glow-orb.orb-3 {
    width: 100px;
    height: 100px;
    left: 80%;
    animation-delay: -8s;
    animation-duration: 14s;
}

@keyframes riseBubble {
    0% {
        bottom: -20%;
        opacity: 0;
        transform: translateX(0) scale(0.5);
    }
    10% {
        opacity: 0.8;
        transform: translateX(-20px) scale(0.8);
    }
    30% {
        transform: translateX(30px) scale(1);
    }
    50% {
        opacity: 1;
        transform: translateX(-15px) scale(1.1);
    }
    70% {
        transform: translateX(25px) scale(1);
    }
    90% {
        opacity: 0.6;
        transform: translateX(-10px) scale(0.9);
    }
    100% {
        bottom: 120%;
        opacity: 0;
        transform: translateX(0) scale(0.7);
    }
}

/* Theme-specific button colors */
body.theme-liquid-blue .btn-cyber {
    background: linear-gradient(135deg, #0066cc, #00aaff);
}

body.theme-liquid-blue .message.sent .message-bubble {
    background: linear-gradient(135deg, #0066cc, #00aaff);
    color: #fff;
}

body.theme-liquid-blue .auth-card {
    background: linear-gradient(180deg, rgba(0, 50, 100, 0.5) 0%, rgba(0, 30, 60, 0.6) 100%);
    border-color: rgba(0, 136, 255, 0.3);
}

body.theme-liquid-blue .chat-header {
    background: linear-gradient(180deg, rgba(0, 40, 80, 0.9) 0%, rgba(0, 20, 40, 0.8) 100%);
    border-bottom-color: rgba(0, 136, 255, 0.3);
}

body.theme-liquid-blue .chat-input-area {
    background: linear-gradient(0deg, rgba(0, 30, 60, 0.95) 0%, rgba(0, 40, 80, 0.9) 100%);
    border-top-color: rgba(0, 136, 255, 0.2);
}


/* BLUE THEME - Theme Toggle Button */
body.theme-liquid-blue .btn-theme-toggle {
    background: linear-gradient(180deg, #1a4a7a 0%, #0d3a65 50%, #082a50 100%);
    border: 1px solid rgba(0, 136, 255, 0.3);
    box-shadow: 
        0 1px 3px rgba(0,20,50,0.5),
        inset 0 1px 0 rgba(100,180,255,0.15);
}

body.theme-liquid-blue .btn-theme-toggle .theme-icon {
    color: #60a0e0;
}

body.theme-liquid-blue .btn-theme-toggle:hover {
    background: linear-gradient(180deg, #0088ff 0%, #0066cc 50%, #0055bb 100%);
    border-color: #00aaff;
    box-shadow: 
        0 0 12px rgba(0, 170, 255, 0.5),
        inset 0 1px 0 rgba(255,255,255,0.2);
}

body.theme-liquid-blue .btn-theme-toggle:hover .theme-icon {
    color: #fff;
    filter: drop-shadow(0 0 3px rgba(0,170,255,0.8));
}

body.theme-liquid-blue .btn-theme-toggle.active {
    box-shadow: 0 0 20px rgba(0, 170, 255, 0.8);
}

/* BLUE THEME - Clear Chat Button */
body.theme-liquid-blue .btn-clear-chat {
    background: linear-gradient(180deg, #1a4a7a 0%, #0d3a65 50%, #082a50 100%);
    border: 1px solid rgba(0, 136, 255, 0.3);
    box-shadow:
        0 1px 3px rgba(0,20,50,0.5),
        inset 0 1px 0 rgba(100,180,255,0.15);
}

body.theme-liquid-blue .btn-clear-chat svg {
    stroke: #60a0e0;
}

body.theme-liquid-blue .btn-clear-chat:hover {
    background: linear-gradient(180deg, #8b0000 0%, #660000 50%, #550000 100%);
    border-color: #ff4444;
    box-shadow:
        0 0 12px rgba(255, 68, 68, 0.5),
        inset 0 1px 0 rgba(255,255,255,0.2);
}

body.theme-liquid-blue .btn-clear-chat:hover svg {
    stroke: #fff;
    filter: drop-shadow(0 0 3px rgba(255,100,100,0.8));
}

/* Sidebar - Blue Theme */
body.theme-liquid-blue .sidebar {
    background-color: #0a2540 !important;
    background: linear-gradient(180deg, #0a2540 0%, #061a30 100%) !important;
    border-right-color: rgba(0, 136, 255, 0.3) !important;
}

body.theme-liquid-blue #sidebar {
    background-color: #0a2540 !important;
    background: linear-gradient(180deg, #0a2540 0%, #061a30 100%) !important;
}

body.theme-liquid-blue .sidebar-header {
    background: #0d3055 !important;
    border-bottom-color: rgba(0, 136, 255, 0.25) !important;
}

body.theme-liquid-blue .sidebar-footer {
    background: #0a2540 !important;
}

body.theme-liquid-blue .sidebar-title {
    color: #00aaff;
}

body.theme-liquid-blue .contact-item {
    border-bottom-color: rgba(0, 136, 255, 0.1);
}

body.theme-liquid-blue .contact-item:hover {
    background: rgba(0, 100, 200, 0.2);
}

body.theme-liquid-blue .contact-item.active {
    background: rgba(0, 136, 255, 0.25);
    border-left-color: #00aaff;
}

body.theme-liquid-blue /* TABOO WATERMARK */
.taboo-watermark {
    font-size: 0.5rem;
    font-weight: 500;
    letter-spacing: 0.25em;
    text-align: center;
    padding: 0.3rem 0;
    margin: auto 0 0.3rem 0;
    color: rgba(160, 170, 180, 0.5);
    transition: color 0.3s ease;
    user-select: none;
}

.taboo-watermark:hover {
    color: rgba(0, 200, 120, 0.7);
}

.btn-new-chat {
    background: linear-gradient(135deg, #0066cc, #00aaff);
}

/* Chat Messages Area - Blue Theme */
body.theme-liquid-blue .chat-messages {
    background:
        radial-gradient(ellipse at 20% 80%, rgba(0, 100, 200, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(0, 150, 255, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(0, 80, 160, 0.05) 0%, transparent 70%),
        linear-gradient(180deg, #020d1a 0%, #021525 50%, #020d1a 100%);
}

body.theme-liquid-blue .chat-banner {
    background: rgba(0, 50, 100, 0.3);
    border-color: rgba(0, 136, 255, 0.2);
}

/* Chat Sidebar (inside chat screen) - Blue Theme */
body.theme-liquid-blue .chat-sidebar {
    background: linear-gradient(180deg, #0a2540 0%, #061a30 100%) !important;
    border-right-color: rgba(0, 136, 255, 0.3) !important;
}

body.theme-liquid-blue .chat-sidebar .sidebar-header {
    background: #0d3055 !important;
    border-bottom-color: rgba(0, 136, 255, 0.25) !important;
}

body.theme-liquid-blue .chat-sidebar .sidebar-title {
    color: #00aaff;
}

body.theme-liquid-blue .active-chats-list {
    background: transparent;
}

body.theme-liquid-blue .chat-contact-item {
    border-bottom-color: rgba(0, 136, 255, 0.1);
}

body.theme-liquid-blue .chat-contact-item:hover {
    background: rgba(0, 100, 200, 0.2);
}

body.theme-liquid-blue .chat-contact-item.active {
    background: rgba(0, 136, 255, 0.25);
}

/* ═══════════════════════════════════════════════════════════════════════════
   BLUE THEME - HEADER ICONS
   ═══════════════════════════════════════════════════════════════════════════ */

body.theme-liquid-blue .chat-actions .btn-icon-glass,
body.theme-liquid-blue .chat-header-left .btn-chat-sidebar-toggle {
    background:
        linear-gradient(
            180deg,
            rgba(255,255,255,0.2) 0%,
            rgba(100,180,255,0.15) 45%,
            rgba(50,130,255,0.1) 50%,
            rgba(0,50,100,0.2) 100%
        ),
        linear-gradient(
            180deg,
            #1a4a7a 0%,
            #0d3a65 45%,
            #082a50 55%,
            #051a35 100%
        );
    border: 1px solid rgba(0, 136, 255, 0.4);
    box-shadow:
        0 1px 3px rgba(0,30,80,0.6),
        inset 0 1px 0 rgba(100,180,255,0.2),
        inset 0 -1px 1px rgba(0,20,50,0.3);
}

body.theme-liquid-blue .chat-actions .btn-icon-glass svg,
body.theme-liquid-blue .chat-header-left .btn-chat-sidebar-toggle svg {
    color: #60a0e0;
    filter: drop-shadow(0 1px 0 rgba(0,20,50,0.5));
}

body.theme-liquid-blue .chat-actions .btn-icon-glass:hover,
body.theme-liquid-blue .chat-header-left .btn-chat-sidebar-toggle:hover {
    background:
        linear-gradient(
            180deg,
            rgba(255,255,255,0.25) 0%,
            rgba(0,170,255,0.4) 45%,
            rgba(0,136,255,0.3) 50%,
            rgba(0,100,200,0.4) 100%
        ),
        linear-gradient(
            180deg,
            #0088ff 0%,
            #0066cc 45%,
            #0055bb 55%,
            #0044aa 100%
        );
    border-color: #00aaff;
    box-shadow:
        0 1px 3px rgba(0,50,150,0.6),
        0 0 15px rgba(0,170,255,0.5),
        inset 0 1px 0 rgba(255,255,255,0.25),
        inset 0 -1px 1px rgba(0,50,150,0.3);
}

body.theme-liquid-blue .chat-actions .btn-icon-glass:hover svg,
body.theme-liquid-blue .chat-header-left .btn-chat-sidebar-toggle:hover svg {
    color: #fff;
    filter: drop-shadow(0 0 4px rgba(0,170,255,0.9));
}

body.theme-liquid-blue .chat-actions .btn-icon-glass:active,
body.theme-liquid-blue .chat-header-left .btn-chat-sidebar-toggle:active {
    background:
        linear-gradient(
            180deg,
            rgba(0,50,100,0.3) 0%,
            rgba(0,100,200,0.5) 50%,
            rgba(0,80,180,0.6) 100%
        ),
        linear-gradient(180deg, #0055bb 0%, #0044aa 100%);
    box-shadow:
        inset 0 2px 4px rgba(0,20,60,0.5);
}

/* Blue theme special icon colors */
body.theme-liquid-blue .chat-actions .btn-icon-glass.call-btn:hover svg {
    color: #00ff88;
    filter: drop-shadow(0 0 5px rgba(0,255,136,0.7));
}

body.theme-liquid-blue .chat-actions .btn-icon-glass.safety-btn:hover svg {
    color: #ffcc00;
    filter: drop-shadow(0 0 5px rgba(255,204,0,0.7));
}

body.theme-liquid-blue .chat-actions .btn-icon-glass.panic-btn:hover svg {
    color: #ff66ff;
    filter: drop-shadow(0 0 5px rgba(255,102,255,0.7));
}

body.theme-liquid-blue .chat-actions .btn-icon-glass.danger:hover svg {
    color: #ff5555;
    filter: drop-shadow(0 0 5px rgba(255,85,85,0.7));
}

/* ═══════════════════════════════════════════════════════════════════════════
   BLUE THEME - BOTTOM BAR & COMPOSER
   ═══════════════════════════════════════════════════════════════════════════ */

body.theme-liquid-blue .message-composer {
    background: linear-gradient(180deg, rgba(10,40,70,0.95) 0%, rgba(5,25,50,0.98) 100%);
    border-color: rgba(0, 136, 255, 0.2);
}

body.theme-liquid-blue .btn-attach,
body.theme-liquid-blue .btn-voice,
body.theme-liquid-blue .btn-metrics,
body.theme-liquid-blue .btn-emoji {
    background: linear-gradient(180deg, #1a4a7a 0%, #0d3a65 50%, #082a50 100%);
    border: 1px solid rgba(0, 136, 255, 0.3);
    box-shadow: 
        0 1px 3px rgba(0,20,50,0.5),
        inset 0 1px 0 rgba(100,180,255,0.15);
}

body.theme-liquid-blue .btn-attach svg,
body.theme-liquid-blue .btn-voice svg,
body.theme-liquid-blue .btn-metrics svg {
    color: #60a0e0;
}

body.theme-liquid-blue .btn-attach:hover,
body.theme-liquid-blue .btn-voice:hover,
body.theme-liquid-blue .btn-metrics:hover,
body.theme-liquid-blue .btn-emoji:hover {
    background: linear-gradient(180deg, #0088ff 0%, #0066cc 50%, #0055bb 100%);
    border-color: #00aaff;
    box-shadow: 
        0 0 12px rgba(0, 170, 255, 0.5),
        inset 0 1px 0 rgba(255,255,255,0.2);
}

body.theme-liquid-blue .btn-attach:hover svg,
body.theme-liquid-blue .btn-voice:hover svg,
body.theme-liquid-blue .btn-metrics:hover svg {
    color: #fff;
    filter: drop-shadow(0 0 3px rgba(0,170,255,0.8));
}

body.theme-liquid-blue .btn-emoji:hover span {
    filter: drop-shadow(0 0 4px rgba(0,170,255,0.6));
}

body.theme-liquid-blue .btn-send {
    background: linear-gradient(135deg, #0088ff 0%, #0055cc 100%);
    border: 1px solid #00aaff;
    box-shadow: 0 0 10px rgba(0, 136, 255, 0.4);
}

body.theme-liquid-blue .btn-send:hover {
    background: linear-gradient(135deg, #00aaff 0%, #0077ee 100%);
    box-shadow: 0 0 18px rgba(0, 170, 255, 0.6);
}

body.theme-liquid-blue .btn-send svg {
    color: #fff;
}

body.theme-liquid-blue #messageInput {
    background: rgba(0, 40, 80, 0.6);
    border-color: rgba(0, 136, 255, 0.25);
    color: #e0f0ff;
}

body.theme-liquid-blue #messageInput:focus {
    border-color: rgba(0, 170, 255, 0.5);
    box-shadow: 0 0 8px rgba(0, 136, 255, 0.3);
}

body.theme-liquid-blue #messageInput::placeholder {
    color: rgba(100, 160, 220, 0.5);
}

/* BLUE THEME - WATERMARK */
body.theme-liquid-blue .taboo-watermark {
    color: rgba(0, 170, 255, 0.4);
}

body.theme-liquid-blue .taboo-watermark:hover {
    color: rgba(0, 200, 255, 0.7);
}

/* BLUE THEME - New Chat Button */
body.theme-liquid-blue .btn-new-chat {
    background: linear-gradient(135deg, #0066cc 0%, #0088ff 100%);
    border: 1px solid rgba(0, 170, 255, 0.4);
    box-shadow: 0 2px 8px rgba(0, 100, 200, 0.4);
}

body.theme-liquid-blue .btn-new-chat:hover {
    background: linear-gradient(135deg, #0088ff 0%, #00aaff 100%);
    box-shadow: 0 0 15px rgba(0, 170, 255, 0.5);
}





body.theme-liquid-blue /* ═══════════════════════════════════════════════════════════════════════════
   TABOO WATERMARK - DARK LIQUID METAL SCULPTED
   ═══════════════════════════════════════════════════════════════════════════ */

.taboo-watermark {
    font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    text-align: center;
    padding: 0.8rem 0;
    margin: auto 0 0.5rem 0;
    user-select: none;
    position: relative;
    
    /* Dark liquid metal base */
    background: linear-gradient(180deg,
        #1a1a1f 0%,
        #2d2d35 15%,
        #0f0f12 40%,
        #000000 50%,
        #0a0a0d 60%,
        #1f1f25 85%,
        #15151a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    
    /* Sculpted metal effect with multiple shadows */
    text-shadow: none;
    filter: drop-shadow(0 1px 0 rgba(60, 60, 70, 0.8))
            drop-shadow(0 2px 1px rgba(0, 0, 0, 0.9))
            drop-shadow(0 -1px 0 rgba(80, 80, 90, 0.4))
            drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6));
}

/* Inner sculpted highlight effect */
.taboo-watermark::before {
    content: "TABOO";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    
    /* Metallic highlight on top edge */
    background: linear-gradient(180deg,
        rgba(120, 120, 135, 0.9) 0%,
        rgba(80, 80, 95, 0.6) 20%,
        transparent 50%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    
    /* Offset for depth */
    text-shadow: none;
    filter: none;
    pointer-events: none;
}

/* Glossy reflection line */
.taboo-watermark::after {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 1.2rem;
    width: 60%;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(100, 100, 120, 0.3) 20%,
        rgba(140, 140, 160, 0.5) 50%,
        rgba(100, 100, 120, 0.3) 80%,
        transparent 100%);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(100, 100, 120, 0.3);
}

.btn-new-chat {
    background: linear-gradient(135deg, #0066cc, #00aaff);
}

/* ═══════════════════════════════════════════════════════════════════════════
   AUDIO CALLS - WebRTC E2E Encrypted
   ═══════════════════════════════════════════════════════════════════════════ */

/* Call Button in Chat Header - uses Aqua Metal style, only icon colors on hover */
.call-btn {
    transition: all 0.3s ease;
}

.call-btn:disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* Call Modal Styles */
.modal-card.call-modal {
    max-width: 320px;
    text-align: center;
    padding: 2rem 1.5rem;
    background: linear-gradient(180deg, rgba(15, 15, 25, 0.95) 0%, rgba(10, 10, 20, 0.98) 100%);
    border-color: var(--accent-cyan);
}

.call-avatar {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.call-avatar-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid var(--accent-cyan);
    border-radius: 50%;
    animation: callRingPulse 1.5s ease-out infinite;
}

.call-avatar-ring.pulse-ring {
    animation: callRingPulse 1.5s ease-out infinite;
}

@keyframes callRingPulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.call-avatar-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 30px rgba(0, 212, 255, 0.4);
}

.call-avatar-icon svg {
    width: 40px;
    height: 40px;
    fill: white;
}

.call-avatar-icon img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.call-info {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 2rem;
}

.call-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.call-name {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
}

.call-encrypted {
    font-size: 0.7rem;
    color: var(--accent-green);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.call-encrypted::before {
    content: '🔒';
    font-size: 0.8rem;
}

.call-actions {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.call-btn-round {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.call-btn-round svg {
    width: 28px;
    height: 28px;
}

.call-btn-round.accept {
    background: linear-gradient(135deg, #00cc66, #00ff88);
    color: white;
}

.call-btn-round.accept:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 30px rgba(0, 255, 136, 0.5);
}

.call-btn-round.accept svg {
    stroke: white;
}

.call-btn-round.reject {
    background: linear-gradient(135deg, #cc3344, #ff3366);
    color: white;
}

.call-btn-round.reject:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 30px rgba(255, 51, 102, 0.5);
}

.call-btn-round.reject svg {
    stroke: white;
}

/* Active Call Floating PiP Window (Telegram-style) */
.call-pip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    background: linear-gradient(135deg,
        rgba(12, 22, 38, 0.98) 0%,
        rgba(8, 16, 30, 0.99) 100%);
    backdrop-filter: blur(24px);
    border-radius: 24px;
    border: 1px solid rgba(0, 212, 255, 0.25);
    box-shadow:
        0 16px 48px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.08),
        0 0 40px rgba(0, 212, 255, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 300px;
    max-width: 380px;
    animation: callPipIn 0.35s var(--ease-out-back);
}

.call-pip.hidden {
    display: none;
}

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

.call-pip-header {
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}

.call-pip-header:active {
    cursor: grabbing;
}

.call-pip-avatar {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 0 16px rgba(0, 212, 255, 0.5);
    animation: pipAvatarPulse 2s ease-in-out infinite;
}

/* Calling state - orange glow */
.call-pip-avatar.calling {
    background: linear-gradient(135deg, #ff9500, #ff5e3a);
    box-shadow: 0 0 20px rgba(255, 149, 0, 0.6);
    animation: pipAvatarCalling 1.5s ease-in-out infinite;
}

@keyframes pipAvatarPulse {
    0%, 100% { box-shadow: 0 0 16px rgba(0, 212, 255, 0.5); }
    50% { box-shadow: 0 0 28px rgba(0, 212, 255, 0.7); }
}

@keyframes pipAvatarCalling {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 149, 0, 0.6);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 35px rgba(255, 149, 0, 0.8);
        transform: scale(1.05);
    }
}

.call-pip-avatar svg {
    width: 28px;
    height: 28px;
    fill: white;
}

.call-pip-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.call-pip-info {
    flex: 1;
    min-width: 0;
}

.call-pip-name {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.call-pip-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.call-pip-lock {
    font-size: 0.8rem;
}

.call-pip-timer {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 500;
    color: var(--accent-cyan);
    letter-spacing: 0.05em;
}

.call-pip-calling-text {
    font-size: 0.9rem;
    color: #ff9500;
    animation: callingTextPulse 1.5s ease-in-out infinite;
}

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

.call-pip-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
}

.call-pip-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.call-pip-btn svg {
    width: 22px;
    height: 22px;
    stroke: white;
    fill: none;
}

.call-pip-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.08);
}

.call-pip-btn:active {
    transform: scale(0.95);
}

.call-pip-btn.active {
    background: var(--accent-cyan);
    border-color: var(--accent-cyan);
}

.call-pip-btn.hangup {
    background: linear-gradient(135deg, #cc3344, #ff3366);
    border: none;
    width: 58px;
    height: 58px;
}

.call-pip-btn.hangup svg {
    width: 26px;
    height: 26px;
    fill: white;
    stroke: none;
}

.call-pip-btn.hangup:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(255, 51, 102, 0.6);
}

/* Accept call button (green) */
.call-pip-btn.accept {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    border: none;
    width: 58px;
    height: 58px;
}

.call-pip-btn.accept svg {
    width: 26px;
    height: 26px;
    fill: white;
    stroke: none;
}

.call-pip-btn.accept:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(46, 204, 113, 0.6);
}

/* Incoming call state - green glow */
.call-pip-avatar.incoming {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    box-shadow: 0 0 20px rgba(46, 204, 113, 0.6);
    animation: pipAvatarIncoming 1s ease-in-out infinite;
}

@keyframes pipAvatarIncoming {
    0%, 100% {
        box-shadow: 0 0 20px rgba(46, 204, 113, 0.6);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 35px rgba(46, 204, 113, 0.9);
        transform: scale(1.08);
    }
}

.call-pip-incoming-text {
    font-size: 0.9rem;
    color: #2ecc71;
    animation: incomingTextPulse 1s ease-in-out infinite;
}

@keyframes incomingTextPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Mobile responsive for call PiP */
@media (max-width: 480px) {
    .call-pip {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        min-width: auto;
        padding: 16px 18px;
        border-radius: 20px;
    }

    .call-pip-avatar {
        width: 48px;
        height: 48px;
    }

    .call-pip-avatar svg {
        width: 24px;
        height: 24px;
    }

    .call-pip-name {
        font-size: 1.05rem;
    }

    .call-pip-timer {
        font-size: 0.9rem;
    }

    .call-pip-btn {
        width: 44px;
        height: 44px;
    }

    .call-pip-btn svg {
        width: 20px;
        height: 20px;
    }

    .call-pip-btn.hangup,
    .call-pip-btn.accept {
        width: 52px;
        height: 52px;
    }

    .call-pip-btn.hangup svg,
    .call-pip-btn.accept svg {
        width: 24px;
        height: 24px;
    }
}

/* Ringtone visual indicator */
.call-modal .call-avatar::after {
    content: '';
    position: absolute;
    width: 120%;
    height: 120%;
    border: 2px solid var(--accent-cyan);
    border-radius: 50%;
    animation: callRingPulse 1.5s ease-out infinite 0.3s;
    opacity: 0;
}


/* ═══════════════════════════════════════════════════════════════════════════
   SIDEBAR & MULTI-CHAT LAYOUT
   ═══════════════════════════════════════════════════════════════════════════ */

/* App Layout - Flexbox container for sidebar + content */
.app-layout {
    display: flex;
    height: 100%;
    width: 100%;
    overflow: hidden;
}

/* Main Content wrapper */
.main-content {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SIDEBAR (Main Screen) - Apple Aqua Metal Style
   ═══════════════════════════════════════════════════════════════════════════ */

.sidebar {
    width: 280px;
    min-width: 280px;
    height: 100%;
    /* Brushed Metal Background */
    background:
        repeating-linear-gradient(
            90deg,
            transparent 0px,
            rgba(255,255,255,0.015) 1px,
            transparent 2px,
            rgba(0,0,0,0.02) 3px,
            transparent 4px
        ),
        linear-gradient(
            90deg,
            #3a3a3a 0%,
            #424242 2%,
            #383838 5%,
            #353535 50%,
            #323232 95%,
            #2a2a2a 98%,
            #252525 100%
        );
    /* Aqua Metal border effect */
    border-right: 1px solid #1a1a1a;
    box-shadow:
        inset -1px 0 0 rgba(255,255,255,0.05),
        2px 0 8px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s var(--ease-out-expo), width 0.3s var(--ease-out-expo);
    position: relative;
    z-index: 10;
}

.sidebar.collapsed {
    transform: translateX(-100%);
    width: 0;
    min-width: 0;
    border-right: none;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    box-shadow: none;
}

/* Sidebar Header - Aqua Metal raised bar */
.sidebar-header {
    padding: 0.75rem 1rem;
    background:
        repeating-linear-gradient(
            90deg,
            transparent 0px,
            rgba(255,255,255,0.02) 1px,
            transparent 2px,
            rgba(0,0,0,0.02) 3px,
            transparent 4px
        ),
        linear-gradient(
            180deg,
            #4a4a4a 0%,
            #404040 30%,
            #353535 70%,
            #2a2a2a 100%
        );
    border-bottom: 1px solid #1a1a1a;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.1),
        0 1px 3px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: #ccc;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    text-transform: uppercase;
}

.sidebar-icon {
    width: 18px;
    height: 18px;
    color: #999;
}

/* Sidebar Toggle Button - Aqua Metal */
.btn-sidebar-toggle {
    width: 28px;
    height: 28px;
    background:
        linear-gradient(
            180deg,
            rgba(255,255,255,0.2) 0%,
            rgba(255,255,255,0.05) 45%,
            rgba(0,0,0,0.05) 55%,
            rgba(0,0,0,0.1) 100%
        ),
        linear-gradient(180deg, #484848 0%, #383838 100%);
    border: 1px solid #222;
    border-radius: 5px;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    box-shadow:
        0 1px 2px rgba(0,0,0,0.4),
        inset 0 1px 0 rgba(255,255,255,0.1);
}

.btn-sidebar-toggle:hover {
    color: #fff;
}

.btn-sidebar-toggle:hover svg {
    filter: drop-shadow(0 0 3px rgba(0,200,255,0.6));
}

.btn-sidebar-toggle:active {
    background: linear-gradient(180deg, #383838 0%, #2a2a2a 100%);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.4);
}

.btn-sidebar-toggle svg {
    width: 14px;
    height: 14px;
    transition: all 0.15s ease;
}

/* Contacts Search - Aqua Metal Style */
.contacts-search {
    padding: 0.6rem 0.75rem;
    background:
        linear-gradient(180deg, #2a2a2a 0%, #323232 100%);
    border-bottom: 1px solid #1a1a1a;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.contacts-search input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background:
        linear-gradient(180deg, #1a1a1a 0%, #252525 100%);
    border: 1px solid #111;
    border-radius: 6px;
    color: #ddd;
    font-size: 0.8rem;
    font-family: var(--font-body);
    box-shadow:
        inset 0 1px 3px rgba(0,0,0,0.4),
        0 1px 0 rgba(255,255,255,0.05);
    transition: all 0.15s ease;
}

.contacts-search input:focus {
    outline: none;
    border-color: #3080c0;
    box-shadow:
        inset 0 1px 3px rgba(0,0,0,0.4),
        0 0 5px rgba(0,150,255,0.3);
}

.contacts-search input::placeholder {
    color: #666;
}

/* Contacts List - Aqua Metal */
.contacts-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.4rem;
    background: linear-gradient(180deg, #2d2d2d 0%, #282828 100%);
}

/* Aqua-style scrollbar */
.contacts-list::-webkit-scrollbar {
    width: 8px;
}

.contacts-list::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 4px;
}

.contacts-list::-webkit-scrollbar-thumb {
    background:
        linear-gradient(180deg, #555 0%, #3a3a3a 100%);
    border-radius: 4px;
    border: 1px solid #222;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
}

.contacts-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #666 0%, #444 100%);
}

/* No Contacts State */
.no-contacts {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-muted);
}

.no-contacts-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    opacity: 0.4;
}

.no-contacts-icon svg {
    width: 100%;
    height: 100%;
}

.no-contacts p {
    font-family: var(--font-display);
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.no-contacts span {
    font-size: 0.75rem;
    line-height: 1.4;
}

/* Contact Item - Aqua Metal Style */
.contact-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.6rem;
    margin: 2px 0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.1s ease;
    position: relative;
    border: 1px solid transparent;
}

/* Aqua hover - subtle highlight */
.contact-item:hover {
    background:
        linear-gradient(180deg, #404040 0%, #353535 100%);
    border-color: #222;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.08),
        0 1px 2px rgba(0,0,0,0.2);
}

/* Aqua active - blue selection like iTunes */
.contact-item.active {
    background:
        linear-gradient(
            180deg,
            rgba(255,255,255,0.15) 0%,
            rgba(80,150,255,0.2) 50%,
            rgba(40,100,200,0.3) 100%
        ),
        linear-gradient(180deg, #3070b0 0%, #205090 100%);
    border-color: #1a4080;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.2),
        0 1px 3px rgba(0,50,150,0.4),
        0 0 8px rgba(0,100,255,0.2);
}

.contact-item.active .contact-name {
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.contact-item.active .contact-last-msg {
    color: rgba(255,255,255,0.8);
}

/* Unread - subtle green glow */
.contact-item.has-unread {
    background: linear-gradient(180deg, #2a3a2a 0%, #253525 100%);
    border-color: #1a2a1a;
}

.contact-item.has-unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: #50ff80;
    border-radius: 0 2px 2px 0;
    box-shadow: 0 0 6px rgba(80,255,128,0.5);
}

/* Contact Avatar - Aqua Metal */
.contact-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background:
        linear-gradient(
            180deg,
            rgba(255,255,255,0.2) 0%,
            rgba(255,255,255,0.05) 50%,
            rgba(0,0,0,0.1) 100%
        ),
        linear-gradient(180deg, #505050 0%, #353535 100%);
    border: 1px solid #222;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
    box-shadow:
        0 1px 3px rgba(0,0,0,0.4),
        inset 0 1px 0 rgba(255,255,255,0.15);
}

.contact-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.contact-avatar svg {
    width: 20px;
    height: 20px;
    color: #999;
}

.contact-status-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #888;
    border: 2px solid var(--bg-card);
}

.contact-status-dot.online {
    background: var(--accent-green);
    box-shadow: 0 0 6px var(--accent-green);
}

.contact-info {
    flex: 1;
    min-width: 0;
}

.contact-name {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contact-last-msg {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contact-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.contact-time {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.contact-unread {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--accent-green);
    border-radius: 9px;
    font-size: 0.65rem;
    font-weight: 600;
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Contact Delete Button */
.contact-delete {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border: none;
    background: rgba(255, 51, 102, 0.2);
    border-radius: 6px;
    color: var(--accent-red);
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-item:hover .contact-delete {
    opacity: 1;
}

.contact-delete:hover {
    background: var(--accent-red);
    color: white;
}

.contact-delete svg {
    width: 14px;
    height: 14px;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-dim);
    background: rgba(0, 0, 0, 0.2);
}

.active-chats-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.badge-number {
    background: var(--accent-cyan);
    color: #000;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

/* Mobile Sidebar Open Button */
.btn-sidebar-open {
    position: fixed;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border: none;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 50%;
    color: var(--accent-cyan);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    transition: all 0.2s ease;
}

.btn-sidebar-open:hover {
    transform: translateY(-50%) scale(1.05);
    box-shadow: var(--glow-cyan);
}

.btn-sidebar-open svg {
    width: 24px;
    height: 24px;
}

.unread-total {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: var(--accent-green);
    border-radius: 9px;
    font-size: 0.65rem;
    font-weight: 700;
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CHAT SCREEN LAYOUT (with sidebar drawer)
   ═══════════════════════════════════════════════════════════════════════════ */

.chat-layout {
    display: flex;
    height: 100%;
    width: 100%;
    overflow: hidden;
    position: relative;
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
}

/* Chat Sidebar - Aqua Metal Style */
.chat-sidebar {
    width: 280px;
    min-width: 280px;
    height: 100%;
    /* Brushed Metal Background */
    background:
        repeating-linear-gradient(
            90deg,
            transparent 0px,
            rgba(255,255,255,0.015) 1px,
            transparent 2px,
            rgba(0,0,0,0.02) 3px,
            transparent 4px
        ),
        linear-gradient(
            90deg,
            #3a3a3a 0%,
            #424242 2%,
            #383838 5%,
            #353535 50%,
            #323232 95%,
            #2a2a2a 98%,
            #252525 100%
        );
    border-right: 1px solid #1a1a1a;
    box-shadow:
        inset -1px 0 0 rgba(255,255,255,0.05),
        2px 0 8px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    z-index: 10;
    transition: width 0.3s var(--ease-out-expo), min-width 0.3s var(--ease-out-expo), opacity 0.3s var(--ease-out-expo);
    position: relative;
}

/* Collapsed state - hides sidebar, content takes full width */
.chat-sidebar.collapsed {
    width: 0;
    min-width: 0;
    border-right: none;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    box-shadow: none;
}

/* Active Chats List - Aqua Metal */
.active-chats-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.4rem;
    background: linear-gradient(180deg, #2d2d2d 0%, #282828 100%);
}

/* Aqua scrollbar for active chats */
.active-chats-list::-webkit-scrollbar {
    width: 8px;
}

.active-chats-list::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 4px;
}

.active-chats-list::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #555 0%, #3a3a3a 100%);
    border-radius: 4px;
    border: 1px solid #222;
}

.active-chat-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.1s ease;
    position: relative;
    margin: 2px 0;
    border: 1px solid transparent;
}

/* Aqua hover */
.active-chat-item:hover {
    background: linear-gradient(180deg, #404040 0%, #353535 100%);
    border-color: #222;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.08),
        0 1px 2px rgba(0,0,0,0.2);
}

/* Selected item - Aqua blue selection */
.active-chat-item.current {
    background:
        linear-gradient(
            180deg,
            rgba(255,255,255,0.15) 0%,
            rgba(80,150,255,0.2) 50%,
            rgba(40,100,200,0.3) 100%
        ),
        linear-gradient(180deg, #3070b0 0%, #205090 100%);
    border-color: #1a4080;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.2),
        0 1px 3px rgba(0,50,150,0.4),
        0 0 8px rgba(0,100,255,0.2);
}

.active-chat-item.current:hover {
    background:
        linear-gradient(
            180deg,
            rgba(255,255,255,0.2) 0%,
            rgba(80,150,255,0.25) 50%,
            rgba(40,100,200,0.35) 100%
        ),
        linear-gradient(180deg, #3580c0 0%, #2560a0 100%);
}

.active-chat-item .contact-avatar {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
}

.active-chat-item .contact-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.active-chat-item .contact-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.active-chat-item .contact-last-msg {
    font-size: 0.8rem;
    color: #8b9ba5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.active-chat-item.current .contact-last-msg {
    color: rgba(255, 255, 255, 0.7);
}

.active-chat-item .contact-unread {
    min-width: 18px;
    height: 18px;
    font-size: 0.65rem;
    background: #3390ec;
    color: #fff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Delete chat button */
.chat-delete-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.active-chat-item {
    position: relative;
}

.active-chat-item:hover .chat-delete-btn {
    opacity: 1;
}

.chat-delete-btn:hover {
    background: rgba(255, 100, 100, 0.2);
    color: #ff6b6b;
}

.active-chat-item:hover .contact-unread {
    display: none;
}

/* Chat sidebar header - Aqua Metal Style */
.chat-sidebar .sidebar-header {
    background:
        repeating-linear-gradient(
            90deg,
            transparent 0px,
            rgba(255,255,255,0.02) 1px,
            transparent 2px,
            rgba(0,0,0,0.02) 3px,
            transparent 4px
        ),
        linear-gradient(180deg, #4a4a4a 0%, #353535 100%);
    border-bottom: 1px solid #1a1a1a;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.1),
        0 1px 3px rgba(0,0,0,0.3);
    padding: 0.75rem 1rem;
}

.chat-sidebar .sidebar-title {
    color: #ccc;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    font-size: 0.7rem;
}

/* New Chat Button - Telegram style */
/* ═══════════════════════════════════════════════════════════════════════════
   TABOO WATERMARK - DARK LIQUID METAL SCULPTED
   ═══════════════════════════════════════════════════════════════════════════ */

.taboo-watermark {
    font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    text-align: center;
    padding: 0.8rem 0;
    margin: auto 0 0.5rem 0;
    user-select: none;
    position: relative;
    
    /* Dark liquid metal base */
    background: linear-gradient(180deg,
        #1a1a1f 0%,
        #2d2d35 15%,
        #0f0f12 40%,
        #000000 50%,
        #0a0a0d 60%,
        #1f1f25 85%,
        #15151a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    
    /* Sculpted metal effect with multiple shadows */
    text-shadow: none;
    filter: drop-shadow(0 1px 0 rgba(60, 60, 70, 0.8))
            drop-shadow(0 2px 1px rgba(0, 0, 0, 0.9))
            drop-shadow(0 -1px 0 rgba(80, 80, 90, 0.4))
            drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6));
}

/* Inner sculpted highlight effect */
.taboo-watermark::before {
    content: "TABOO";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    
    /* Metallic highlight on top edge */
    background: linear-gradient(180deg,
        rgba(120, 120, 135, 0.9) 0%,
        rgba(80, 80, 95, 0.6) 20%,
        transparent 50%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    
    /* Offset for depth */
    text-shadow: none;
    filter: none;
    pointer-events: none;
}

/* Glossy reflection line */
.taboo-watermark::after {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 1.2rem;
    width: 60%;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(100, 100, 120, 0.3) 20%,
        rgba(140, 140, 160, 0.5) 50%,
        rgba(100, 100, 120, 0.3) 80%,
        transparent 100%);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(100, 100, 120, 0.3);
}

.btn-new-chat {
    margin: 0.75rem;
    padding: 0.75rem;
    background: #3390ec;
    border: none;
    border-radius: 8px;
    color: white;
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.btn-new-chat:hover {
    background: #4a9ff0;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(51, 144, 236, 0.4);
}

.btn-new-chat svg {
    width: 16px;
    height: 16px;
}

/* Chat Sidebar Toggle Button (in header) */
.btn-chat-sidebar-toggle {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
    margin-right: 0.5rem;
}

.btn-chat-sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-cyan);
}

.btn-chat-sidebar-toggle svg {
    width: 18px;
    height: 18px;
}

.chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: var(--accent-green);
    border-radius: 8px;
    font-size: 0.6rem;
    font-weight: 700;
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Chat Sidebar Backdrop */
.chat-sidebar-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 199;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.chat-sidebar-backdrop.visible {
    opacity: 1;
    pointer-events: auto;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SIDEBAR RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .sidebar {
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 200;
        box-shadow: 4px 0 30px rgba(0, 0, 0, 0.5);
    }

    .sidebar.collapsed {
        transform: translateX(-100%);
    }

    .btn-sidebar-open {
        display: flex;
    }

    .main-content {
        width: 100%;
    }

    /* Show sidebar backdrop on mobile */
    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 199;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .sidebar-backdrop.visible {
        opacity: 1;
        pointer-events: auto;
    }
}

@media (min-width: 769px) {
    .btn-sidebar-open {
        display: none;
    }

    .btn-sidebar-open.visible {
        display: flex !important;
    }

    .sidebar {
        position: relative;
    }
}

/* Chat Sidebar Mobile - overlay mode */
@media (max-width: 768px) {
    .chat-sidebar {
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 200;
        box-shadow: 4px 0 30px rgba(0, 0, 0, 0.5);
        transform: translateX(0);
    }

    .chat-sidebar.collapsed {
        transform: translateX(-100%);
        width: 280px;
        min-width: 280px;
    }

    .chat-main {
        width: 100%;
    }

    /* Sidebar backdrop for mobile */
    .chat-sidebar-backdrop {
        display: block;
    }
}

/* Chat Sidebar Desktop - visible by default, shifts content */
@media (min-width: 769px) {
    .chat-sidebar {
        position: relative;
    }

    .chat-sidebar-backdrop {
        display: none !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   SETTINGS MODAL
   ═══════════════════════════════════════════════════════════════════════════ */

.modal-card.settings-modal {
    max-width: 480px;
    max-height: 85vh;
    overflow: hidden;
}

.settings-body {
    max-height: 60vh;
    overflow-y: auto;
    padding: 0 1.5rem 1rem !important;
}

.settings-body::-webkit-scrollbar {
    width: 6px;
}

.settings-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.settings-body::-webkit-scrollbar-thumb {
    background: rgba(0, 212, 255, 0.3);
    border-radius: 3px;
}

.settings-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-dim);
}

.settings-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.settings-section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
}

.section-icon {
    font-size: 1.2rem;
}

.section-title {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-cyan);
    letter-spacing: 1px;
}

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

.settings-item:last-child {
    margin-bottom: 0;
}

.settings-item label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.settings-item.toggle-item {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.settings-item.info-item {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.info-value {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-cyan);
    background: rgba(0, 212, 255, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* Settings Select */
.settings-select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2300d4ff' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.settings-select:hover {
    border-color: var(--accent-cyan);
}

.settings-select:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.2);
}

.settings-select option {
    background: #1a1a2e;
    color: var(--text-primary);
    padding: 0.5rem;
}

/* Volume Control */
.volume-control {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.volume-slider {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--accent-cyan);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
    transition: all 0.2s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.7);
}

.volume-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--accent-cyan);
    border-radius: 50%;
    border: none;
    cursor: pointer;
}

.volume-value {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent-cyan);
    min-width: 45px;
    text-align: right;
}

/* Mic Test */
.mic-test-container {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.btn-mic-test {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.85rem;
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid var(--accent-green);
    border-radius: 8px;
    color: var(--accent-green);
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-mic-test:hover {
    background: rgba(0, 255, 136, 0.2);
    transform: translateY(-1px);
}

.btn-mic-test.active {
    background: var(--accent-green);
    color: #000;
    animation: pulse-mic 1s infinite;
}

@keyframes pulse-mic {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.5); }
    50% { box-shadow: 0 0 0 8px rgba(0, 255, 136, 0); }
}

.mic-level-container {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.mic-level-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-green), var(--accent-cyan));
    border-radius: 4px;
    transition: width 0.1s ease;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 52px;
    height: 28px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-light);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-switch[data-enabled="true"] {
    background: rgba(0, 255, 136, 0.2);
    border-color: var(--accent-green);
}

.toggle-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.toggle-switch[data-enabled="true"] .toggle-slider {
    left: 27px;
    background: var(--accent-green);
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

/* E2E Badge */
.e2e-badge {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(0, 255, 136, 0.05);
    border: 1px solid rgba(0, 255, 136, 0.2);
    border-radius: 12px;
    margin-top: 1rem;
}

.e2e-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.e2e-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.e2e-text strong {
    font-size: 0.85rem;
    color: var(--accent-green);
}

.e2e-text span {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Modal Icon Settings */
.modal-icon.settings {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(168, 85, 247, 0.2));
    color: var(--accent-cyan);
}

/* Settings Modal Close Button */
.settings-modal .btn-close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.settings-modal .btn-close-modal:hover {
    background: rgba(255, 51, 102, 0.2);
    border-color: var(--accent-red);
    color: var(--accent-red);
}

/* Responsive */
@media (max-width: 480px) {
    .modal-card.settings-modal {
        max-width: 95%;
        margin: 1rem;
    }

    .settings-body {
        padding: 0 1rem 1rem !important;
    }

    .mic-test-container {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-mic-test {
        justify-content: center;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   TOR ACCESS BUTTON & MODAL
   ═══════════════════════════════════════════════════════════════════════════ */

.tor-access {
    margin: 0.75rem 0;
    text-align: center;
}

.tor-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.6rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-display);
    font-size: 0.65rem;
    font-weight: 400;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: color 0.2s ease;
    opacity: 0.6;
}

.tor-btn:hover {
    color: #a78bfa;
    opacity: 1;
}

.tor-icon {
    font-size: 0.75rem;
    opacity: 0.7;
}

/* Tor Modal */
.modal-card.tor-modal {
    max-width: 500px;
}

.modal-icon.tor {
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.2), rgba(168, 85, 247, 0.2));
    color: #a78bfa;
}

.modal-icon.tor span {
    font-size: 1.5rem;
}

.tor-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    text-align: center;
    margin-bottom: 1.5rem;
}

.tor-address-box {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.tor-address {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: #a78bfa;
    word-break: break-all;
    line-height: 1.6;
    user-select: all;
    display: block;
    text-align: center;
}

.btn-cyber.tor-copy {
    width: 100%;
    margin-bottom: 1rem;
}

.btn-cyber.tor-copy .btn-bg {
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.3), rgba(168, 85, 247, 0.3));
}

.btn-cyber.tor-copy:hover .btn-bg {
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.5), rgba(168, 85, 247, 0.5));
}

.btn-cyber.tor-copy.copied .btn-bg {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.3), rgba(0, 212, 255, 0.3));
}

.btn-cyber.tor-copy.copied .btn-text {
    color: var(--accent-green);
}

.tor-note {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
}

.tor-note a {
    color: #a78bfa;
    text-decoration: none;
    transition: color 0.2s ease;
}

.tor-note a:hover {
    color: #c4b5fd;
    text-decoration: underline;
}

/* Tor Modal Close Button */
.tor-modal .btn-close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tor-modal .btn-close-modal:hover {
    background: rgba(255, 51, 102, 0.2);
    border-color: var(--accent-red);
    color: var(--accent-red);
}

/* ═══════════════════════════════════════════════════════════════════════════
   SAFETY TOOLS MODAL - Beacon, Dead Drop, Trusted Silence
   ═══════════════════════════════════════════════════════════════════════════ */

.safety-modal .modal-content {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: 85vh;
    overflow-y: auto;
    margin: auto;
    background: linear-gradient(165deg, rgba(20, 25, 35, 0.98) 0%, rgba(10, 15, 25, 0.99) 100%);
    border: 1px solid rgba(100, 150, 200, 0.15);
    border-radius: 16px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6), 0 0 60px rgba(50, 100, 150, 0.1);
    animation: modalIn 0.4s var(--ease-out-back);
}

.safety-modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(100, 150, 200, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.safety-modal .modal-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #e2e8f0;
}

.safety-modal .modal-title svg {
    width: 24px;
    height: 24px;
    color: #6ee7b7;
}

.safety-modal .btn-close-modal {
    position: static;
    transform: none;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    
    border-radius: 8px;
    color: #94a3b8;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.safety-modal .btn-close-modal:hover {
    background: rgba(255, 100, 100, 0.15);
    border-color: rgba(255, 100, 100, 0.3);
    color: #f87171;
}

.safety-modal .modal-body {
    padding: 1rem 1.5rem 1.5rem;
}

/* Safety Feature Card */
.safety-feature {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    margin-bottom: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.safety-feature:last-child {
    margin-bottom: 0;
}

.safety-feature:hover {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
}

.safety-feature.beacon { --feature-color: #10b981; --feature-glow: rgba(16, 185, 129, 0.15); }
.safety-feature.deaddrop { --feature-color: #f59e0b; --feature-glow: rgba(245, 158, 11, 0.15); }
.safety-feature.silence { --feature-color: #8b5cf6; --feature-glow: rgba(139, 92, 246, 0.15); }
.safety-feature.geobeacon { --feature-color: #3b82f6; --feature-glow: rgba(59, 130, 246, 0.15); }

.safety-feature.active {
    border-color: var(--feature-color);
    box-shadow: 0 0 30px var(--feature-glow);
}

/* Expanded state - show feature content */
.safety-feature.expanded .feature-config {
    display: block;
}

.safety-feature.expanded .feature-info {
    display: block;
}

/* Feature Header */
.feature-header {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    cursor: pointer;
    user-select: none;
}

.feature-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--feature-glow);
    border-radius: 10px;
    margin-right: 1rem;
    flex-shrink: 0;
}

.feature-icon svg {
    width: 22px;
    height: 22px;
    color: var(--feature-color);
}

.feature-title-group {
    flex: 1;
    min-width: 0;
}

.feature-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 0.15rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.feature-subtitle {
    font-size: 0.72rem;
    color: #64748b;
    letter-spacing: 0.02em;
}

/* Info Button */
.btn-info {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(100, 116, 139, 0.2);
    border: none;
    border-radius: 50%;
    color: #64748b;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-info:hover {
    background: rgba(100, 200, 255, 0.2);
    color: #7dd3fc;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 48px;
    height: 26px;
    background: rgba(100, 116, 139, 0.3);
    border-radius: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-left: 1rem;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: #94a3b8;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.toggle-switch.active {
    background: var(--feature-color);
}

.toggle-switch.active::after {
    left: 25px;
    background: white;
}

/* Info Panel */
.feature-info {
    display: none;
    padding: 0 1.25rem 1rem;
}

.feature-info.visible {
    display: block;
}

.info-panel {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(100, 150, 200, 0.1);
    border-radius: 8px;
    padding: 1rem;
}

.info-panel h4 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--feature-color);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-panel p {
    font-size: 0.78rem;
    color: #94a3b8;
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.info-panel p:last-child {
    margin-bottom: 0;
}

.info-panel strong {
    color: #cbd5e1;
}

.info-panel ul {
    margin: 0;
    padding-left: 1.25rem;
}

.info-panel li {
    font-size: 0.78rem;
    color: #94a3b8;
    margin-bottom: 0.4rem;
    line-height: 1.5;
}

/* Feature Config */
.feature-config {
    display: none;
    padding: 0 1.25rem 1.25rem;
}

.feature-config.visible {
    display: block;
}

.config-section {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 1rem;
}

.config-row {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 0.75rem;
}

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

.config-row.vertical {
    flex-direction: column;
    align-items: stretch;
}

.config-label {
    font-size: 0.75rem;
    color: #94a3b8;
    min-width: 100px;
}

.config-select,
.config-input {
    flex: 1;
    height: 36px;
    padding: 0 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 0.8rem;
    font-family: var(--font-mono);
    outline: none;
    transition: all 0.2s ease;
}

.config-select:focus,
.config-input:focus {
    border-color: var(--feature-color);
    box-shadow: 0 0 0 2px var(--feature-glow);
}

.config-select option {
    background: #1e293b;
    color: #e2e8f0;
}

.config-textarea {
    width: 100%;
    min-height: 80px;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 0.8rem;
    font-family: var(--font-mono);
    resize: vertical;
    outline: none;
    transition: all 0.2s ease;
}

.config-textarea:focus {
    border-color: var(--feature-color);
    box-shadow: 0 0 0 2px var(--feature-glow);
}

.config-textarea::placeholder {
    color: #475569;
}

/* Config Buttons */
.config-buttons {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.btn-config {
    flex: 1;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--feature-glow);
    border: 1px solid var(--feature-color);
    border-radius: 8px;
    color: var(--feature-color);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-config:hover {
    background: var(--feature-color);
    color: #0f172a;
}

.btn-config.primary {
    background: var(--feature-color);
    color: #0f172a;
}

.btn-config.primary:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

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

/* Checkbox Group */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.checkbox-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--feature-color);
    cursor: pointer;
}

.checkbox-item label {
    font-size: 0.78rem;
    color: #cbd5e1;
    cursor: pointer;
}

/* Safety Button in Header - uses Aqua Metal style, only icon colors on hover */
.safety-btn.has-active {
    animation: safety-pulse 2s infinite;
}

.safety-btn.has-active svg {
    color: #ffaa30 !important;
}

@keyframes safety-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 170, 48, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(255, 170, 48, 0); }
}

/* Status Indicator in Feature Header */
.feature-status {
    font-size: 0.65rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: rgba(100, 116, 139, 0.2);
    color: #64748b;
    margin-left: auto;
    margin-right: 0.75rem;
}

.feature-status.active {
    background: var(--feature-glow);
    color: var(--feature-color);
}

/* Beacon Status Indicators */
.beacon-status-ok { color: #10b981 !important; }
.beacon-status-delayed { color: #f59e0b !important; }
.beacon-status-critical { color: #ef4444 !important; }

/* Dead Drop Mode Badge */
.mode-badge {
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.mode-badge.time-release {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.mode-badge.dead-man {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

/* Trusted Silence Contract Info */
.contract-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 8px;
    margin-top: 0.75rem;
}

.contract-info svg {
    width: 20px;
    height: 20px;
    color: #a78bfa;
    flex-shrink: 0;
}

.contract-info p {
    font-size: 0.72rem;
    color: #c4b5fd;
    line-height: 1.5;
    margin: 0;
}

/* Responsive */
@media (max-width: 480px) {
    .safety-modal .modal-content {
        max-width: 100%;
        margin: 0.5rem;
        max-height: calc(100vh - 1rem);
    }
    
    .feature-header {
        padding: 0.85rem 1rem;
    }
    
    .feature-icon {
        width: 36px;
        height: 36px;
    }
    
    .feature-icon svg {
        width: 18px;
        height: 18px;
    }
    
    .feature-title {
        font-size: 0.88rem;
    }
    
    .config-row {
        flex-direction: column;
        align-items: stretch;
    }

    .config-label {
        margin-bottom: 0.25rem;
    }
}

/* ============================================
   FILE CARD - Telegram Style
   ============================================ */

.file-card {
    background: linear-gradient(135deg, rgba(30, 35, 50, 0.95), rgba(20, 25, 40, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
    min-width: 280px;
    max-width: 350px;
}

.file-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
}

.file-type-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 11px;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
    letter-spacing: -0.5px;
}

.file-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.file-info .file-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: #e5e7eb;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.file-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-ext {
    font-size: 0.7rem;
    color: #9ca3af;
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.file-preview-btn {
    font-size: 0.72rem;
    color: #60a5fa;
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.file-preview-btn:hover {
    background: rgba(96, 165, 250, 0.15);
    color: #93c5fd;
}

.file-download-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.file-download-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.5);
}

.file-download-btn svg {
    width: 18px;
    height: 18px;
    color: white;
}

/* File Preview Container */
.file-preview-container {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.3);
}

.file-preview-container.hidden {
    display: none;
}

.preview-loading,
.preview-error {
    padding: 20px;
    text-align: center;
    color: #9ca3af;
    font-size: 0.85rem;
}

.preview-error {
    color: #ef4444;
}

/* PDF Preview */
.pdf-preview {
    width: 100%;
    height: 400px;
    border: none;
    background: white;
}
/* PDF Preview Firefox Compatibility */
.pdf-preview-firefox {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pdf-embed {
    width: 100%;
    height: 400px;
    border: none;
    border-radius: 8px;
    background: #1a1a1a;
}

.pdf-fallback {
    text-align: center;
    padding: 0.75rem;
    background: rgba(40, 45, 55, 0.8);
    border-radius: 8px;
    font-size: 0.85rem;
    color: #aaa;
}

.pdf-fallback p {
    margin: 0 0 0.5rem 0;
}

.pdf-open-btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: linear-gradient(180deg, #4080c0 0%, #3070b0 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.pdf-open-btn:hover {
    background: linear-gradient(180deg, #5090d0 0%, #4080c0 100%);
    box-shadow: 0 0 10px rgba(64, 128, 192, 0.5);
}



/* Text Preview */
.text-preview {
    margin: 0;
    padding: 12px 14px;
    max-height: 300px;
    overflow: auto;
    font-size: 0.78rem;
    line-height: 1.5;
    background: rgba(0, 0, 0, 0.4);
    color: #d1d5db;
    font-family: 'SF Mono', 'Fira Code', 'Monaco', monospace;
    white-space: pre-wrap;
    word-break: break-all;
}

.text-preview code {
    font-family: inherit;
    background: none;
    padding: 0;
}

/* Syntax highlighting hints */
.language-json .text-preview,
.language-javascript .text-preview {
    color: #a5d6ff;
}

.language-python .text-preview {
    color: #c9d1d9;
}

.language-html .text-preview,
.language-xml .text-preview {
    color: #7ee787;
}

.language-css .text-preview {
    color: #ff7b72;
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .file-card {
        min-width: unset;
        max-width: 100%;
    }

    .file-type-icon {
        width: 42px;
        height: 42px;
        font-size: 10px;
    }

    .file-download-btn {
        width: 36px;
        height: 36px;
    }

    .file-download-btn svg {
        width: 16px;
        height: 16px;
    }

    .pdf-preview {
        height: 280px;
    }

    .text-preview {
        max-height: 200px;
        font-size: 0.72rem;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   OFFLINE MESSAGES - Ephemeral Queue UI
   ═══════════════════════════════════════════════════════════════════════════ */

/* Offline Banner */
.offline-banner {
    background: linear-gradient(90deg, #f59e0b20, #f59e0b10);
    border-left: 3px solid #f59e0b;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    color: #f59e0b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.offline-banner.hidden {
    display: none;
}

/* TTL Selector */
.offline-ttl-selector {
    background: linear-gradient(90deg, #3b82f620, #3b82f610);
    border-left: 3px solid #3b82f6;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.offline-ttl-selector.hidden {
    display: none;
}

.ttl-label {
    font-size: 0.8rem;
    color: #93c5fd;
}

.ttl-select {
    background: #1e293b;
    border: 1px solid #3b82f6;
    border-radius: 6px;
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    color: #fff;
    cursor: pointer;
}

.ttl-select:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

/* Message Offline Status */
.msg-offline-status {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.7rem;
}

.offline-badge {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.delivered-badge {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.expired-badge {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.message.expired {
    opacity: 0.6;
}

.message.expired .message-content {
    text-decoration: line-through;
    text-decoration-color: rgba(239, 68, 68, 0.4);
}

/* Mobile adjustments for offline UI */
@media (max-width: 480px) {
    .offline-banner,
    .offline-ttl-selector {
        padding: 0.4rem 0.75rem;
        font-size: 0.75rem;
    }

    .ttl-label {
        font-size: 0.72rem;
    }

    .ttl-select {
        padding: 0.25rem 0.5rem;
        font-size: 0.72rem;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   AQUA METAL TOOLBAR - Apple Brushed Metal Style (2003-2007)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Brushed Metal Header Background - Dark Version */
.chat-header {
    background:
        /* Brushed metal noise texture simulation */
        repeating-linear-gradient(
            90deg,
            transparent 0px,
            rgba(255,255,255,0.02) 1px,
            transparent 2px,
            rgba(0,0,0,0.03) 3px,
            transparent 4px
        ),
        /* Base dark metal gradient */
        linear-gradient(
            180deg,
            #4a4a4a 0%,
            #404040 3%,
            #383838 10%,
            #303030 50%,
            #282828 90%,
            #222222 97%,
            #1a1a1a 100%
        );
    border-bottom: 1px solid #1a1a1a;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.1),
        0 1px 3px rgba(0,0,0,0.5);
}

/* Aqua Glass Buttons - Dark Version */
.chat-actions .btn-icon-glass,
.chat-header-left .btn-chat-sidebar-toggle {
    /* Aqua gel gradient - dark */
    background:
        /* Top highlight (subtle gel reflection) */
        linear-gradient(
            180deg,
            rgba(255,255,255,0.25) 0%,
            rgba(255,255,255,0.1) 45%,
            rgba(255,255,255,0.0) 50%,
            rgba(0,0,0,0.1) 100%
        ),
        /* Base dark color */
        linear-gradient(
            180deg,
            #505050 0%,
            #454545 45%,
            #383838 55%,
            #303030 100%
        );
    border: 1px solid #222;
    border-radius: 6px;
    box-shadow:
        /* Outer shadow */
        0 1px 3px rgba(0,0,0,0.5),
        /* Inner top highlight */
        inset 0 1px 0 rgba(255,255,255,0.15),
        /* Inner bottom shadow */
        inset 0 -1px 1px rgba(0,0,0,0.2);
    color: #ccc;
    transition: all 0.15s ease;
}

.chat-actions .btn-icon-glass svg,
.chat-header-left .btn-chat-sidebar-toggle svg {
    filter: drop-shadow(0 1px 0 rgba(0,0,0,0.5));
    color: #bbb;
}

/* Aqua Button Hover - Blue Glow (darker) */
.chat-actions .btn-icon-glass:hover,
.chat-header-left .btn-chat-sidebar-toggle:hover {
    background:
        linear-gradient(
            180deg,
            rgba(255,255,255,0.3) 0%,
            rgba(100,180,255,0.3) 45%,
            rgba(50,130,255,0.2) 50%,
            rgba(30,100,220,0.3) 100%
        ),
        linear-gradient(
            180deg,
            #4080c0 0%,
            #3070b0 45%,
            #2060a0 55%,
            #105090 100%
        );
    border-color: #1050a0;
    box-shadow:
        0 1px 3px rgba(0,50,150,0.5),
        0 0 10px rgba(0,120,255,0.4),
        inset 0 1px 0 rgba(255,255,255,0.2),
        inset 0 -1px 1px rgba(0,30,100,0.3);
    color: #fff;
}

.chat-actions .btn-icon-glass:hover svg,
.chat-header-left .btn-chat-sidebar-toggle:hover svg {
    color: #fff;
    filter: drop-shadow(0 0 3px rgba(100,180,255,0.8));
}

/* Aqua Button Active/Pressed */
.chat-actions .btn-icon-glass:active,
.chat-header-left .btn-chat-sidebar-toggle:active {
    background:
        linear-gradient(
            180deg,
            rgba(0,0,0,0.1) 0%,
            rgba(50,130,220,0.5) 45%,
            rgba(30,100,200,0.6) 55%,
            rgba(20,80,180,0.7) 100%
        ),
        linear-gradient(
            180deg,
            #3080d0 0%,
            #2070c0 45%,
            #1060b0 55%,
            #0050a0 100%
        );
    box-shadow:
        inset 0 2px 4px rgba(0,0,0,0.3),
        inset 0 0 3px rgba(0,0,0,0.2);
    transform: translateY(1px);
}

/* Call button - only icon turns green on hover */
.chat-actions .btn-icon-glass.call-btn:hover svg {
    color: #50ff80;
    filter: drop-shadow(0 0 4px rgba(80,255,128,0.6));
}

/* Safety button - only icon turns orange on hover */
.chat-actions .btn-icon-glass.safety-btn:hover svg {
    color: #ffaa30;
    filter: drop-shadow(0 0 4px rgba(255,170,48,0.6));
}

/* Panic button - only icon turns magenta on hover */
.chat-actions .btn-icon-glass.panic-btn:hover svg {
    color: #ff50ff;
    filter: drop-shadow(0 0 4px rgba(255,80,255,0.6));
}

/* Danger button - only icon turns red on hover */
.chat-actions .btn-icon-glass.danger:hover svg {
    color: #ff5050;
    filter: drop-shadow(0 0 4px rgba(255,80,80,0.6));
}

/* Peer info styling for dark metal theme */
.chat-header .peer-avatar-small {
    background:
        linear-gradient(
            180deg,
            #484848 0%,
            #383838 50%,
            #282828 100%
        );
    border: 1px solid #1a1a1a;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.1),
        0 1px 2px rgba(0,0,0,0.4);
}

.chat-header .peer-avatar-small svg {
    color: #00d4aa;
}

.chat-header .peer-name {
    color: #eee;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    font-weight: 600;
}

.chat-header .peer-status {
    color: #999;
    text-shadow: 0 1px 1px rgba(0,0,0,0.3);
}

/* Status dot in dark metal theme */
.chat-header .status-dot {
    box-shadow:
        0 1px 2px rgba(0,0,0,0.5),
        inset 0 1px 0 rgba(255,255,255,0.2);
}

/* Security badge in dark metal theme */
.chat-header .security-badge {
    background:
        linear-gradient(
            180deg,
            rgba(0,100,50,0.4) 0%,
            rgba(0,80,40,0.5) 50%,
            rgba(0,60,30,0.6) 100%
        );
    border: 1px solid #104020;
    color: #50ff90;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.1),
        0 0 8px rgba(0,255,100,0.2);
}

.pdf-opened-notice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: rgba(40, 120, 80, 0.3);
    border: 1px solid rgba(0, 200, 100, 0.3);
    border-radius: 8px;
    color: #8f8;
    font-size: 0.9rem;
}

.pdf-opened-notice .pdf-open-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

/* Blue theme - Sidebar toggle button (X) */
body.theme-liquid-blue .btn-sidebar-toggle {
    background: linear-gradient(180deg, #3a7bd5 0%, #2856a3 100%);
    border-color: rgba(0, 100, 200, 0.5);
    color: #fff;
}
body.theme-liquid-blue .btn-sidebar-toggle:hover {
    background: linear-gradient(180deg, #4a8be5 0%, #3866b3 100%);
    color: #fff;
}
body.theme-liquid-blue .btn-sidebar-toggle svg {
    color: #fff;
}

/* Blue theme - Typing indicator */
body.theme-liquid-blue .typing-indicator {
    background: transparent !important;
    background: transparent !important;
}
body.theme-liquid-blue .typing-dots {
    background: rgba(0, 136, 255, 0.2) !important;
    border-color: rgba(0, 136, 255, 0.3) !important;
}
body.theme-liquid-blue .typing-dots span {
    background: #00aaff !important;
}

/* Request count badge */
.request-count {
    display: inline-block;
    background: var(--accent-blue);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    margin-left: 8px;
    font-weight: 500;
}
.request-count.hidden {
    display: none;
}

/* ═══════════════════════════════════════════════════════════════════════
   GEO BEACON MESSAGE STYLES
   ═══════════════════════════════════════════════════════════════════════ */

.geo-beacon-msg {
    background: linear-gradient(180deg, rgba(30,40,50,0.95) 0%, rgba(20,30,40,0.98) 100%);
    border: 1px solid rgba(0,180,140,0.3);
    border-radius: 12px;
    padding: 12px;
    min-width: 220px;
    max-width: 300px;
    box-shadow: 
        0 4px 16px rgba(0,0,0,0.3),
        inset 0 1px 0 rgba(255,255,255,0.05);
}

.geo-beacon-msg.expired {
    opacity: 0.6;
    border-color: rgba(100,100,100,0.3);
}

.geo-beacon-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0,180,140,0.2);
}

.geo-beacon-icon {
    font-size: 1.4rem;
}

.geo-beacon-title {
    font-weight: 700;
    font-size: 0.85rem;
    color: #00d4aa;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.geo-beacon-precision {
    margin-left: auto;
    background: rgba(0,150,120,0.3);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    color: #8f8;
    border: 1px solid rgba(0,180,140,0.3);
}

.geo-beacon-map {
    margin: 8px 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(0,180,140,0.2);
}

.geo-beacon-map iframe {
    display: block;
    border-radius: 8px;
}

.geo-beacon-coords {
    font-family: 'JetBrains Mono', 'Monaco', monospace;
    font-size: 0.75rem;
    color: #aaa;
    text-align: center;
    padding: 6px 0;
    letter-spacing: 0.5px;
}

.geo-beacon-countdown {
    text-align: center;
    font-size: 0.75rem;
    color: #ff8844;
    padding: 4px 0;
    margin-bottom: 8px;
}

.geo-beacon-countdown.expiring-soon {
    color: #ff4444;
    animation: pulse-warning 1s infinite;
}

@keyframes pulse-warning {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.geo-beacon-actions {
    display: flex;
    justify-content: center;
}

.geo-beacon-btn {
    background: linear-gradient(180deg, rgba(0,140,110,0.6) 0%, rgba(0,100,80,0.7) 100%);
    border: 1px solid rgba(0,200,160,0.4);
    color: #8ff;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.geo-beacon-btn:hover {
    background: linear-gradient(180deg, rgba(0,160,130,0.7) 0%, rgba(0,120,100,0.8) 100%);
    border-color: rgba(0,220,180,0.5);
    transform: translateY(-1px);
}

.geo-beacon-expired-text {
    text-align: center;
    color: #888;
    font-style: italic;
    padding: 16px 0;
}

/* Geo Status in Safety Modal */
.geo-status {
    text-align: center;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin: 8px 0;
    min-height: 24px;
}

.geo-status.acquiring {
    background: rgba(0,100,200,0.2);
    color: #4af;
    border: 1px solid rgba(0,150,255,0.3);
}

.geo-status.success {
    background: rgba(0,150,100,0.2);
    color: #4f8;
    border: 1px solid rgba(0,200,150,0.3);
}

.geo-status.error {
    background: rgba(200,50,50,0.2);
    color: #f88;
    border: 1px solid rgba(255,100,100,0.3);
}

/* ═══════════════════════════════════════════════════════════════════════
   BEACON STATE MACHINE STYLES
   ═══════════════════════════════════════════════════════════════════════ */

.beacon-msg {
    padding: 12px 16px;
    border-radius: 12px;
    min-width: 200px;
    max-width: 280px;
    transition: all 0.3s ease;
}

/* GREEN State */
.beacon-msg.beacon-green {
    background: linear-gradient(180deg, rgba(20,60,40,0.95) 0%, rgba(15,50,35,0.98) 100%);
    border: 2px solid rgba(0,200,100,0.5);
    box-shadow: 
        0 0 15px rgba(0,200,100,0.2),
        inset 0 1px 0 rgba(255,255,255,0.05);
}

.beacon-msg.beacon-green .beacon-label {
    color: #4f8;
    text-shadow: 0 0 10px rgba(0,255,100,0.5);
}

/* YELLOW/DELAYED State */
.beacon-msg.beacon-yellow {
    background: linear-gradient(180deg, rgba(60,50,20,0.95) 0%, rgba(50,40,15,0.98) 100%);
    border: 2px solid rgba(255,180,0,0.5);
    box-shadow: 
        0 0 15px rgba(255,180,0,0.2),
        inset 0 1px 0 rgba(255,255,255,0.05);
    animation: pulse-yellow 2s infinite;
}

.beacon-msg.beacon-yellow .beacon-label {
    color: #fc0;
    text-shadow: 0 0 10px rgba(255,200,0,0.5);
}

@keyframes pulse-yellow {
    0%, 100% { box-shadow: 0 0 15px rgba(255,180,0,0.2); }
    50% { box-shadow: 0 0 25px rgba(255,180,0,0.4); }
}

/* RED/CRITICAL State */
.beacon-msg.beacon-red {
    background: linear-gradient(180deg, rgba(60,20,20,0.95) 0%, rgba(50,15,15,0.98) 100%);
    border: 2px solid rgba(255,60,60,0.6);
    box-shadow: 
        0 0 20px rgba(255,60,60,0.3),
        inset 0 1px 0 rgba(255,255,255,0.05);
    animation: pulse-red 1s infinite;
}

.beacon-msg.beacon-red .beacon-label {
    color: #f44;
    text-shadow: 0 0 10px rgba(255,60,60,0.6);
}

@keyframes pulse-red {
    0%, 100% { box-shadow: 0 0 20px rgba(255,60,60,0.3); }
    50% { box-shadow: 0 0 35px rgba(255,60,60,0.5); }
}

/* Beacon Header */
.beacon-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.beacon-icon {
    font-size: 1.2rem;
}

.beacon-label {
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

/* Beacon Text */
.beacon-text {
    font-size: 0.85rem;
    color: #ccc;
    margin-bottom: 8px;
}

/* Waiting/Question text */
.beacon-waiting {
    font-size: 0.75rem;
    color: #888;
    font-style: italic;
    margin-top: 8px;
}

.beacon-question {
    font-size: 0.9rem;
    color: #aaa;
    margin: 8px 0;
    font-weight: 500;
}

/* Response Button */
.beacon-response-btn {
    display: block;
    width: 100%;
    padding: 10px 16px;
    margin-top: 10px;
    background: linear-gradient(180deg, rgba(0,150,100,0.7) 0%, rgba(0,120,80,0.8) 100%);
    border: 1px solid rgba(0,200,140,0.5);
    border-radius: 8px;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.beacon-response-btn:hover {
    background: linear-gradient(180deg, rgba(0,180,120,0.8) 0%, rgba(0,150,100,0.9) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,200,140,0.3);
}

.beacon-response-btn:active {
    transform: translateY(0);
}

/* Confirmed/Responded states */
.beacon-confirmed {
    font-size: 0.8rem;
    color: #4f8;
    margin-top: 8px;
    padding: 6px 10px;
    background: rgba(0,150,100,0.2);
    border-radius: 6px;
    text-align: center;
}

.beacon-responded {
    font-size: 0.8rem;
    color: #4f8;
    margin-top: 8px;
}

/* Beacon Status in Safety Modal */
.beacon-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.beacon-status.status-green {
    background: rgba(0,150,100,0.3);
    color: #4f8;
    border: 1px solid rgba(0,200,140,0.4);
}

.beacon-status.status-yellow {
    background: rgba(150,120,0,0.3);
    color: #fc0;
    border: 1px solid rgba(200,160,0,0.4);
}

.beacon-status.status-red {
    background: rgba(150,40,40,0.3);
    color: #f66;
    border: 1px solid rgba(200,60,60,0.4);
}

/* ═══════════════════════════════════════════════════════════════════════════
   SPHERE SCREEN - Independent from chat
   ═══════════════════════════════════════════════════════════════════════════ */

#screenSphere {
    background: linear-gradient(145deg, #0a1a0f 0%, #0d2818 50%, #061208 100%);
}

.sphere-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

/* Sphere Header */
.sphere-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(0, 255, 136, 0.05);
    border-bottom: 1px solid rgba(0, 255, 136, 0.2);
    backdrop-filter: blur(10px);
}

.sphere-header-left,
.sphere-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-sphere-back {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid rgba(0, 255, 136, 0.3);
    background: rgba(0, 255, 136, 0.1);
    color: #00ff88;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-sphere-back:hover {
    background: rgba(0, 255, 136, 0.2);
    transform: translateX(-2px);
}

.btn-sphere-back svg {
    width: 20px;
    height: 20px;
}

.sphere-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sphere-icon-header {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.2) 0%, rgba(0, 200, 100, 0.1) 100%);
    border: 2px solid rgba(0, 255, 136, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: sphere-pulse 2s ease-in-out infinite;
}

@keyframes sphere-pulse {
    0%, 100% { box-shadow: 0 0 10px rgba(0, 255, 136, 0.3); }
    50% { box-shadow: 0 0 20px rgba(0, 255, 136, 0.5); }
}

.sphere-icon-header svg {
    width: 24px;
    height: 24px;
    color: #00ff88;
}

.sphere-details {
    display: flex;
    flex-direction: column;
}

.sphere-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #00ff88;
}

.sphere-members {
    font-size: 0.85rem;
    color: rgba(0, 255, 136, 0.7);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Cover Traffic Badge - Privacy protection indicator */
.cover-traffic-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: rgba(0, 200, 255, 0.15);
    border: 1px solid rgba(0, 200, 255, 0.3);
    border-radius: 12px;
    font-size: 0.7rem;
    color: rgba(0, 200, 255, 0.9);
    cursor: help;
    transition: all 0.2s ease;
}

.cover-traffic-badge:hover {
    background: rgba(0, 200, 255, 0.25);
    border-color: rgba(0, 200, 255, 0.5);
}

/* Sphere Messages Area */
.sphere-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sphere-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: rgba(0, 255, 136, 0.5);
}

.sphere-welcome-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.sphere-welcome h3 {
    color: rgba(0, 255, 136, 0.8);
    margin-bottom: 8px;
}

.sphere-welcome p {
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Sphere Message Bubbles */
.sphere-message {
    display: flex;
    flex-direction: column;
    max-width: 80%;
    animation: fadeInUp 0.2s ease-out;
}

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

.sphere-message.sent {
    align-self: flex-end;
}

.sphere-message.received {
    align-self: flex-start;
}

.sphere-message-sender {
    font-size: 0.75rem;
    color: #00ff88;
    margin-bottom: 4px;
    font-weight: 600;
}

.sphere-message-bubble {
    padding: 10px 14px;
    border-radius: 16px;
    position: relative;
}

.sphere-message.sent .sphere-message-bubble {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.25) 0%, rgba(0, 200, 100, 0.15) 100%);
    border: 1px solid rgba(0, 255, 136, 0.3);
    border-bottom-right-radius: 4px;
}

.sphere-message.received .sphere-message-bubble {
    background: rgba(255, 255, 255, 0.08);
    
    border-bottom-left-radius: 4px;
}

.sphere-message-text {
    color: #e0e0e0;
    word-wrap: break-word;
}

.sphere-message-time {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 4px;
    text-align: right;
}

/* Sphere Input Area */
.sphere-input-area {
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(0, 255, 136, 0.2);
}

.sphere-input-container {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 255, 136, 0.05);
    border: 1px solid rgba(0, 255, 136, 0.2);
    border-radius: 24px;
    padding: 8px 12px;
}

.sphere-input-container:focus-within {
    border-color: rgba(0, 255, 136, 0.5);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.15);
}

#sphereMessageInput {
    flex: 1;
    background: transparent;
    border: none;
    color: #e0e0e0;
    font-size: 0.95rem;
    resize: none;
    outline: none;
    max-height: 100px;
}

#sphereMessageInput::placeholder {
    color: rgba(0, 255, 136, 0.4);
}

.sphere-input-container .btn-attach,
.sphere-input-container .btn-emoji,
.sphere-input-container .btn-audio {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: rgba(0, 255, 136, 0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.sphere-input-container .btn-attach:hover,
.sphere-input-container .btn-emoji:hover,
.sphere-input-container .btn-audio:hover {
    background: rgba(0, 255, 136, 0.15);
    color: #00ff88;
}

.sphere-input-container .btn-attach svg,
.sphere-input-container .btn-emoji svg,
.sphere-input-container .btn-audio svg {
    width: 20px;
    height: 20px;
}

.btn-send.sphere-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #00ff88 0%, #00cc6a 100%);
    color: #0a1a0f;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-send.sphere-send:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.4);
}

.btn-send.sphere-send svg {
    width: 20px;
    height: 20px;
}

/* Sphere in Sidebar */
.sphere-section {
    border-bottom: 1px solid rgba(0, 255, 136, 0.2);
    margin-bottom: 8px;
    padding-bottom: 8px;
}

.sphere-section-title {
    font-size: 0.75rem;
    color: #00ff88;
    padding: 8px 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sphere-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sphere-item:hover {
    background: rgba(0, 255, 136, 0.1);
}

.sphere-item.active {
    background: rgba(0, 255, 136, 0.15);
    border-left-color: #00ff88;
}

.sphere-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.2) 0%, rgba(0, 200, 100, 0.1) 100%);
    border: 1px solid rgba(0, 255, 136, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.sphere-item-info {
    flex: 1;
    min-width: 0;
}

.sphere-item-name {
    font-weight: 600;
    color: #00ff88;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sphere-item-status {
    font-size: 0.8rem;
    color: rgba(0, 255, 136, 0.6);
}

.sphere-item-badge {
    background: #00ff88;
    color: #0a1a0f;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
}

/* ═══════════════════════════════════════════════════════════════
   SPHERE SIDEBAR ITEMS (in chat sidebar)
   ═══════════════════════════════════════════════════════════════ */

.sphere-sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    margin: 4px 8px;
    background: rgba(0, 255, 136, 0.05);
}

.sphere-sidebar-item:hover {
    background: rgba(0, 255, 136, 0.12);
}

.sphere-sidebar-item.current {
    background: rgba(0, 255, 136, 0.18);
    border-left-color: #00ff88;
}

.sphere-sidebar-item .sphere-icon {
    font-size: 1.4rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.15) 0%, rgba(0, 200, 100, 0.08) 100%);
    border-radius: 50%;
    border: 1px solid rgba(0, 255, 136, 0.25);
}

.sphere-sidebar-item .sphere-info {
    flex: 1;
    min-width: 0;
}

.sphere-sidebar-item .sphere-name {
    font-weight: 600;
    color: #00ff88;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sphere-sidebar-item .sphere-members {
    font-size: 0.75rem;
    color: rgba(0, 255, 136, 0.6);
}

.sphere-leave-btn {
    opacity: 0;
    padding: 6px;
    background: rgba(255, 100, 100, 0.1);
    border: 1px solid rgba(255, 100, 100, 0.3);
    border-radius: 6px;
    color: #ff6b6b;
    cursor: pointer;
    transition: all 0.2s;
}

.sphere-sidebar-item:hover .sphere-leave-btn {
    opacity: 1;
}

.sphere-leave-btn:hover {
    background: rgba(255, 100, 100, 0.2);
    border-color: #ff6b6b;
}

.chat-section-title {
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 12px 12px 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 8px;
}

/* Sphere audio recording button */
#btnSphereAudio.recording {
    background: rgba(255, 100, 100, 0.3) !important;
    border-color: #ff4444 !important;
    color: #ff4444 !important;
    animation: sphere-recording-pulse 1s ease-in-out infinite;
}

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

/* ═══════════════════════════════════════════════════════════════
   SPHERE CALL - Modal e Active Overlay
   ═══════════════════════════════════════════════════════════════ */


/* Incoming call modal */
.sphere-call-modal {
    text-align: center;
    padding: 2rem;
    max-width: 320px;
}

.call-animation {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 1.5rem;
}

.call-ring {
    position: absolute;
    inset: 0;
    border: 2px solid rgba(0, 255, 136, 0.5);
    border-radius: 50%;
    animation: call-ring-pulse 1.5s ease-out infinite;
}

.call-ring.ring2 { animation-delay: 0.3s; }
.call-ring.ring3 { animation-delay: 0.6s; }

@keyframes call-ring-pulse {
    0% { transform: scale(0.8); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

.call-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    animation: call-icon-shake 0.5s ease-in-out infinite;
}

@keyframes call-icon-shake {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

.sphere-call-modal h3 {
    color: #00ff88;
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.sphere-call-modal p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.call-actions {
    display: flex;
    gap: 2rem;
    justify-content: center;
}

.btn-call-reject,
.btn-call-accept {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-call-reject {
    background: linear-gradient(135deg, #ff4444 0%, #cc0000 100%);
    box-shadow: 0 4px 15px rgba(255, 68, 68, 0.4);
}

.btn-call-reject:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(255, 68, 68, 0.6);
}

.btn-call-accept {
    background: linear-gradient(135deg, #00ff88 0%, #00cc6a 100%);
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.4);
    animation: accept-pulse 1s ease-in-out infinite;
}

@keyframes accept-pulse {
    0%, 100% { box-shadow: 0 4px 15px rgba(0, 255, 136, 0.4); }
    50% { box-shadow: 0 4px 25px rgba(0, 255, 136, 0.7); }
}

.btn-call-accept:hover {
    transform: scale(1.1);
}

.btn-call-reject svg,
.btn-call-accept svg {
    width: 28px;
    height: 28px;
    color: white;
}

/* Active call overlay */
.sphere-call-active {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, rgba(0, 20, 10, 0.95) 0%, rgba(0, 40, 20, 0.95) 100%);
    border: 1px solid rgba(0, 255, 136, 0.3);
    border-radius: 16px;
    padding: 1rem 1.5rem;
    min-width: 280px;
    z-index: 1000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

.sphere-call-active.hidden {
    display: none;
}

.call-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.call-status {
    color: #00ff88;
    font-weight: 600;
    font-size: 0.9rem;
}

.call-timer {
    color: var(--text-muted);
    font-family: monospace;
    font-size: 0.85rem;
}

.call-participants {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.call-participant {
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid rgba(0, 255, 136, 0.2);
    border-radius: 20px;
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    color: #00ff88;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.call-participant.speaking {
    border-color: #00ff88;
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

.call-participant .speaking-indicator {
    width: 8px;
    height: 8px;
    background: #00ff88;
    border-radius: 50%;
    animation: speaking-pulse 0.5s ease-in-out infinite alternate;
}

@keyframes speaking-pulse {
    from { opacity: 0.3; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1.2); }
}

.call-controls {
    display: flex;
    gap: 1.25rem;
    justify-content: center;
}

.btn-call-mute,
.btn-call-end {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-call-mute {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-call-mute:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-call-mute.muted {
    background: rgba(255, 68, 68, 0.2);
    border-color: rgba(255, 68, 68, 0.4);
}

.btn-call-mute.muted svg {
    color: #ff4444;
}

.btn-call-mute svg {
    width: 20px;
    height: 20px;
    color: white;
}

.btn-call-end {
    background: linear-gradient(135deg, #ff4444 0%, #cc0000 100%);
}

.btn-call-end:hover {
    transform: scale(1.1);
}

.btn-call-end svg {
    width: 22px;
    height: 22px;
    color: white;
}

/* Fix call buttons visibility */
.sphere-call-modal .call-actions {
    display: flex !important;
    gap: 2rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.sphere-call-modal .btn-call-reject,
.sphere-call-modal .btn-call-accept {
    width: 70px !important;
    height: 70px !important;
    border-radius: 50% !important;
    border: none !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0;
}

.sphere-call-modal .btn-call-reject {
    background: linear-gradient(135deg, #ff4444 0%, #cc0000 100%) !important;
}

.sphere-call-modal .btn-call-accept {
    background: linear-gradient(135deg, #00ff88 0%, #00cc6a 100%) !important;
}

.sphere-call-modal .btn-call-reject svg,
.sphere-call-modal .btn-call-accept svg {
    width: 32px !important;
    height: 32px !important;
    fill: white !important;
    color: white !important;
}

/* Fix z-index for sphere call modal */
#sphereCallModal {
    z-index: 2000 !important;
}

#sphereCallModal .modal-backdrop {
    z-index: 2001 !important;
}

#sphereCallModal .modal-content,
#sphereCallModal .sphere-call-modal {
    position: relative !important;
    z-index: 2002 !important;
}

#sphereCallModal .call-actions {
    position: relative !important;
    z-index: 2003 !important;
}

#sphereCallModal .btn-call-accept,
#sphereCallModal .btn-call-reject {
    position: relative !important;
    z-index: 2004 !important;
    pointer-events: auto !important;
}

/* ═══════════════════════════════════════════════════════════════
   SPHERE GEO BEACON
   ═══════════════════════════════════════════════════════════════ */

.btn-icon-glass.geo {
    color: #4ade80;
}

.btn-icon-glass.geo:hover {
    background: rgba(74, 222, 128, 0.2);
    color: #22c55e;
}

.btn-icon-glass.geo .btn-label {
    font-size: 0.65rem;
    margin-left: 2px;
    opacity: 0.9;
}

.modal-icon.geo {
    background: linear-gradient(135deg, #22c55e, #4ade80);
    color: white;
}

.geo-modal .modal-body {
    padding: 1rem;
}

.geo-description {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.geo-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.geo-option-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.geo-option-row label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.geo-option-row select {
    flex: 1;
    max-width: 180px;
    padding: 0.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--glass-bg);
    color: var(--text-primary);
    font-size: 0.85rem;
}

.geo-option-row.checkbox {
    justify-content: flex-start;
}

.geo-option-row .checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.85rem;
}

.geo-option-row .checkbox-label input {
    width: 18px;
    height: 18px;
    accent-color: #22c55e;
}

#sphereGeoStatus {
    margin-top: 0.75rem;
    padding: 0.5rem;
    border-radius: 8px;
    font-size: 0.85rem;
    text-align: center;
}

#sphereGeoStatus.acquiring {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

#sphereGeoStatus.success {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

#sphereGeoStatus.error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.btn-primary.geo {
    background: linear-gradient(135deg, #22c55e, #4ade80);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary.geo:hover {
    background: linear-gradient(135deg, #16a34a, #22c55e);
}

/* Geo Beacon message bubble in sphere */
.geo-beacon-bubble {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(74, 222, 128, 0.1));
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 12px;
    padding: 0.75rem;
    min-width: 200px;
    max-width: 280px;
}

.geo-beacon-header {
    font-weight: 600;
    color: #22c55e;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.geo-map-preview {
    margin: 0.5rem 0;
    border-radius: 8px;
    overflow: hidden;
}

.geo-beacon-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.geo-beacon-footer .geo-link {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
}

.geo-beacon-footer .geo-link:hover {
    text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════════════
   SPHERE HEADER BUTTONS - AQUA STYLE
   ═══════════════════════════════════════════════════════════════ */


/* PULSANTI SFERA NEUTRI BOMBATI - STILE CHAT */

.sphere-header-right .btn-icon-glass {
    width: 40px;
    height: 40px;
    background:
        linear-gradient(
            180deg,
            rgba(255,255,255,0.25) 0%,
            rgba(255,255,255,0.1) 45%,
            rgba(255,255,255,0.0) 50%,
            rgba(0,0,0,0.1) 100%
        ),
        linear-gradient(
            180deg,
            #505050 0%,
            #454545 45%,
            #353535 55%,
            #404040 100%
        );
    border: 1px solid #303030;
    border-radius: 50%;
    box-shadow:
        0 3px 8px rgba(0,0,0,0.4),
        inset 0 1px 0 rgba(255,255,255,0.15),
        inset 0 -1px 0 rgba(0,0,0,0.2);
    transition: all 0.2s ease;
    color: #999;
}

.sphere-header-right .btn-icon-glass svg {
    width: 18px;
    height: 18px;
    transition: all 0.15s ease;
    color: #aaa;
}

.sphere-header-right .btn-icon-glass:hover {
    transform: translateY(-1px);
    box-shadow:
        0 4px 12px rgba(0,0,0,0.5),
        inset 0 1px 0 rgba(255,255,255,0.2);
}

.sphere-header-right .btn-icon-glass:active {
    transform: scale(0.95);
    box-shadow:
        inset 0 2px 4px rgba(0,0,0,0.3),
        inset 0 0 3px rgba(0,0,0,0.2);
}

/* Geo button - glow verde su hover */
.sphere-header-right .btn-icon-glass.geo:hover {
    box-shadow:
        0 4px 15px rgba(34, 197, 94, 0.4),
        0 0 20px rgba(74, 222, 128, 0.3),
        inset 0 1px 0 rgba(255,255,255,0.2);
}
.sphere-header-right .btn-icon-glass.geo:hover svg {
    color: #4ade80;
    filter: drop-shadow(0 0 5px rgba(74, 222, 128, 0.8));
}

/* Call button - glow verde su hover */
.sphere-header-right .btn-icon-glass.call:hover {
    box-shadow:
        0 4px 15px rgba(34, 197, 94, 0.4),
        0 0 20px rgba(74, 222, 128, 0.3),
        inset 0 1px 0 rgba(255,255,255,0.2);
}
.sphere-header-right .btn-icon-glass.call:hover svg {
    color: #4ade80;
    filter: drop-shadow(0 0 5px rgba(74, 222, 128, 0.8));
}

/* Danger/Exit button - glow rosso su hover */
.sphere-header-right .btn-icon-glass.danger:hover {
    box-shadow:
        0 4px 15px rgba(239, 68, 68, 0.4),
        0 0 20px rgba(255, 100, 100, 0.3),
        inset 0 1px 0 rgba(255,255,255,0.2);
}
.sphere-header-right .btn-icon-glass.danger:hover svg {
    color: #ff6b6b;
    filter: drop-shadow(0 0 5px rgba(255, 100, 100, 0.8));
}

/* Audio button - glow arancio su hover */
.sphere-header-right .btn-icon-glass.audio:hover {
    box-shadow:
        0 4px 15px rgba(251, 146, 60, 0.4),
        0 0 20px rgba(255, 165, 0, 0.3),
        inset 0 1px 0 rgba(255,255,255,0.2);
}
.sphere-header-right .btn-icon-glass.audio:hover svg {
    color: #fb923c;
    filter: drop-shadow(0 0 5px rgba(251, 146, 60, 0.8));
}

/* Info button - già neutro con glow ciano */
.btn-sphere-info {
    width: 40px;
    height: 40px;
    background:
        linear-gradient(
            180deg,
            rgba(255,255,255,0.25) 0%,
            rgba(255,255,255,0.1) 45%,
            rgba(255,255,255,0.0) 50%,
            rgba(0,0,0,0.1) 100%
        ),
        linear-gradient(
            180deg,
            #505050 0%,
            #454545 45%,
            #353535 55%,
            #404040 100%
        );
    border: 1px solid #303030;
    border-radius: 50%;
    box-shadow:
        0 3px 8px rgba(0,0,0,0.4),
        inset 0 1px 0 rgba(255,255,255,0.15),
        inset 0 -1px 0 rgba(0,0,0,0.2);
    font-family: Times New Roman, Georgia, serif;
    font-style: italic;
    font-size: 18px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-sphere-info:hover {
    transform: translateY(-1px);
    box-shadow:
        0 4px 15px rgba(100, 200, 255, 0.4),
        0 0 20px rgba(74, 222, 128, 0.3),
        inset 0 1px 0 rgba(255,255,255,0.2);
    color: #4ade80;
}

.btn-sphere-info:active {
    transform: scale(0.95);
}

/* Members button - già bombato, aggiungi glow viola */
.sphere-header-right .btn-members:hover {
    box-shadow:
        0 4px 15px rgba(167, 139, 250, 0.4),
        0 0 20px rgba(167, 139, 250, 0.3),
        inset 0 1px 0 rgba(255,255,255,0.2);
}
.sphere-header-right .btn-members:hover svg {
    color: #a78bfa;
    filter: drop-shadow(0 0 5px rgba(167, 139, 250, 0.8));
}

/* ============================================
   MEDIA DOWNLOAD BUTTON
   ============================================ */

.message-media {
    position: relative;
    cursor: grab;
}

.message-media:active {
    cursor: grabbing;
}

.media-download-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.message-media:hover .media-download-btn {
    opacity: 1;
}

.media-download-btn:hover {
    background: rgba(0, 200, 255, 0.8);
    transform: scale(1.1);
}

.media-download-btn:active {
    transform: scale(0.95);
}

/* Drag hint */
.message-media::after {
    content: '↔️ Trascina per salvare';
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    white-space: nowrap;
}

.message-media:hover::after {
    opacity: 0.8;
}

/* ============================================
   SPHERE UPLOAD PROGRESS BAR
   ============================================ */

.sphere-upload-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 15px;
    background: rgba(0, 200, 255, 0.1);
    border-bottom: 1px solid rgba(0, 200, 255, 0.2);
}

.sphere-upload-progress.hidden {
    display: none;
}

.sphere-progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.sphere-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #00c8ff, #00ff88);
    border-radius: 3px;
    transition: width 0.2s ease;
}

.sphere-progress-text {
    font-size: 12px;
    color: #00c8ff;
    min-width: 100px;
    text-align: right;
}

/* Force emoji button visibility in sphere */
#btnSphereEmoji {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
}

#btnSphereEmoji svg {
    width: 20px !important;
    height: 20px !important;
    stroke: rgba(0, 255, 136, 0.7) !important;
}

#btnSphereEmoji:hover svg {
    stroke: #00ff88 !important;
}

/* ============================================
   DELETE IDENTITY MODAL
   ============================================ */

.modal-card.danger {
    border: 2px solid rgba(255, 60, 60, 0.5);
    box-shadow: 0 0 30px rgba(255, 0, 0, 0.2);
}

.modal-icon.danger {
    background: linear-gradient(135deg, #ff3c3c 0%, #cc0000 100%);
    font-size: 2rem;
}

.danger-warning {
    color: #ff6b6b;
    font-size: 1.1rem;
    text-align: center;
    margin-bottom: 1rem;
}

.danger-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
    background: rgba(255, 60, 60, 0.1);
    border-radius: 12px;
    padding: 1rem;
}

.danger-list li {
    padding: 0.5rem 0;
    color: #e0e0e0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.danger-list li:last-child {
    border-bottom: none;
}

.danger-confirm-text {
    text-align: center;
    margin: 1rem 0 0.5rem;
    color: #aaa;
}

.danger-input {
    width: 100%;
    padding: 12px;
    background: rgba(255, 60, 60, 0.1);
    border: 2px solid rgba(255, 60, 60, 0.3);
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.danger-input:focus {
    outline: none;
    border-color: #ff3c3c;
}

.btn-danger {
    background: linear-gradient(135deg, #ff3c3c 0%, #cc0000 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-danger:not(:disabled):hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 60, 60, 0.5);
}

/* ═══════════════════════════════════════════════════════════════════════════
   SPHERE MEMBERS MODAL
   ═══════════════════════════════════════════════════════════════════════════ */

.modal-card.sphere-theme {
    background: linear-gradient(145deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border: 1px solid rgba(100, 200, 255, 0.2);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(100, 200, 255, 0.1);
    max-width: 400px;
    width: 90%;
}

.modal-card.sphere-theme .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(100, 200, 255, 0.2);
}

.modal-card.sphere-theme .modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #4ade80;
}

.modal-card.sphere-theme .btn-close {
    background: none;
    border: none;
    color: #888;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-card.sphere-theme .btn-close:hover {
    color: #ff6b6b;
}

.sphere-info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sphere-info-label {
    color: #888;
    font-size: 0.9rem;
}

.sphere-info-value {
    color: #fff;
    font-weight: 500;
}

.sphere-members-list {
    margin-top: 1rem;
    max-height: 300px;
    overflow-y: auto;
}

.sphere-member-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    margin-bottom: 0.5rem;
    transition: background 0.2s;
}

.sphere-member-item:hover {
    background: rgba(100, 200, 255, 0.1);
}

.sphere-member-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
}

.sphere-member-info {
    flex: 1;
}

.sphere-member-name {
    font-weight: 500;
    color: #fff;
}

.sphere-member-role {
    font-size: 0.8rem;
    color: #4ade80;
}

.sphere-member-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 8px #4ade80;
}


/* ═══════════════════════════════════════════════════════════════════════════
   SPHERE INFO MODAL - LAYOUT RETTANGOLARE
   ═══════════════════════════════════════════════════════════════════════════ */

.sphere-info-modal {
    background: linear-gradient(145deg, #0d0d20 0%, #1a1a40 50%, #0f2040 100%);
    border: 1px solid rgba(100, 200, 255, 0.25);
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.9), 
                0 0 80px rgba(100, 200, 255, 0.1);
    width: 95%;
    max-width: 1100px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 24px;
    padding: 0;
}

.sphere-info-header {
    text-align: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(100, 200, 255, 0.15);
    background: linear-gradient(180deg, rgba(100, 200, 255, 0.08) 0%, transparent 100%);
    position: relative;
}

.sphere-info-icon {
    font-size: 2.5rem;
    margin-bottom: 0.25rem;
    filter: drop-shadow(0 0 25px rgba(100, 200, 255, 0.6));
}

.sphere-info-header h2 {
    margin: 0;
    font-size: 1.6rem;
    background: linear-gradient(135deg, #64c8ff 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sphere-info-subtitle {
    margin: 0.25rem 0 0;
    color: #777;
    font-size: 0.9rem;
    font-style: italic;
}

.sphere-info-header .btn-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    color: #666;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sphere-info-header .btn-close:hover {
    background: rgba(255, 100, 100, 0.2);
    border-color: rgba(255, 100, 100, 0.4);
    color: #ff6b6b;
}

.sphere-info-content {
    padding: 1.5rem 2rem 2rem;
}

.sphere-info-intro {
    text-align: center;
    color: #bbb;
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

/* GRIGLIA 2x2 */
.sphere-features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

@media (max-width: 700px) {
    .sphere-features-grid {
        grid-template-columns: 1fr;
    }
}

/* CARD FEATURE */
.sphere-feature {
    padding: 1.25rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
}

.sphere-feature:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

/* COLORI SEZIONI */
.sphere-feature.crypto {
    background: linear-gradient(145deg, rgba(59, 130, 246, 0.2) 0%, rgba(37, 99, 235, 0.1) 100%);
    border-color: rgba(59, 130, 246, 0.3);
}
.sphere-feature.crypto:hover { border-color: rgba(59, 130, 246, 0.5); }
.sphere-feature.crypto .sphere-feature-content h3 { color: #60a5fa; }

.sphere-feature.audio {
    background: linear-gradient(145deg, rgba(168, 85, 247, 0.2) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-color: rgba(168, 85, 247, 0.3);
}
.sphere-feature.audio:hover { border-color: rgba(168, 85, 247, 0.5); }
.sphere-feature.audio .sphere-feature-content h3 { color: #c084fc; }

.sphere-feature.conference {
    background: linear-gradient(145deg, rgba(34, 197, 94, 0.2) 0%, rgba(22, 163, 74, 0.1) 100%);
    border-color: rgba(34, 197, 94, 0.3);
}
.sphere-feature.conference:hover { border-color: rgba(34, 197, 94, 0.5); }
.sphere-feature.conference .sphere-feature-content h3 { color: #4ade80; }

.sphere-feature.danger {
    background: linear-gradient(145deg, rgba(239, 68, 68, 0.2) 0%, rgba(220, 38, 38, 0.1) 100%);
    border-color: rgba(239, 68, 68, 0.3);
}
.sphere-feature.danger:hover { border-color: rgba(239, 68, 68, 0.5); }
.sphere-feature.danger .sphere-feature-content h3 { color: #f87171; }

/* CONTENUTO CARD */
.sphere-feature-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.sphere-feature-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.sphere-feature-content h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
}

.sphere-feature-content p {
    margin: 0.4rem 0;
    color: #999;
    font-size: 0.88rem;
    line-height: 1.5;
}

.sphere-feature-content ul {
    margin: 0.5rem 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1rem;
}

.sphere-feature-content li {
    color: #888;
    font-size: 0.82rem;
}

.sphere-highlight {
    background: rgba(100, 200, 255, 0.1);
    padding: 0.6rem 1rem;
    border-radius: 10px;
    margin-top: 0.5rem;
    color: #7dd3fc;
    font-size: 0.85rem;
    text-align: center;
    border: 1px solid rgba(100, 200, 255, 0.15);
}

.sphere-warning {
    color: #fca5a5 !important;
    font-weight: 500;
}

/* CONCLUSIONE */
.sphere-conclusion {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sphere-conclusion p {
    margin: 0;
    color: #999;
    font-size: 1rem;
}

/* SCROLLBAR */
.sphere-info-modal::-webkit-scrollbar {
    width: 8px;
}
.sphere-info-modal::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}
.sphere-info-modal::-webkit-scrollbar-thumb {
    background: rgba(100, 200, 255, 0.25);
    border-radius: 4px;
}


/* ═══════════════════════════════════════════════════════════════════════════
   SPHERE MEMBERS MODAL
   ═══════════════════════════════════════════════════════════════════════════ */

.sphere-members-modal {
    background: linear-gradient(145deg, #0a0a1a 0%, #1a1a3e 50%, #0f2847 100%);
    border: 1px solid rgba(167, 139, 250, 0.3);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.8), 
                0 0 40px rgba(167, 139, 250, 0.15);
    max-width: 400px;
    width: 90%;
    border-radius: 20px;
}

.sphere-members-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(167, 139, 250, 0.2);
    background: linear-gradient(180deg, rgba(167, 139, 250, 0.1) 0%, transparent 100%);
}

.sphere-members-modal .modal-header h2 {
    margin: 0;
    font-size: 1.2rem;
    color: #a78bfa;
}

.sphere-members-modal .modal-body {
    padding: 1.25rem 1.5rem;
}

.sphere-info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sphere-info-row .label {
    color: #888;
    font-size: 0.9rem;
}

.sphere-info-row .value {
    color: #fff;
    font-weight: 500;
}

.sphere-members-list {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sphere-member-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.sphere-member-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    font-size: 1.1rem;
}

.sphere-member-info {
    flex: 1;
}

.sphere-member-name {
    color: #fff;
    font-weight: 500;
    font-size: 0.95rem;
}

.sphere-member-role {
    color: #888;
    font-size: 0.8rem;
    margin-top: 2px;
}

.sphere-member-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 8px #4ade80;
}
/* Language Selector */
.lang-selector {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.lang-btn {
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid rgba(0, 255, 136, 0.3);
    color: rgba(0, 255, 136, 0.7);
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.lang-btn:hover {
    background: rgba(0, 255, 136, 0.2);
    border-color: rgba(0, 255, 136, 0.5);
    color: #00ff88;
}

.lang-btn.active {
    background: rgba(0, 255, 136, 0.3);
    border-color: #00ff88;
    color: #00ff88;
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}
