/* ==========================================================================
   ZUPCHAT - PREMIUM WEB DESIGN SYSTEM & STYLING (GLASSMORPHISM / NEON CYBER)
   ========================================================================== */

/* --- TOKENS & CORE VARIABLES --- */
:root {
    --bg-primary: #05040a;
    --bg-secondary: #0c0b18;
    --bg-panel: rgba(18, 17, 34, 0.65);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(138, 43, 226, 0.2);
    
    /* Harmonious Color Palette */
    --accent-purple: #8b5cf6;
    --accent-purple-glow: rgba(139, 92, 246, 0.5);
    --accent-blue: #06b6d4;
    --accent-blue-glow: rgba(6, 182, 212, 0.5);
    --accent-green: #10b981;
    --accent-green-glow: rgba(16, 185, 129, 0.6);
    --accent-orange: #f97316;
    --accent-orange-glow: rgba(249, 115, 22, 0.6);
    --accent-red: #ef4444;
    --accent-red-glow: rgba(239, 68, 68, 0.6);
    
    /* Text Colors */
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-dark: #1f2937;
    
    /* Shadows & Effects */
    --glass-shadow: 0 16px 40px 0 rgba(0, 0, 0, 0.5);
    --blur-intensity: 20px;
    
    /* Transitions */
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
}

/* --- RESET & GLOBAL SETTINGS --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', 'Outfit', sans-serif;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-primary);
    background-image: 
        radial-gradient(at 10% 10%, rgba(139, 92, 246, 0.12) 0px, transparent 50%),
        radial-gradient(at 90% 90%, rgba(6, 182, 212, 0.1) 0px, transparent 50%),
        radial-gradient(at 50% 50%, rgba(5, 4, 10, 0.5) 0px, var(--bg-primary) 100%);
    background-attachment: fixed;
    color: var(--text-main);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* --- REUSABLE UTILITIES --- */
.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(var(--blur-intensity));
    -webkit-backdrop-filter: blur(var(--blur-intensity));
    border: 1px solid var(--border-color);
    box-shadow: var(--glass-shadow);
    border-radius: 20px;
}

.glowing-text {
    background: linear-gradient(135deg, #00e5ff 0%, #8a2be2 50%, #ff007f 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: glowShift 5s linear infinite;
    font-weight: 800;
}

.hidden {
    display: none !important;
}

/* --- SCROLLBAR DESIGN --- */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-purple);
}

/* ==========================================================================
   ONBOARDING / LOGIN SCREEN
   ========================================================================== */

.overlay-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: rgba(3, 2, 7, 0.85);
    backdrop-filter: blur(15px);
    overflow-y: auto;
    transition: var(--transition-smooth);
}

.onboarding-card {
    width: 100%;
    max-width: 550px;
    padding: 40px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(139, 92, 246, 0.15);
    animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: center;
}

.onboarding-header {
    text-align: center;
    margin-bottom: 30px;
}

.logo {
    font-size: 3.5rem;
    letter-spacing: -2px;
    line-height: 1;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 400;
}

.onboarding-body {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.input-with-button {
    display: flex;
    gap: 10px;
}

input[type="text"] {
    flex: 1;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 1rem;
    transition: var(--transition-smooth);
}

input[type="text"]:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.25);
    background: rgba(0, 0, 0, 0.6);
}

/* Buttons styling */
.btn-primary {
    background: linear-gradient(135deg, var(--accent-purple) 0%, #6d28d9 100%);
    border: none;
    color: white;
    font-weight: 700;
    padding: 16px 28px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    font-size: 1rem;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
    transition: var(--transition-smooth);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.6), 0 0 15px rgba(255, 255, 255, 0.2);
}

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 12px;
    width: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--text-muted);
}

.btn-circle {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.btn-circle:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--text-muted);
    transform: scale(1.05);
}

/* Avatar grid selection */
.avatar-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
}

.avatar-option {
    aspect-ratio: 1;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: var(--transition-smooth);
    background-size: cover;
    background-position: center;
    box-shadow: inset 0 2px 4px rgba(255,255,255,0.1);
}

.avatar-option:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

.avatar-option.selected {
    border-color: var(--accent-purple);
    box-shadow: 0 0 15px var(--accent-purple-glow);
    transform: scale(1.1);
}

