:root {
    --bg-dark: #07090e;
    --bg-card: rgba(15, 23, 42, 0.75);
    --bg-card-border: rgba(255, 255, 255, 0.12);
    --bg-input: #111827;
    
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.45);
    --neon-cyan: #06b6d4;
    --neon-purple: #a855f7;

    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.4);
    --warning: #f59e0b;
    --danger: #ef4444;

    --text-main: #f9fafb;
    --text-muted: #9ca3af;
    --text-dim: #6b7280;

    --stranger-msg: rgba(30, 41, 59, 0.9);
    --stranger-border: rgba(51, 65, 85, 0.8);
    --you-msg: linear-gradient(135deg, #4f46e5, #4338ca);
    --you-border: #6366f1;

    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
}

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(circle at 10% 10%, rgba(99, 102, 241, 0.18), transparent 40%),
        radial-gradient(circle at 90% 90%, rgba(168, 85, 247, 0.18), transparent 40%);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Utilities */
.hidden { display: none !important; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.text-center { text-align: center; }
.margin-top-20 { margin-top: 20px; }
.full-width { width: 100%; }

/* GPU Acceleration */
.btn, .modal-card, .feature-card, .message-bubble, .gender-card-btn, .mode-card-btn, .pricing-card {
    will-change: transform, opacity;
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
    outline: none;
}
.btn-large {
    padding: 14px 28px;
    font-size: 16px;
    border-radius: var(--radius-md);
}
.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), #4f46e5);
    color: #fff;
    box-shadow: 0 4px 16px var(--primary-glow);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #4f46e5, #4338ca);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}
.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--bg-card-border);
    color: var(--text-main);
    backdrop-filter: blur(8px);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}
.btn-telegram {
    background: linear-gradient(135deg, #24A1DE, #0088cc);
    color: #fff;
    box-shadow: 0 4px 14px rgba(36, 161, 222, 0.35);
}
.btn-telegram:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(36, 161, 222, 0.5);
}

/* Landing Page Layout */
.landing-container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.landing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 22px;
    font-weight: 700;
}
.logo-icon {
    color: var(--primary);
    font-size: 26px;
    filter: drop-shadow(0 0 8px var(--primary));
}
.highlight {
    background: linear-gradient(135deg, #818cf8, var(--neon-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.online-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 6px 14px;
    border-radius: 20px;
    color: var(--success);
    font-size: 13px;
    font-weight: 600;
}
.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--success);
    animation: pulse 1.8s infinite;
}
@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 10px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.landing-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}
.hero-content {
    max-width: 800px;
}
.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: 30px;
    color: #a5b4fc;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 20px;
}
.hero-content h1 {
    font-size: 46px;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #ffffff 40%, #c7d2fe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero-content p {
    font-size: 18px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 32px;
}

/* Mode Selector Grid Cards */
.mode-selector-grid {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin: 24px 0 36px 0;
}
.mode-card-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 2px solid var(--bg-card-border);
    border-radius: var(--radius-md);
    padding: 20px 28px;
    color: var(--text-muted);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    min-width: 130px;
    backdrop-filter: blur(12px);
}
.mode-card-btn .mode-icon {
    font-size: 28px;
}
.mode-card-btn:hover {
    border-color: var(--primary);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.25);
}
.mode-card-btn.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(168, 85, 247, 0.2));
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 0 24px var(--primary-glow);
}

/* Feature Cards */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 36px;
}
.feature-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: left;
    transition: all 0.3s ease;
}
.feature-card:hover {
    transform: translateY(-4px);
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}
.feature-icon {
    font-size: 28px;
    color: var(--primary);
    margin-bottom: 12px;
}
.feature-card h3 { font-size: 18px; margin-bottom: 6px; }
.feature-card p { font-size: 14px; color: var(--text-muted); line-height: 1.5; margin: 0; }

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    background: rgba(4, 6, 12, 0.75);
    backdrop-filter: blur(16px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
.modal-card {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-lg);
    padding: 32px;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    position: relative;
}
.modal-card-large {
    max-width: 920px !important;
}
.modal-header h2 { font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.modal-subtitle { color: var(--text-muted); font-size: 14px; margin-bottom: 20px; }

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
    text-align: left;
}
.input-group label { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.input-group input {
    background: var(--bg-input);
    border: 1px solid var(--bg-card-border);
    color: #fff;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    outline: none;
    font-size: 15px;
    transition: all 0.2s ease;
}
.input-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 16px var(--primary-glow);
}

