@property --angle {
    syntax: "<angle>";
    inherits: false;
    initial-value: 91deg;
}

:root {
    --primary-color: #fbbf24;
    --primary-dark: #f59e0b;
    --secondary-color: #06d6a0;
    --accent-color: #8b5cf6;
    --error: #ef4444;
    --success: #10b981;
    --turquoise: #06d6a0;
    --neon-purple: #a855f7;
}

:root[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --surface-glass: rgba(255, 255, 255, 0.9);
    --surface-glass-strong: rgba(255, 255, 255, 0.75);
    --border-glass: rgba(148, 163, 184, 0.4);
    --shadow-color: rgba(0, 0, 0, 0.1);
    --gradient-bg: linear-gradient(135deg, #ead066 0%, #ffc505 100%);
    --chat-bg: linear-gradient(145deg, rgba(255,255,255,0.8), rgba(248,250,252,0.9));
    --card-bg: rgba(255, 255, 255, 0.2);
    --card-border: 0.5px solid rgba(148, 163, 184, 0.3);
    --rain-color: #4a90e2;
}

:root[data-theme="dark"] {
    --bg-primary: #000000;
    --bg-secondary: #111111;
    --bg-tertiary: #1a1a1a;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --surface-glass: rgba(20, 20, 20, 0.8);
    --surface-glass-strong: rgba(30, 30, 30, 0.85);
    --border-glass: rgba(255, 255, 255, 0.15);
    --shadow-color: rgba(0, 0, 0, 0.4);
    --gradient-bg: linear-gradient(135deg, #000000 0%, #1a1a1a 50%, #2a2a2a 100%);
    --chat-bg: linear-gradient(145deg, rgba(10,10,10,0.9), rgba(20,20,20,0.95));
    --card-bg: rgba(20, 20, 20, 0.8);
    --card-border: 0.5px solid rgba(255, 255, 255, 0.15);
    --rain-color: #60a5fa;
}

/* FIXED: Modern viewport solution */
:root {
  --app-height: 100vh;
  --app-height: 100svh;
}

@supports (height: 100dvh) {
  :root {
    --app-height: 100dvh;
  }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

:root[data-theme="light"] body {
    background: linear-gradient(135deg, 
        #fbbf24 0%, 
        #f59e0b 25%, 
        #06d6a0 75%, 
        #059669 100%);
    background-attachment: fixed;
}

:root[data-theme="dark"] body {
    background: linear-gradient(135deg, 
        #0f0f23 0%, 
        #1a1a2e 25%, 
        #16213e 50%,
        #0f0f23 100%);
    background-attachment: fixed;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
    transition: all 0.3s ease;
    line-height: 1.6;
    position: relative;
}

:root[data-theme="light"] body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(251, 191, 36, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(6, 214, 160, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(139, 92, 246, 0.2) 0%, transparent 50%);
    animation: floatingOrbs 20s ease-in-out infinite;
    z-index: -2;
    pointer-events: none;
    will-change: transform;
}

:root[data-theme="dark"] body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 15% 25%, rgba(138, 43, 226, 0.4) 0%, transparent 40%),
        radial-gradient(circle at 85% 75%, rgba(75, 0, 130, 0.3) 0%, transparent 45%),
        radial-gradient(circle at 50% 20%, rgba(25, 25, 112, 0.35) 0%, transparent 50%),
        radial-gradient(1px 1px at 20% 30%, #fff, transparent),
        radial-gradient(1px 1px at 40% 70%, rgba(255,255,255,0.8), transparent),
        radial-gradient(2px 2px at 90% 40%, rgba(255,255,255,0.6), transparent),
        radial-gradient(1px 1px at 75% 10%, rgba(255,255,255,0.9), transparent),
        radial-gradient(1px 1px at 10% 80%, rgba(255,255,255,0.7), transparent);
    animation: floatingOrbs 25s ease-in-out infinite;
    z-index: -2;
    pointer-events: none;
    will-change: transform;
}

:root[data-theme="light"] body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 15% 15%, rgba(255, 255, 255, 0.1) 0%, transparent 25%),
        radial-gradient(circle at 85% 85%, rgba(255, 255, 255, 0.08) 0%, transparent 30%),
        radial-gradient(circle at 70% 30%, rgba(255, 255, 255, 0.06) 0%, transparent 35%),
        radial-gradient(circle at 30% 70%, rgba(255, 255, 255, 0.05) 0%, transparent 40%);
    z-index: -1;
    pointer-events: none;
    opacity: 0.8;
}

:root[data-theme="dark"] body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 25% 25%, rgba(138, 43, 226, 0.08) 0%, transparent 35%),
        radial-gradient(circle at 75% 75%, rgba(75, 0, 130, 0.06) 0%, transparent 40%),
        radial-gradient(circle at 60% 40%, rgba(25, 25, 112, 0.05) 0%, transparent 45%),
        radial-gradient(circle at 40% 80%, rgba(72, 61, 139, 0.04) 0%, transparent 50%);
    z-index: -1;
    pointer-events: none;
    opacity: 0.9;
}

@keyframes floatingOrbs {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg) scale(1);
    }
    25% {
        transform: translate(30px, -30px) rotate(90deg) scale(1.1);
    }
    50% {
        transform: translate(-20px, 20px) rotate(180deg) scale(0.9);
    }
    75% {
        transform: translate(20px, 30px) rotate(270deg) scale(1.05);
    }
}