/* Country Detector Section */
.country-badge {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 14px 20px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.3);
}

.country-flag {
    width: 32px;
    height: 22px;
    border-radius: 4px;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top: 2px solid var(--accent-purple);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Mode Selection Custom Options */
.mode-selector-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.mode-option {
    position: relative;
    padding: 20px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: var(--transition-smooth);
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255,255,255,0.01);
}

.mode-option:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.mode-option.active {
    background: rgba(139, 92, 246, 0.07);
    border-color: rgba(139, 92, 246, 0.3);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.1), inset 0 0 10px rgba(139, 92, 246, 0.05);
}

.mode-icon-container {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.purple-glow i {
    color: #a78bfa;
    filter: drop-shadow(0 0 5px rgba(167, 139, 250, 0.5));
}

.blue-glow i {
    color: #22d3ee;
    filter: drop-shadow(0 0 5px rgba(34, 211, 238, 0.5));
}

.mode-details h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.mode-details p {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.selection-indicator {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    transition: var(--transition-smooth);
}

.mode-option.active .selection-indicator {
    background: var(--accent-purple);
    box-shadow: 0 0 8px var(--accent-purple);
}

.onboarding-footer {
    margin-top: 15px;
}

/* ==========================================================================
   MAIN SYSTEM INTERFACE LAYOUT
   ========================================================================== */

.app-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    padding: 16px;
    gap: 16px;
    animation: fadeIn 0.4s ease-out;
}

/* --- HEADER --- */
.app-header {
    height: 70px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    flex-shrink: 0;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-small {
    font-size: 2.2rem;
    letter-spacing: -1.5px;
    cursor: pointer;
    font-weight: 800;
}

.divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
}

.online-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-green);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-green-glow);
    animation: pulse 1.5s infinite;
}

.stats-text {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.stats-text strong {
    color: var(--text-main);
}

/* Current active mode badge */
.current-mode-pill {
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.25);
    padding: 8px 16px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #c084fc;
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.08);
}

.current-mode-pill.live {
    background: rgba(6, 182, 212, 0.12);
    border-color: rgba(6, 182, 212, 0.25);
    color: #22d3ee;
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.08);
}

.current-mode-pill i {
    width: 14px;
    height: 14px;
}