/* Pricing Grid Cards */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 24px;
}
.pricing-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-md);
    padding: 24px;
    position: relative;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(12px);
}
.pricing-card.featured {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.2);
}
.badge-featured {
    position: absolute;
    top: -12px;
    right: 20px;
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 12px;
}
.pricing-card h3 { font-size: 20px; margin-bottom: 8px; }
.pricing-card .price { font-size: 28px; font-weight: 700; color: #fff; margin-bottom: 16px; }
.pricing-card .price span { font-size: 13px; font-weight: 400; color: var(--text-muted); }
.pricing-card ul { list-style: none; margin-bottom: 24px; flex: 1; }
.pricing-card ul li { margin-bottom: 12px; font-size: 14px; display: flex; align-items: center; gap: 8px; }

/* Gender Modal Cards */
.gender-cards-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 20px 0;
}
.gender-card-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 2px solid var(--bg-card-border);
    border-radius: var(--radius-md);
    padding: 20px;
    cursor: pointer;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
}
.gender-card-btn i { font-size: 32px; }
.gender-card-btn.male i { color: #3b82f6; }
.gender-card-btn.female i { color: #ec4899; }
.gender-card-btn:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.25);
}

/* Chat Page Layout */
.chat-body { height: 100vh; overflow: hidden; }
.app-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
    position: relative;
    z-index: 1;
}
.chat-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-md);
    padding: 12px 20px;
    margin-bottom: 12px;
}
.topbar-left, .topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}
.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}
.status-badge.waiting { background: rgba(245, 158, 11, 0.15); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.3); }
.status-badge.connected { background: rgba(16, 185, 129, 0.15); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.3); }
.status-badge.disconnected { background: rgba(239, 68, 68, 0.15); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.3); }

/* Chat Viewport & Video Container */
.chat-viewport {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
}
.chat-messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.message-bubble {
    max-width: 70%;
    padding: 12px 18px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.5;
    word-break: break-word;
}
.message-bubble.you {
    align-self: flex-end;
    background: var(--you-msg);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.message-bubble.stranger {
    align-self: flex-start;
    background: var(--stranger-msg);
    border: 1px solid var(--stranger-border);
    color: var(--text-main);
    border-bottom-left-radius: 4px;
}
.message-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    opacity: 0.7;
    margin-bottom: 4px;
}

/* WebRTC Video Container */
.video-container {
    height: 340px;
    background: #000;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--bg-card-border);
}
.remote-video-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
#remote-video { width: 100%; height: 100%; object-fit: cover; }
.local-video-wrapper {
    position: absolute;
    bottom: 16px; right: 16px;
    width: 150px; height: 110px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 2px solid var(--primary);
    background: #000;
    box-shadow: 0 8px 24px rgba(0,0,0,0.6);
    z-index: 5;
}
#local-canvas { width: 100%; height: 100%; object-fit: cover; }

.video-toolbar {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    padding: 8px 18px;
    border-radius: 30px;
    border: 1px solid var(--bg-card-border);
    z-index: 5;
}
.btn-tool {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 42px; height: 42px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
.btn-tool:hover { background: rgba(255, 255, 255, 0.2); }
.btn-tool.active { background: var(--primary); }
.btn-tool.blur-active { background: #059669; width: auto; padding: 0 16px; border-radius: 20px; gap: 8px; font-weight: 600; font-size: 13px; }

/* Control Bar */
.chat-controls {
    margin-top: 12px;
}
.controls-form {
    display: flex;
    gap: 12px;
}
.btn-action {
    min-width: 110px;
    padding: 12px 18px;
    font-size: 15px;
    font-weight: 700;
    border-radius: var(--radius-sm);
}
.btn-action.searching { background: var(--warning); color: #000; }
.btn-action.connected { background: var(--danger); color: #fff; }
.btn-action.confirm-stop { background: #b91c1c; color: #fff; animation: pulse 1s infinite; }
.btn-action.next-partner { background: var(--primary); color: #fff; }

.input-wrapper { flex: 1; }
.input-wrapper input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--bg-card-border);
    color: #fff;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    outline: none;
}
.input-wrapper input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 16px var(--primary-glow);
}
.btn-send {
    background: linear-gradient(135deg, var(--primary), #4f46e5);
    color: #fff;
    padding: 14px 24px;
    border-radius: var(--radius-sm);
}

/* Voice Call Viewport Container */
.voice-container {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(30, 41, 59, 0.9));
    border-bottom: 1px solid var(--bg-card-border);
    padding: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
}
.voice-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}
.voice-avatar-wrapper {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.2);
    border: 2px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}
.voice-avatar-glow {
    position: absolute;
    top: -5px; right: -5px; bottom: -5px; left: -5px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    animation: voicePulse 2s infinite ease-in-out;
}
@keyframes voicePulse {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.3); opacity: 0; }
}
.voice-icon {
    font-size: 32px;
    color: var(--primary);
}
.voice-card h3 { font-size: 18px; font-weight: 700; margin: 0; }
.voice-card p { font-size: 14px; color: var(--text-muted); margin: 0; }
.voice-controls { margin-top: 8px; }

/* Responsiveness */
@media (max-width: 768px) {
    .hide-mobile { display: none !important; }
    .hero-content h1 { font-size: 32px; }
    .mode-selector-grid { gap: 10px; }
    .mode-card-btn { padding: 14px 18px; min-width: 100px; font-size: 13px; }
    .mode-card-btn .mode-icon { font-size: 22px; }
    .video-container { height: 260px; }
    .local-video-wrapper { width: 110px; height: 80px; }
}