:root[data-theme="light"] .landing-page {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

:root[data-theme="dark"] .landing-page {
    background: rgba(15, 15, 35, 0.3);
    backdrop-filter: blur(15px);
}

.rain-background {
    display: none !important;
}

/* Connection Status Bar */
.connection-status-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--error);
    color: white;
    padding: 0.5rem;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 9998;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.connection-status-bar.show {
    transform: translateY(0);
}

.connection-status-bar.connecting {
    background: var(--primary-color);
    color: #000;
}

.connection-status-bar.connected {
    background: var(--success);
    color: white;
}

/* FIXED: Age Confirmation Modal - No white layers */
.age-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    backdrop-filter: blur(15px);
    pointer-events: auto;
}

.age-modal-content {
    background: var(--surface-glass-strong);
    backdrop-filter: blur(30px);
    padding: 3rem;
    border-radius: 24px;
    text-align: center;
    max-width: 450px;
    margin: 0 1rem;
    border: 1px solid var(--border-glass);
    box-shadow: 0 25px 50px var(--shadow-color);
    animation: slideInScale 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    z-index: 100001;
    pointer-events: auto;
    overflow: hidden;
}

.age-modal h2 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    font-size: 1.8rem;
    font-weight: 700;
}

.age-modal p {
    margin-bottom: 2.5rem;
    opacity: 0.9;
    line-height: 1.6;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.age-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

/* FIXED: Age buttons - No white layer animations */
.age-btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 1rem;
    position: relative;
    z-index: 100000;
    pointer-events: auto !important;
    touch-action: manipulation;
    min-height: 56px;
    min-width: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* REMOVED: White layer animation that was causing the issue */
.age-btn.confirm {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #000;
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.3);
}

.age-btn.confirm:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(251, 191, 36, 0.4);
}

.age-btn.deny {
    background: linear-gradient(135deg, var(--error), #dc2626);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.age-btn.deny:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
}

/* Landing Page */
.landing-page {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    text-align: center;
    position: relative;
}

:root[data-theme="light"] .landing-page::before {
    content: '';
    position: absolute;
    top: 10%;
    left: 10%;
    width: 200px;
    height: 200px;
    background: rgba(251, 191, 36, 0.1);
    border-radius: 50%;
    filter: blur(40px);
    animation: float1 8s ease-in-out infinite;
    z-index: -1;
}

:root[data-theme="light"] .landing-page::after {
    content: '';
    position: absolute;
    bottom: 15%;
    right: 15%;
    width: 150px;
    height: 150px;
    background: rgba(6, 214, 160, 0.1);
    border-radius: 50%;
    filter: blur(30px);
    animation: float2 10s ease-in-out infinite reverse;
    z-index: -1;
}

:root[data-theme="dark"] .landing-page::before {
    content: '';
    position: absolute;
    top: 10%;
    left: 10%;
    width: 250px;
    height: 250px;
    background: rgba(138, 43, 226, 0.15);
    border-radius: 50%;
    filter: blur(50px);
    animation: float1 12s ease-in-out infinite;
    z-index: -1;
}

:root[data-theme="dark"] .landing-page::after {
    content: '';
    position: absolute;
    bottom: 15%;
    right: 15%;
    width: 180px;
    height: 180px;
    background: rgba(75, 0, 130, 0.2);
    border-radius: 50%;
    filter: blur(35px);
    animation: float2 14s ease-in-out infinite reverse;
    z-index: -1;
}

@keyframes float1 {
    0%, 100% { transform: translateY(0px) scale(1); }
    50% { transform: translateY(-20px) scale(1.1); }
}

@keyframes float2 {
    0%, 100% { transform: translateY(0px) scale(1); }
    50% { transform: translateY(15px) scale(0.9); }
}

:root[data-theme="light"] .form-container {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

:root[data-theme="dark"] .form-container {
    background: rgba(15, 15, 35, 0.4);
    backdrop-filter: blur(30px);
    border: 1px solid rgba(138, 43, 226, 0.3);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(138, 43, 226, 0.2),
        0 0 40px rgba(138, 43, 226, 0.1);
}

/* FIXED: History Button */
.history-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    background: var(--surface-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: 50px;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
    touch-action: manipulation;
    z-index: 1000;
    pointer-events: auto;
}

.history-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px var(--shadow-color);
}

.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--surface-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: 50px;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
    touch-action: manipulation;
    z-index: 1000;
    pointer-events: auto;
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px var(--shadow-color);
}

.logo-container {
    position: relative;
    z-index: 1;
    margin-bottom: 3rem;
}