.user-profile-badge {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar-tiny {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.user-info-tiny {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.user-name-tiny {
    font-size: 0.85rem;
    font-weight: 700;
}

.user-country-tiny {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.user-country-tiny img {
    width: 14px;
    height: 10px;
    object-fit: cover;
    border-radius: 2px;
}

/* --- MAIN LAYOUT CORE --- */
.app-main {
    display: flex;
    flex: 1;
    width: 100%;
    gap: 16px;
    min-height: 0; /* Important for flex container scrolling */
}

/* --- VIDEO CONTAINER AREA (Left Panel) --- */
.video-section {
    flex: 7;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
}

.videos-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    min-height: 0;
}

.video-wrapper {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    background: #090812;
    display: flex;
    flex-direction: column;
    min-height: 0;
    transition: var(--transition-smooth);
}

.remote-wrapper {
    box-shadow: var(--glass-shadow), 0 0 30px rgba(139, 92, 246, 0.05);
}

.local-wrapper {
    box-shadow: var(--glass-shadow), 0 0 30px rgba(6, 182, 212, 0.05);
}

.video-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 24px;
    pointer-events: none;
    border: 2px solid transparent;
    transition: var(--transition-smooth);
}

.remote-wrapper:hover::after {
    border-color: rgba(139, 92, 246, 0.3);
}

.local-wrapper:hover::after {
    border-color: rgba(6, 182, 212, 0.3);
}

/* Video headers overlay */
.video-header {
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    pointer-events: none;
}

.partner-badge {
    background: rgba(3, 2, 7, 0.65);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px 16px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    pointer-events: auto;
}

.flag-icon {
    width: 22px;
    height: 16px;
    border-radius: 2px;
    object-fit: cover;
}

.watermark {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 1px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    color: var(--text-muted);
}

/* Core Video Frame */
.video-container {
    position: relative;
    flex: 1;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.video-element {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
    transition: filter 0.4s ease;
}

.local-mirror {
    transform: scaleX(-1);
}

/* Camera permission block screen */
.camera-error-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
}

.error-icon {
    width: 48px;
    height: 48px;
    color: var(--accent-red);
    filter: drop-shadow(0 0 10px var(--accent-red-glow));
}

.camera-error-container span {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
}

.camera-error-container p {
    font-size: 0.85rem;
    max-width: 280px;
}

/* Floating Control panel over local camera */
.video-controls-overlay {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 10;
    background: rgba(3, 2, 7, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px 12px;
    border-radius: 50px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.video-controls-overlay .btn-circle {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.05);
}

.video-controls-overlay .btn-circle:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: scale(1.1);
}

/* Red control icons for deactivated camera/mic */
.video-controls-overlay .btn-circle.control-disabled {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #f87171;
}

.video-controls-overlay .btn-circle.control-disabled:hover {
    background: rgba(239, 68, 68, 0.3);
}

.btn-report {
    color: #f87171;
}
.btn-report:hover {
    background: rgba(239, 68, 68, 0.18) !important;
    border-color: rgba(239, 68, 68, 0.4) !important;
}

/* --- VIDEO FILTERS SELECTION PANEL --- */
.filter-dropdown-container {
    position: relative;
}

.filter-dropdown {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    display: flex;
    flex-direction: column;
    min-width: 140px;
    padding: 8px;
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    transition: var(--transition-smooth);
}

.filter-dropdown-container:hover .filter-dropdown {
    pointer-events: auto;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.filter-option {
    padding: 8px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.filter-option:hover {
    background: rgba(255, 255, 255, 0.08);
}

.filter-option.active {
    background: var(--accent-purple);
    color: white;
}

/* Video Filter effects */
.filter-cyberpunk {
    filter: hue-rotate(180deg) saturate(1.8) contrast(1.15) brightness(1.05);
}

.filter-vintage {
    filter: sepia(0.6) contrast(0.9) brightness(0.95) saturate(0.85);
}

.filter-noir {
    filter: grayscale(1) contrast(1.3) brightness(0.9);
}

.filter-gold {
    filter: sepia(0.2) saturate(1.4) hue-rotate(-20deg) brightness(1.05);
}

/* --- RADAR MATCHING OVERLAY ANIMATION --- */
.radar-container {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle, #0e0d21 0%, #06050b 100%);
    z-index: 5;
    gap: 30px;
}

.radar-scan {
    position: relative;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.01);
    border: 1px solid rgba(139, 92, 246, 0.15);
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.05), inset 0 0 30px rgba(139, 92, 246, 0.05);
}

.radar-circle {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(139, 92, 246, 0.2);
    width: 100%;
    height: 100%;
    opacity: 0;
    transform: scale(0.1);
    animation: radarPulseAnim 3.5s cubic-bezier(0.1, 0.8, 0.3, 1) infinite;
}

.rc1 { animation-delay: 0s; }
.rc2 { animation-delay: 0.8s; }
.rc3 { animation-delay: 1.6s; }
.rc4 { animation-delay: 2.4s; }

.radar-pulse {
    width: 24px;
    height: 24px;
    background: var(--accent-purple);
    border-radius: 50%;
    box-shadow: 0 0 30px var(--accent-purple), 0 0 10px rgba(255,255,255,0.8);
    position: relative;
    z-index: 2;
    animation: dotPulse 1.5s ease-in-out infinite alternate;
}

.radar-hand {
    position: absolute;
    width: 50%;
    height: 50%;
    top: 0;
    left: 0;
    transform-origin: bottom right;
    background: linear-gradient(45deg, transparent 40%, rgba(139, 92, 246, 0.25) 100%);
    border-right: 1px solid rgba(139, 92, 246, 0.4);
    animation: radarSweep 4s linear infinite;
    border-radius: 100% 0 0 0;
}

.radar-text-box {
    text-align: center;
    z-index: 10;
}

.radar-title {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #e9d5ff;
    animation: flash 1.8s ease-in-out infinite alternate;
}

.radar-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 5px;
}

/* Simulated Stream Container for Simulated Partner */
.simulated-stream-container {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle, #100f27 0%, #030206 100%);
    z-index: 4;
}

.sim-avatar-glow {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    border: 3px solid rgba(139, 92, 246, 0.5);
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.4), 0 0 100px rgba(139, 92, 246, 0.1);
    position: relative;
    z-index: 3;
    animation: avatarFloat 4s ease-in-out infinite;
}

#simulated-visualizer {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0.4;
    z-index: 2;
    pointer-events: none;
}

/* --- MAIN ACTION TOOLBAR (Start/Stop/Next) --- */
.controls-action-bar {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 4px 0;
}

.btn-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border-radius: 50px;
    border: none;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-start {
    flex: 1.2;
    max-width: 260px;
    background: linear-gradient(135deg, var(--accent-green) 0%, #047857 100%);
    color: white;
    padding: 18px 30px;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
}

.btn-start:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.5), 0 0 15px rgba(16, 185, 129, 0.2);
}

.btn-stop {
    flex: 1.2;
    max-width: 260px;
    background: linear-gradient(135deg, var(--accent-red) 0%, #b91c1c 100%);
    color: white;
    padding: 18px 30px;
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.35);
}

.btn-stop:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.5), 0 0 15px rgba(239, 68, 68, 0.2);
}

.btn-next {
    flex: 2;
    max-width: 380px;
    background: linear-gradient(135deg, var(--accent-orange) 0%, #c2410c 100%);
    color: white;
    padding: 18px 30px;
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.3);
}

.btn-next:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(249, 115, 22, 0.5), 0 0 20px rgba(249, 115, 22, 0.2);
    animation: shakeNext 0.4s ease-in-out;
}

.btn-action:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn-action:active {
    transform: translateY(0) scale(0.98);
}

.action-icon {
    width: 20px;
    height: 20px;
}