:root[data-theme="light"] .logo {
    background: linear-gradient(135deg, 
        #fbbf24 0%, 
        #06d6a0 50%, 
        #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 
        0 4px 20px rgba(251, 191, 36, 0.5),
        0 0 40px rgba(6, 214, 160, 0.3);
}

:root[data-theme="dark"] .logo {
    background: linear-gradient(135deg, 
        #a855f7 0%, 
        #6366f1 25%,
        #06b6d4 50%, 
        #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 
        0 4px 25px rgba(168, 85, 247, 0.6),
        0 0 50px rgba(99, 102, 241, 0.4),
        0 0 80px rgba(139, 92, 246, 0.3);
}

.logo {
    font-size: 4.5rem;
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: 1rem;
    animation: slideInDown 1s ease-out;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
    position: relative;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* FIXED: One-line tagline that doesn't cut off */
/* FIXED: Tagline positioning and visibility - Replace lines 477-540 in style.css */

/* FIXED: One-line tagline that doesn't cut off */
.tagline {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    animation: slideInUp 1s ease-out 0.3s both;
    font-weight: 500;
    height: 60px; /* Increased height */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.4;
    width: 100%;
    max-width: 800px; /* Increased from 600px */
    margin-left: auto;
    margin-right: auto;
    padding: 0 2rem; /* Increased padding */
    box-sizing: border-box;
    position: relative;
    overflow: visible; /* Changed from hidden */
}

.tagline-text {
    opacity: 0;
    transition: opacity 0.8s ease;
    position: absolute;
    text-align: center;
    width: 100%;
    max-width: 800px; /* Match parent width */
    padding: 0 2rem;
    box-sizing: border-box;
    /* FIXED: Allow text to flow naturally */
    overflow: visible;
    white-space: normal; /* Changed from nowrap */
    word-wrap: break-word;
    hyphens: auto;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.tagline-text.active {
    opacity: 1;
}

/* Mobile tagline adjustment - FIXED with better responsive design */
@media (max-width: 768px) {
    .tagline {
        font-size: 1.2rem;
        height: 70px; /* Increased height for mobile */
        max-width: 95vw;
        padding: 0 1.5rem;
        margin-bottom: 2rem;
    }
    
    .tagline-text {
        font-size: 1.2rem;
        max-width: 95vw;
        padding: 0 1.5rem;
        line-height: 1.3;
    }
}

@media (max-width: 480px) {
    .tagline {
        font-size: 1.1rem;
        height: 80px; /* Even more height for small screens */
        max-width: 90vw;
        padding: 0 1rem;
    }
    
    .tagline-text {
        font-size: 1.1rem;
        max-width: 90vw;
        padding: 0 1rem;
        line-height: 1.4;
    }
}

/* Extra small screens */
@media (max-width: 320px) {
    .tagline {
        font-size: 1rem;
        height: 90px; /* Maximum height for very small screens */
        max-width: 85vw;
        padding: 0 0.5rem;
    }
    
    .tagline-text {
        font-size: 1rem;
        max-width: 85vw;
        padding: 0 0.5rem;
        line-height: 1.5;
    }
}

.form-container {
    position: relative;
    z-index: 1;
    border-radius: 28px;
    padding: 3rem;
    animation: fadeIn 1s ease-out 0.6s both;
    max-width: 500px;
    width: 100%;
    position: relative;
    overflow: hidden;
}

:root[data-theme="light"] .form-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    animation: shimmer 3s ease-in-out infinite;
    z-index: -1;
    pointer-events: none !important;
}

:root[data-theme="dark"] .form-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(138, 43, 226, 0.15),
        transparent
    );
    animation: shimmer 4s ease-in-out infinite;
    z-index: -1;
    pointer-events: none !important;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.input-group {
    margin-bottom: 2rem;
    position: relative;
    z-index: 10;
}

:root[data-theme="light"] .nickname-input {
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

:root[data-theme="light"] .nickname-input:focus {
    border-color: rgba(251, 191, 36, 0.6);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 
        0 12px 25px rgba(251, 191, 36, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

:root[data-theme="dark"] .nickname-input {
    border: 2px solid rgba(138, 43, 226, 0.3);
    background: rgba(15, 15, 35, 0.3);
    backdrop-filter: blur(20px);
    box-shadow: 
        inset 0 1px 0 rgba(138, 43, 226, 0.1),
        0 0 20px rgba(138, 43, 226, 0.05);
}

:root[data-theme="dark"] .nickname-input:focus {
    border-color: rgba(168, 85, 247, 0.7);
    background: rgba(15, 15, 35, 0.5);
    box-shadow: 
        0 12px 30px rgba(168, 85, 247, 0.3),
        inset 0 1px 0 rgba(168, 85, 247, 0.2),
        0 0 30px rgba(168, 85, 247, 0.15);
}

.nickname-input {
    width: 100%;
    padding: 1.25rem 1.5rem;
    font-size: 1.1rem;
    border-radius: 20px;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-primary);
    font-weight: 500;
    cursor: text;
    user-select: text;
    touch-action: manipulation;
    pointer-events: auto !important;
    z-index: 100;
    position: relative;
    display: block;
}

.nickname-input:focus {
    transform: translateY(-2px);
}

.nickname-input::placeholder {
    color: var(--text-secondary);
}

.input-group::before,
.input-group::after {
    pointer-events: none !important;
}

.interests-container {
    margin-bottom: 2rem;
    position: relative;
    z-index: 10;
}

.interests-label {
    display: block;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.interests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    z-index: 10;
    position: relative;
}

/* FIXED: Interest tags - clickable and proper styling */
:root[data-theme="light"] .interest-tag {
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

:root[data-theme="light"] .interest-tag:hover {
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

:root[data-theme="light"] .interest-tag.selected {
    background: rgba(251, 191, 36, 0.2);
    border-color: rgba(251, 191, 36, 0.5);
    box-shadow: 
        0 8px 25px rgba(251, 191, 36, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

:root[data-theme="dark"] .interest-tag {
    border: 2px solid rgba(138, 43, 226, 0.2);
    background: rgba(15, 15, 35, 0.3);
    backdrop-filter: blur(20px);
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(138, 43, 226, 0.1),
        0 0 10px rgba(138, 43, 226, 0.05);
}

:root[data-theme="dark"] .interest-tag:hover {
    background: rgba(15, 15, 35, 0.5);
    border-color: rgba(168, 85, 247, 0.4);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(168, 85, 247, 0.2),
        0 0 20px rgba(168, 85, 247, 0.15);
}

:root[data-theme="dark"] .interest-tag.selected {
    background: rgba(168, 85, 247, 0.2);
    border-color: rgba(168, 85, 247, 0.6);
    box-shadow: 
        0 8px 25px rgba(168, 85, 247, 0.4),
        inset 0 1px 0 rgba(168, 85, 247, 0.3),
        0 0 30px rgba(168, 85, 247, 0.2);
}

.interest-tag {
    padding: 1rem 1.25rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
    user-select: none;
    touch-action: manipulation;
    min-height: 56px;
    pointer-events: auto !important;
    z-index: 100;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
}

.interest-tag:hover {
    transform: translateY(-3px);
}

.interest-tag.selected {
    transform: translateY(-3px);
    font-weight: 700;
}

/* Mood tags styling */
.moods-container {
    margin-bottom: 2rem;
    position: relative;
    z-index: 10;
}

.moods-label {
    display: block;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.moods-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    z-index: 10;
    position: relative;
}

.mood-tag {
    padding: 1rem 1rem;
    border: 2px solid var(--border-glass);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
    user-select: none;
    touch-action: manipulation;
    min-height: 52px;
    pointer-events: auto !important;
    z-index: 100;
    background: var(--surface-glass);
    backdrop-filter: blur(15px);
}

:root[data-theme="light"] .mood-tag {
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

:root[data-theme="light"] .mood-tag:hover {
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

:root[data-theme="dark"] .mood-tag {
    border: 2px solid rgba(138, 43, 226, 0.2);
    background: rgba(15, 15, 35, 0.3);
    backdrop-filter: blur(20px);
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(138, 43, 226, 0.1),
        0 0 10px rgba(138, 43, 226, 0.05);
}

:root[data-theme="dark"] .mood-tag:hover {
    background: rgba(15, 15, 35, 0.5);
    border-color: rgba(168, 85, 247, 0.4);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(168, 85, 247, 0.2),
        0 0 20px rgba(168, 85, 247, 0.15);
}

.mood-tag:hover {
    transform: translateY(-3px);
    background: var(--surface-glass-strong);
    box-shadow: 0 8px 25px var(--shadow-color);
}

.mood-tag.selected {
    background: linear-gradient(135deg, var(--accent-color), #7c3aed) !important;
    color: white !important;
    border-color: var(--accent-color) !important;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.4) !important;
    font-weight: 700;
}

.language-select {
    width: 100%;
    padding: 1.25rem 1.5rem;
    font-size: 1rem;
    border: 2px solid var(--border-glass);
    border-radius: 16px;
    background: var(--surface-glass);
    backdrop-filter: blur(10px);
    outline: none;
    margin-bottom: 2rem;
    color: var(--text-primary);
    font-weight: 500;
    position: relative;
    z-index: 1;
    cursor: pointer;
    touch-action: manipulation;
}

.language-select:focus {
    border-color: var(--primary-color);
    background: var(--surface-glass-strong);
    box-shadow: 0 8px 25px rgba(251, 191, 36, 0.3);
}

.language-select option {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.slide-button-container {
    position: relative;
    width: 100%;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 30px;
    cursor: pointer;
    overflow: hidden;
    user-select: none;
    margin: 1.5rem 0;
    box-shadow: 0 8px 25px rgba(251, 191, 36, 0.3);
    z-index: 100;
    transition: all 0.3s ease;
    touch-action: manipulation;
    pointer-events: auto !important;
}

.slide-button-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(251, 191, 36, 0.4);
}

.slide-track {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, var(--primary-color), var(--primary-dark));
    border-radius: 30px;
}

.slide-button {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 52px;
    height: 52px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    font-size: 1.2rem;
    color: var(--primary-color);
    z-index: 2;
}

.slide-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #000;
    font-weight: 700;
    font-size: 1.1rem;
    pointer-events: none;
    z-index: 1;
}

.slide-button-container.sliding .slide-button {
    transform: translateX(calc(100% - 60px));
}

/* Connecting Screen */
.connecting-screen {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    color: var(--text-primary);
    text-align: center;
    padding: 2rem;
    background: var(--gradient-bg);
}

.connection-animation {
    position: relative;
    margin-bottom: 2rem;
    width: 200px;
    height: 200px;
}

.lottie-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.lottie-container svg {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
}

.connecting-text {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    justify-content: center;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--success);
    animation: blink 1.5s ease-in-out infinite;
}

.fun-fact {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    padding: 1.5rem;
    border-radius: 20px;
    border: var(--card-border);
    max-width: 400px;
    margin: 1.5rem auto;
    color: var(--text-secondary);
    line-height: 1.6;
    box-shadow: 0 8px 25px var(--shadow-color);
    font-size: 0.9rem;
}

.fun-fact-title {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* FIXED: Chat Screen Layout - No gaps */
.chat-screen {
    display: none;
    flex-direction: column;
    height: 100vh;
    height: var(--app-height);
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.chat-header {
    background: rgba(255, 255, 255, 0.08); 
    backdrop-filter: blur(12px);   
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    box-shadow: 0 4px 20px var(--shadow-color);
    z-index: 10;
    flex-shrink: 0;
    min-height: 70px;
}

/* FIXED: Back and Skip buttons - fully clickable */
.back-btn, .skip-btn {
    background: var(--surface-glass);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-primary);
    font-weight: 600;
    z-index: 1000;
    touch-action: manipulation;
    pointer-events: auto !important;
}

.back-btn {
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
    min-width: 44px;
}

.skip-btn {
    background: linear-gradient(135deg, var(--error), #dc2626);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    font-size: 0.9rem;
    border: none;
    flex-shrink: 0;
}

.back-btn:hover, .skip-btn:hover {
    background: var(--surface-glass-strong);
    transform: scale(1.05);
}

.skip-btn:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
}

.user-avatar {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-weight: bold;
    font-size: 1.2rem;
    position: relative;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
    z-index: 1;
    flex-shrink: 0;
}

.online-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background: var(--success);
    border-radius: 50%;
    border: 2px solid var(--bg-primary);
}

.user-info {
    flex: 1;
    z-index: 1;
    min-width: 0;
}

.user-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-status {
    font-size: 0.9rem;
    color: var(--success);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* FIXED: Chat Messages - No gaps */
.chat-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: var(--surface-glass);
    backdrop-filter: blur(20px);
    position: relative;
    line-height: 1.5;
    min-height: 0;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    -ms-overflow-style: none;
    margin: 0;
    border: none;
    box-sizing: border-box;
}

.chat-messages::-webkit-scrollbar {
    display: none;
}

.message-container {
    display: flex;
    flex-direction: column;
    position: relative;
    margin-bottom: 0.5rem;
    width: 100%;
}

.message-container.sent {
    align-items: flex-end;
}

.message-container.received {
    align-items: flex-start;
}

.message-container.system {
    align-items: center;
}

.message {
    max-width: 85%;
    padding: 1rem 1.25rem;
    border-radius: 20px;
    word-wrap: break-word;
    animation: messageSlide 0.4s ease-out;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(15px);
    border: 1px solid var(--border-glass);
    line-height: 1.4;
    font-size: 0.95rem;
    user-select: none;
    touch-action: manipulation;
}

.message:hover {
    transform: scale(1.02);
}

.message.sent {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #000;
    border-bottom-right-radius: 6px;
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.3);
    font-weight: 500;
}

.message.received {
    background: var(--surface-glass-strong);
    color: var(--text-primary);
    border-bottom-left-radius: 6px;
    box-shadow: 0 4px 15px var(--shadow-color);
}

.message.system {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-align: center;
    border-radius: 14px;
    padding: 0.75rem 1rem;
    max-width: 80%;
    font-style: italic;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Translation message styles */
.message-translation {
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 8px;
    font-size: 0.85rem;
    font-style: italic;
    color: var(--text-secondary);
    border-left: 3px solid #6366f1;
    position: relative;
    animation: fadeInUp 0.3s ease-out;
}

.translation-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6366f1;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.translation-label::before {
    content: '🌐';
    font-size: 0.8rem;
}

.original-message {
    background: rgba(251, 191, 36, 0.15);
    border-left: 3px solid var(--primary-color);
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 10px;
    font-size: 0.85rem;
    opacity: 0.85;
    line-height: 1.3;
    border: 1px solid rgba(251, 191, 36, 0.2);
    word-wrap: break-word;
    max-height: 2.6em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.message-time {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 0.5rem;
    color: var(--text-secondary);
}

.message-container.sent .message-time {
    text-align: right;
}

.message-container.received .message-time {
    text-align: left;
}

.message-reactions {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.reaction {
    background: var(--surface-glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 0.3rem 0.6rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: reactionPop 0.3s ease-out;
    touch-action: manipulation;
}

.reaction:hover {
    background: var(--primary-color);
    color: #000;
    transform: scale(1.1);
}

/* CRITICAL FIX: Chat Input Container - Zero gaps */
.chat-input-container {
    padding: 0.75rem;
    margin: 0;
    background: var(--surface-glass-strong);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    box-shadow: 0 -4px 20px var(--shadow-color);
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    flex-shrink: 0;
    min-height: 80px;
    max-height: 200px;
    border-bottom: 0;
    transform: translateZ(0);
    will-change: transform;
    box-sizing: border-box;
}

.reply-preview-container {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0 0.5rem;
}

.reply-preview {
    background: rgba(251, 191, 36, 0.15);
    border-left: 3px solid var(--primary-color);
    padding: 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    opacity: 0.9;
    backdrop-filter: blur(10px);
    flex: 1;
    max-height: 4em;
    overflow: hidden;
    line-height: 1.3;
    border: 1px solid rgba(251, 191, 36, 0.2);
    word-wrap: break-word;
}

.reply-cancel {
    background: var(--surface-glass);
    border: 1px solid var(--border-glass);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    flex-shrink: 0;
    touch-action: manipulation;
}

.reply-cancel:hover {
    background: var(--error);
    color: white;
    transform: scale(1.1);
}

/* FIXED: Input elements positioning */
.mic-btn {
    width: 48px;
    height: 48px;
    background: var(--surface-glass);
    border: 1px solid var(--border-glass);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    color: var(--text-primary);
    flex-shrink: 0;
    order: 1;
    touch-action: manipulation;
    min-width: 48px;
    min-height: 48px;
    margin: 0;
    pointer-events: auto;
}

.mic-btn:hover {
    background: var(--primary-color);
    color: #000;
    transform: scale(1.1);
}

.input-wrapper {
    flex: 1;
    position: relative;
    order: 2;
    min-width: 0;
    align-items: flex-end;
}

.chat-input {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid var(--border-glass);
    border-radius: 24px;
    outline: none;
    font-size: 16px;
    transition: all 0.3s ease;
    resize: none;
    overflow: hidden;  
    min-height: 48px;
    max-height: 120px;
    background: transparent;
    backdrop-filter: blur(15px);
    color: var(--text-primary);
    line-height: 1.4;
    font-family: inherit;
    box-sizing: border-box;
    cursor: text;
    user-select: text;
    touch-action: manipulation;
    pointer-events: auto !important;
    position: relative;
    z-index: 100;
    display: block;
}

.chat-input:focus {
    border-color: var(--primary-color);
    background: var(--surface-glass-strong);
    box-shadow: 0 8px 25px rgba(251, 191, 36, 0.2);
}

.chat-input::placeholder {
    color: var(--text-secondary);
}

.chat-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.send-btn {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--turquoise), #059669);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    font-weight: bold;
    box-shadow: 0 8px 20px rgba(6, 214, 160, 0.4);
    flex-shrink: 0;
    order: 3;
    touch-action: manipulation;
    min-width: 48px;
    min-height: 48px;
    margin: 0;
    pointer-events: auto;
}

.send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 25px rgba(6, 214, 160, 0.6);
}

.send-btn:disabled {
    background: rgba(255, 255, 255, 0.1);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* History Modal Styles */
.history-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(10px);
}

.history-modal.active {
    display: flex;
}

.history-content {
    background: var(--surface-glass-strong);
    backdrop-filter: blur(30px);
    border-radius: 20px;
    padding: 2rem;
    max-width: 90%;
    max-height: 80%;
    overflow-y: auto;
    border: 1px solid var(--border-glass);
    box-shadow: 0 20px 40px var(--shadow-color);
    min-width: 300px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.history-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.history-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    pointer-events: auto;
}

.history-close:hover {
    background: var(--surface-glass);
    color: var(--text-primary);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.history-item {
    background: var(--surface-glass);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.history-item:hover {
    background: var(--surface-glass-strong);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--shadow-color);
}

.history-user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.history-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-weight: bold;
}

.history-details {
    display: flex;
    flex-direction: column;
}

.history-name {
    font-weight: 600;
    color: var(--text-primary);
}

.history-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.history-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.history-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
}

.history-status.online {
    color: var(--success);
}

.history-status.offline {
    color: var(--text-secondary);
}

.connect-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #000;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    pointer-events: auto;
}

.connect-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.4);
}

.connect-btn:disabled {
    background: var(--surface-glass);
    color: var(--text-secondary);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Context Menu */
.context-menu {
    position: fixed;
    background: var(--surface-glass-strong);
    backdrop-filter: blur(30px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 0.5rem;
    display: none;
    z-index: 1000;
    box-shadow: 0 8px 25px var(--shadow-color);
    min-width: 200px;
}

.context-menu-item {
    padding: 0.8rem 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-weight: 500;
    touch-action: manipulation;
    pointer-events: auto;
}

.context-menu-item:hover {
    background: var(--surface-glass-strong);
    transform: scale(1.02);
}

.context-menu-divider {
    height: 1px;
    background: var(--border-glass);
    margin: 0.5rem 0;
}

.emoji-picker {
    display: flex;
    gap: 0.5rem;
    padding: 0.8rem;
    background: var(--surface-glass-strong);
    border-radius: 12px;
    margin-top: 0.5rem;
    flex-wrap: wrap;
    border: 1px solid var(--border-glass);
}

.emoji-option {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    background: var(--surface-glass);
    border: 1px solid var(--border-glass);
    touch-action: manipulation;
    pointer-events: auto !important;
    z-index: 1000;
}

.emoji-option:hover {
    background: var(--primary-color);
    transform: scale(1.2);
    color: #000;
}

/* Timing Popup */
.timing-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.timing-popup.active {
    display: flex;
}

.popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.popup-content {
    position: relative;
    background: var(--surface-glass-strong);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 24px;
    margin: 20px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1;
    border: 1px solid var(--border-glass);
    text-align: center;
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.close-btn {
    background: none;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #666;
    transition: all 0.2s ease;
    pointer-events: auto !important;
    z-index: 1000;
}

.close-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #000;
}

.popup-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.popup-message {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.popup-timer {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #000;
    padding: 0.75rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.1rem;
}

/* Connection Request Notification */
.connection-request-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--surface-glass-strong);
    backdrop-filter: blur(30px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 20px 40px var(--shadow-color);
    z-index: 10000;
    max-width: 350px;
    animation: slideInFromRight 0.5s ease-out;
}

.connection-request-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.request-avatar {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-weight: bold;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.request-info {
    flex: 1;
    min-width: 0;
}

.request-title {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.request-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.request-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    justify-content: flex-end;
}

.accept-btn {
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    pointer-events: auto;
}

.accept-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.decline-btn {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-glass);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    pointer-events: auto;
}

.decline-btn:hover {
    background: var(--error);
    color: white;
    border-color: var(--error);
}

/* Voice Recording UI */
.voice-recording {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.recording-container {
    background: var(--surface-glass-strong);
    backdrop-filter: blur(30px);
    border-radius: 24px;
    padding: 3rem;
    text-align: center;
    border: 1px solid var(--border-glass);
    box-shadow: 0 20px 40px var(--shadow-color);
    min-width: 300px;
    max-width: 90%;
}

.recording-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--error), #dc2626);
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    animation: recordingPulse 1.5s ease-in-out infinite;
}

.recording-timer {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.recording-instruction {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 2rem;
    line-height: 1.5;
}

.recording-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.cancel-recording {
    background: var(--surface-glass);
    border: 1px solid var(--border-glass);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--error);
    transition: all 0.3s ease;
    touch-action: manipulation;
    pointer-events: auto;
}

.cancel-recording:hover {
    background: var(--error);
    color: white;
    transform: scale(1.1);
}

/* Message status styles */
.message-status {
    font-size: 0.75rem;
    margin-top: 0.25rem;
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.message-status.sending {
    color: var(--text-secondary);
}

.message-status.sent {
    color: var(--success);
}

.message-status.failed {
    color: var(--error);
}

.retry-btn {
    background: var(--primary-color);
    color: #000;
    border: none;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 0.5rem;
    transition: all 0.3s ease;
    pointer-events: auto;
}

.retry-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.4);
}

/* FIXED: Mobile responsive */
@media (max-width: 768px) {
    .logo {
        font-size: 3.5rem;
    }

    .form-container {
        padding: 2rem;
        margin: 0 1rem;
    }

    .interests-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }

    .interest-tag {
        padding: 0.8rem 1rem;
        font-size: 0.85rem;
        min-height: 52px;
    }

    .moods-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
    
    .mood-tag {
        padding: 0.8rem 0.8rem;
        font-size: 0.85rem;
        min-height: 48px;
    }

    .message {
        max-width: 90%;
    }

    .chat-header {
        padding: 0.8rem;
        min-height: 65px;
    }

    .user-avatar {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }

    .back-btn {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
        min-width: 40px;
    }

    .skip-btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.85rem;
    }

    .send-btn, .mic-btn {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
        min-width: 44px;
        min-height: 44px;
    }

    .context-menu {
        min-width: 180px;
        font-size: 0.85rem;
    }

    .emoji-option {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .theme-toggle, .history-btn {
        top: 15px;
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }

    .history-btn {
        left: 15px;
    }

    .theme-toggle {
        right: 15px;
    }

    .chat-input-container {
        padding: 0.5rem;
        gap: 0.5rem;
        min-height: 70px;
        position: fixed;
        bottom: 0;
        width: 100%;
        margin: 0;
        border-radius: 0;
    }

    .chat-messages {
        padding-bottom: 90px;
        margin-bottom: 0;
    }

    .age-buttons {
        flex-direction: column;
        gap: 1rem;
    }

    .age-btn {
        min-height: 52px;
        width: 100%;
    }

    .chat-screen {
        height: 100vh;
        height: 100dvh;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .history-content {
        padding: 1.5rem;
        max-width: 95%;
        margin: 0 auto;
    }
    
    .history-item {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .history-actions {
        width: 100%;
        justify-content: center;
        gap: 1rem;
        flex-direction: row;
    }
    
    .connect-btn {
        min-width: 100px;
    }

    .connection-request-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .connection-request-content {
        flex-direction: column;
        text-align: center;
    }
    
    .request-actions {
        width: 100%;
        justify-content: center;
    }
    
    .accept-btn,
    .decline-btn {
        flex: 1;
        min-width: 80px;
    }

    .tagline {
        font-size: 1.1rem;
        height: 35px;
        padding: 0 1rem;
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 3rem;
    }

    .form-container {
        padding: 1.5rem;
    }

    .interests-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
    }

    .interest-tag {
        padding: 0.7rem 0.8rem;
        font-size: 0.8rem;
        min-height: 48px;
    }

    .moods-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
    }
    
    .mood-tag {
        padding: 0.7rem 0.6rem;
        font-size: 0.8rem;
        min-height: 44px;
    }

    .age-modal-content {
        padding: 2rem;
    }

    .chat-input-container {
        padding: 0.4rem;
        gap: 0.5rem;
        min-height: 65px;
    }

    .send-btn, .mic-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
        min-width: 40px;
        min-height: 40px;
    }

    .recording-container {
        padding: 2rem;
        min-width: 250px;
    }

    .recording-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    .chat-header {
        padding: 0.6rem;
        min-height: 60px;
    }

    .back-btn {
        width: 36px;
        height: 36px;
        font-size: 1rem;
        min-width: 36px;
    }

    .user-avatar {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .skip-btn {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }

    .chat-messages {
        padding-bottom: 85px;
    }

    .tagline {
        font-size: 1rem;
        height: 30px;
        padding: 0 0.5rem;
    }
}

/* Landscape mobile fixes */
@media (max-height: 500px) and (orientation: landscape) {
    .chat-header {
        padding: 0.5rem;
        min-height: 50px;
    }
    
    .chat-input-container {
        padding: 0.4rem;
        min-height: 60px;
    }
    
    .send-btn, .mic-btn {
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
    }
    
    .back-btn {
        width: 32px;
        height: 32px;
        min-width: 32px;
    }
    
    .user-avatar {
        width: 36px;
        height: 36px;
    }
}

/* Animations */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes reactionPop {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInScale {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(30px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes recordingPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Custom notification styles */
.notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--surface-glass-strong);
    backdrop-filter: blur(20px);
    color: var(--text-primary);
    padding: 1rem 2rem;
    border-radius: 16px;
    z-index: 10000;
    animation: notificationSlide 3s ease-in-out;
    font-weight: 600;
    border: 1px solid var(--border-glass);
    box-shadow: 0 8px 32px var(--shadow-color);
    max-width: 90%;
    text-align: center;
}

.notification.error {
    background: rgba(239, 68, 68, 0.9);
    color: white;
}

.notification.success {
    background: rgba(16, 185, 129, 0.9);
    color: white;
}

.notification.warning {
    background: rgba(245, 158, 11, 0.9);
    color: #000;
}

@keyframes notificationSlide {
    0% {
        opacity: 0;
        transform: translate(-50%, -60px) scale(0.8);
    }
    20%, 80% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -40px) scale(0.9);
    }
}

/* Force hardware acceleration */
.chat-screen,
.chat-messages,
.chat-input-container {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: transform;
}

/* iOS-specific fixes */
@supports (-webkit-touch-callout: none) {
    .chat-input-container {
        position: -webkit-sticky;
        position: sticky;
        padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
    }
    
    @media (max-width: 768px) {
        .chat-input-container {
            position: fixed;
            padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
        }
    }
}

/* Safe area support */
@supports (padding: max(0px)) {
    .chat-input-container {
        padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
    }
    
    @media (max-width: 768px) {
        .chat-input-container {
            padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
        }
    }
}

/* Ensure no unexpected margins/paddings */
.hidden {
    display: none !important;
}

/* Better touch targets for mobile */
@media (max-width: 768px) {
    .age-btn {
        min-height: 48px;
        touch-action: manipulation;
    }
    
    .mic-btn, .send-btn {
        min-height: 48px;
        min-width: 48px;
        touch-action: manipulation;
    }
    
    .slide-button-container {
        min-height: 60px;
        touch-action: manipulation;
    }
    
    .interest-tag, .mood-tag {
        min-height: 48px;
        touch-action: manipulation;
    }
}

/* Disable text selection on UI elements */
.age-btn,
.mic-btn,
.send-btn,
.slide-button-container,
.interest-tag,
.mood-tag,
.back-btn,
.skip-btn,
.theme-toggle,
.history-btn {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Focus states for accessibility */
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --border-glass: rgba(255, 255, 255, 0.8);
        --text-secondary: rgba(255, 255, 255, 0.9);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}


/* =====================================
   ADD TO style.css - Nickname Lock Styles
   ===================================== */

/* Nickname Lock Indicator */
.nickname-lock-indicator {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 12px;
    padding: 0.5rem 0.75rem;
    backdrop-filter: blur(10px);
    z-index: 200;
    pointer-events: none;
    animation: lockIndicatorSlide 0.5s ease-out;
}

.lock-icon {
    font-size: 0.9rem;
    color: #f59e0b;
    animation: lockShake 2s ease-in-out infinite;
}

.lock-message {
    font-size: 0.75rem;
    color: #f59e0b;
    font-weight: 600;
    white-space: nowrap;
}

/* Locked nickname input styling */
.nickname-input[readonly] {
    background: rgba(245, 158, 11, 0.05) !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
    color: var(--text-secondary) !important;
    cursor: not-allowed !important;
    user-select: none !important;
}

.nickname-input[readonly]:focus {
    transform: none !important;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2) !important;
}

.nickname-input[readonly]::placeholder {
    color: #f59e0b !important;
    opacity: 0.8;
}

/* Input group positioning for lock indicator */
.input-group {
    position: relative;
}

/* Lock confirmation notification styling */
.notification.lock-success {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.notification.lock-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Enhanced lock notification with icon */
.notification.lock-success::before,
.notification.lock-warning::before {
    content: '🔒';
    margin-right: 0.5rem;
    font-size: 1.1em;
}

/* Animations */
@keyframes lockIndicatorSlide {
    from {
        opacity: 0;
        transform: translateY(-50%) translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
}

@keyframes lockShake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-3deg); }
    75% { transform: rotate(3deg); }
}

/* Mobile responsive lock indicator */
@media (max-width: 768px) {
    .nickname-lock-indicator {
        right: 0.5rem;
        padding: 0.4rem 0.6rem;
        gap: 0.4rem;
    }
    
    .lock-icon {
        font-size: 0.8rem;
    }
    
    .lock-message {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .nickname-lock-indicator {
        position: static;
        transform: none;
        margin-top: 0.5rem;
        justify-content: center;
        border-radius: 8px;
        padding: 0.4rem 0.5rem;
    }
    
    .lock-message {
        font-size: 0.65rem;
    }
}

/* Unlock celebration animation */
@keyframes unlockCelebration {
    0% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.1) rotate(-5deg); }
    50% { transform: scale(1.2) rotate(5deg); }
    75% { transform: scale(1.1) rotate(-2deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.nickname-input.unlocked {
    animation: unlockCelebration 0.6s ease-out;
    border-color: var(--success) !important;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3) !important;
}

/* Lock timer countdown styles */
.lock-countdown {
    font-family: 'Monaco', 'Menlo', monospace;
    letter-spacing: 0.5px;
    font-weight: 700;
}

/* Hover effect for locked input */
.nickname-input[readonly]:hover {
    background: rgba(245, 158, 11, 0.08) !important;
    border-color: rgba(245, 158, 11, 0.4) !important;
}

/* Focus ring for locked input */
.nickname-input[readonly]:focus {
    outline: 2px solid rgba(245, 158, 11, 0.5);
    outline-offset: 2px;
}