.keyboard-tips {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.keyboard-tips kbd {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    padding: 2px 6px;
    font-family: monospace;
    color: var(--text-main);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
}

/* --- CHAT & CONTROLS SIDEBAR (Right Panel) --- */
.chat-sidebar {
    flex: 3;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 320px;
    max-width: 440px;
}

.sidebar-section {
    padding: 20px;
}

.border-bottom {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.section-title h3 {
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.description-small {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

/* Interests tag inputs styling */
.interests-input-wrapper {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.interests-input-wrapper input {
    flex: 1;
    padding: 10px 14px;
    font-size: 0.85rem;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.interests-input-wrapper .btn-small {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.3);
    color: #a78bfa;
}

.interests-input-wrapper .btn-small:hover {
    background: var(--accent-purple);
    color: white;
}

.interests-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 80px;
    overflow-y: auto;
}

.interest-tag {
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: #c084fc;
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    animation: scaleIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.interest-tag i {
    width: 12px;
    height: 12px;
    cursor: pointer;
    opacity: 0.7;
    transition: var(--transition-fast);
}

.interest-tag i:hover {
    opacity: 1;
    color: white;
}

/* Chat container styling */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0; /* Dynamic height core */
}

.chat-area .section-title {
    padding: 16px 20px;
    margin-bottom: 0;
}

.chat-messages-container {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
}

/* Chat bubbles styling */
.message-bubble {
    display: flex;
    flex-direction: column;
    max-width: 85%;
    gap: 4px;
    animation: slideUpMessage 0.25s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

.msg-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    font-weight: 700;
}

.msg-sender {
    color: var(--text-main);
}

.msg-time {
    color: var(--text-muted);
    font-weight: 400;
}

.msg-body {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 0.85rem;
    line-height: 1.4;
    word-break: break-word;
}

/* Self messages styles */
.msg-self {
    align-self: flex-end;
}
.msg-self .msg-sender {
    color: #e0f2fe;
}
.msg-self .msg-body {
    background: linear-gradient(135deg, var(--accent-purple) 0%, #6d28d9 100%);
    color: white;
    border-bottom-right-radius: 2px;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
}

/* Stranger messages styles */
.msg-partner {
    align-self: flex-start;
}
.msg-partner .msg-sender {
    color: #e0f2fe;
}
.msg-partner .msg-body {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-main);
    border-bottom-left-radius: 2px;
}

/* System notifications in chat log */
.system-message {
    align-self: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.75rem;
    text-align: center;
    max-width: 90%;
    color: var(--text-muted);
    animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.system-message.match-found {
    border-color: rgba(16, 185, 129, 0.2);
    background: rgba(16, 185, 129, 0.05);
    color: #a7f3d0;
}

.system-message.match-disconnected {
    border-color: rgba(239, 68, 68, 0.2);
    background: rgba(239, 68, 68, 0.05);
    color: #fca5a5;
}

.sys-title {
    display: block;
    font-weight: 800;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.system-message.init .sys-title {
    color: #a78bfa;
}

.partner-typing {
    align-self: flex-start;
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.dot-loader {
    width: 4px;
    height: 4px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: bounce 1s infinite alternate;
}
.dot-loader:nth-child(2) { animation-delay: 0.2s; }
.dot-loader:nth-child(3) { animation-delay: 0.4s; }

/* Chat input bar bottom sidebar */
.chat-input-bar {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    gap: 8px;
    background: rgba(5, 4, 10, 0.2);
}

.chat-input-bar input {
    flex: 1;
    padding: 12px 16px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 0.85rem;
}

.chat-input-bar input:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-send {
    background: var(--accent-purple);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 10px rgba(139, 92, 246, 0.25);
}

.btn-send:hover:not(:disabled) {
    background: #7c3aed;
    transform: scale(1.05);
}

.btn-send:disabled {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.2);
    cursor: not-allowed;
    box-shadow: none;
}

.btn-send i {
    width: 16px;
    height: 16px;
}

/* ==========================================================================
   CSS KEYFRAMES & MICRO-ANIMATIONS
   ========================================================================== */

@keyframes glowShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.92);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes radarPulseAnim {
    0% {
        transform: scale(0.1);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    100% {
        transform: scale(1.1);
        opacity: 0;
    }
}

@keyframes dotPulse {
    from {
        transform: scale(0.85);
        box-shadow: 0 0 10px var(--accent-purple), 0 0 5px rgba(255,255,255,0.4);
    }
    to {
        transform: scale(1.1);
        box-shadow: 0 0 35px var(--accent-purple), 0 0 20px rgba(255,255,255,0.8);
    }
}

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

@keyframes flash {
    from { opacity: 0.5; filter: drop-shadow(0 0 2px rgba(233, 213, 255, 0.2)); }
    to { opacity: 1; filter: drop-shadow(0 0 10px rgba(233, 213, 255, 0.8)); }
}

@keyframes bounce {
    from { transform: translateY(0); }
    to { transform: translateY(-4px); }
}

@keyframes avatarFloat {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-8px) rotate(1deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}

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

/* ==========================================================================
   RESPONSIVE DESIGN (BREAKPOINTS)
   ========================================================================== */

/* Medium Devices (Tablets, small laptops) */
@media (max-width: 1024px) {
    .app-main {
        flex-direction: column;
        overflow-y: auto;
    }
    
    .video-section {
        flex: none;
        height: 60vh;
    }
    
    .chat-sidebar {
        flex: none;
        width: 100%;
        max-width: none;
        height: 40vh;
    }
    
    .chat-messages-container {
        height: 200px;
    }
}

/* Small Devices (Mobile Phones) */
@media (max-width: 768px) {
    .app-layout {
        padding: 8px;
        gap: 8px;
    }
    
    .app-header {
        padding: 0 12px;
        height: 60px;
    }
    
    .logo-small {
        font-size: 1.8rem;
    }
    
    .current-mode-pill {
        padding: 6px 12px;
        font-size: 0.75rem;
    }
    
    .video-section {
        height: 62vh;
        gap: 8px;
    }
    
    .videos-grid {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 1fr;
        gap: 8px;
    }
    
    .partner-badge {
        padding: 4px 8px;
        font-size: 0.75rem;
    }
    
    .video-controls-overlay {
        bottom: 10px;
        padding: 6px 10px;
    }
    
    .video-controls-overlay .btn-circle {
        width: 36px;
        height: 36px;
    }
    
    .btn-action {
        font-size: 0.95rem;
        padding: 14px 20px;
    }
    
    .controls-action-bar {
        gap: 10px;
    }
    
    .onboarding-card {
        padding: 24px 16px;
    }
    
    .logo {
        font-size: 2.8rem;
    }
    
    .mode-selector-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .avatar-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 5px;
    }
}
