/* ===================================================
   VChatLive - MODERN PREMIUM ARAYÜZ (TAM SÜRÜM)
   (İkiye Bölünmüş Focus Modu & Şeffaf Mobil Ekran Dahil)
   =================================================== */

:root {
    --bg-main: #0B0E14;
    --bg-glass: rgba(20, 24, 34, 0.7);
    --border-glass: rgba(255, 255, 255, 0.08);
    --primary: #4F46E5;
    --primary-glow: rgba(79, 70, 229, 0.4);
    --secondary: #1F2937;
    --accent-red: #E11D48;
    --text-main: #F8FAFC;
    --text-muted: #94A3B8;
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 8px;
}

body, html {
    margin: 0; padding: 0;
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    height: 100vh; width: 100vw;
    overflow: hidden;
    background-image: radial-gradient(circle at 15% 50%, rgba(79, 70, 229, 0.15), transparent 25%),
                      radial-gradient(circle at 85% 30%, rgba(225, 29, 72, 0.1), transparent 25%);
}

* { box-sizing: border-box; }
.hidden { display: none !important; }

/* -- ÜST BAR -- */
.top-bar { position: absolute; top: 0; left: 0; width: 100%; padding: 20px 40px; display: flex; justify-content: space-between; align-items: center; z-index: 100; }
.logo { font-size: 24px; font-weight: 800; letter-spacing: 1px; }
.logo span { color: var(--primary); }
#online-badge { background: var(--bg-glass); border: 1px solid var(--border-glass); padding: 8px 16px; border-radius: 30px; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; backdrop-filter: blur(10px); }
.pulse-dot { width: 10px; height: 10px; background-color: #10B981; border-radius: 50%; animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); } 70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); } 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); } }

/* -- GİRİŞ EKRANI -- */
#setup-screen { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh; padding: 20px; text-align: center; }
.setup-header h1 { font-size: 48px; margin-bottom: 10px; background: linear-gradient(to right, #fff, #94A3B8); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.setup-header p { color: var(--text-muted); font-size: 18px; max-width: 500px; margin: 0 auto 40px auto; }
.setup-cards { display: flex; gap: 30px; max-width: 900px; width: 100%; justify-content: center; }
.card { background: var(--bg-glass); border: 1px solid var(--border-glass); padding: 40px 30px; border-radius: var(--radius-lg); width: 100%; max-width: 400px; backdrop-filter: blur(20px); transition: transform 0.3s ease; }
.card:hover { transform: translateY(-5px); }
.premium-card { border: 1px solid rgba(79, 70, 229, 0.3); box-shadow: 0 10px 40px var(--primary-glow); }
.card-icon { font-size: 40px; margin-bottom: 15px; }
.card h3 { margin: 0 0 10px 0; font-size: 24px; }
.card .desc { color: var(--text-muted); font-size: 14px; margin-bottom: 25px; }

.input-group input, .tag-container { width: 100%; background: rgba(0,0,0,0.3); border: 1px solid var(--border-glass); color: white; padding: 15px; border-radius: var(--radius-md); font-family: inherit; font-size: 16px; outline: none; transition: 0.3s; }
.input-group input:focus { border-color: var(--primary); }
.stack { display: flex; flex-direction: column; gap: 15px; }
.tag-container { min-height: 50px; display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 15px; }
.tag-container input { background: transparent; border: none; padding: 0; margin: 0; width: auto; flex-grow: 1; min-width: 120px; }
.tag { background: var(--primary); padding: 5px 12px; border-radius: 20px; font-size: 14px; display: flex; align-items: center; }

button { font-family: inherit; cursor: pointer; border: none; outline: none; transition: all 0.2s ease; }
.btn-primary { width: 100%; background: var(--primary); color: white; padding: 16px; border-radius: var(--radius-md); font-size: 18px; font-weight: 600; margin-top: 20px; }
.btn-primary:hover:not([disabled]) { background: #4338CA; transform: scale(1.02); }
.btn-primary[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn-secondary { width: 100%; background: var(--secondary); color: white; padding: 16px; border-radius: var(--radius-md); font-size: 18px; font-weight: 600; margin-top: 20px; border: 1px solid var(--border-glass); }
.btn-secondary:hover { background: #374151; }

/* -- MASAÜSTÜ SOHBET ARAYÜZÜ -- */
.layout-desktop { display: flex; width: 100vw; height: 100vh; padding: 20px; gap: 20px; background: var(--bg-main); transition: 0.3s; }
.glass-panel { background: var(--bg-glass); border: 1px solid var(--border-glass); backdrop-filter: blur(20px); border-radius: var(--radius-lg); }

.video-section { flex: 1; position: relative; border-radius: var(--radius-lg); overflow: hidden; background: #000; box-shadow: 0 10px 30px rgba(0,0,0,0.5); transition: 0.3s; }
#session-status { position: absolute; top: 20px; left: 50%; transform: translateX(-50%); z-index: 10; padding: 10px 25px; border-radius: 30px; font-size: 14px; background: rgba(0,0,0,0.6); backdrop-filter: blur(10px); color: white; border: 1px solid rgba(255,255,255,0.1); }
.remote-wrapper { width: 100%; height: 100%; position: absolute; top: 0; left: 0; }
#remote-video { width: 100%; height: 100%; object-fit: cover; }

.local-wrapper.me { position: absolute; bottom: 90px; right: 20px; width: 150px; height: 200px; z-index: 20; border-radius: var(--radius-md); overflow: hidden; border: 2px solid rgba(255,255,255,0.2); box-shadow: 0 10px 20px rgba(0,0,0,0.5); }
#local-video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }

.control-bar { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 20; display: flex; gap: 20px; padding: 12px 25px; border-radius: 40px; }
.left-controls, .right-controls { display: flex; gap: 15px; }
.control-bar button { width: 45px; height: 45px; border-radius: 50%; background: rgba(255,255,255,0.1); color: white; font-size: 18px; border: 1px solid rgba(255,255,255,0.1); }
.control-bar button:hover { background: rgba(255,255,255,0.2); }
.control-bar button.btn-off { background: var(--accent-red); color: white; border-color: var(--accent-red); }

.reaction-bar { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 12px; padding: 15px 10px; z-index: 20; }
.reaction-bar button { width: 45px; height: 45px; border-radius: 50%; background: rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.1); font-size: 22px; transition: transform 0.2s; }
.reaction-bar button:hover { transform: scale(1.2); }

.chat-sidebar { width: 380px; display: flex; flex-direction: column; padding: 20px; transition: 0.3s; }
.chat-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border-glass); padding-bottom: 15px; margin-bottom: 15px; }
.chat-header h3 { margin: 0; font-size: 18px; }
.btn-text { background: transparent; color: var(--text-muted); font-weight: 600; padding: 5px 10px; }
.btn-text:hover { color: var(--accent-red); }

#chat-messages { flex-grow: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding-right: 5px; margin-bottom: 15px; }
#chat-messages::-webkit-scrollbar { width: 6px; }
#chat-messages::-webkit-scrollbar-thumb { background: var(--border-glass); border-radius: 10px; }

.msg { padding: 10px 14px; border-radius: 18px; font-size: 15px; max-width: 85%; line-height: 1.4; word-wrap: break-word; }
.msg b { display: none; }
.msg-local { background: var(--primary); color: white; align-self: flex-end; border-bottom-right-radius: 4px; }
.msg-remote { background: rgba(255,255,255,0.1); color: white; align-self: flex-start; border-bottom-left-radius: 4px; border: 1px solid var(--border-glass); }
.msg-text { margin-top: 0; }

.chat-input-area { display: flex; flex-direction: column; gap: 12px; }
.chat-tools { display: flex; gap: 10px; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,0.05); color: white; border: 1px solid var(--border-glass); font-size: 16px; }
.icon-btn:hover { background: rgba(255,255,255,0.1); }
.recording-active { background: var(--accent-red) !important; animation: pulseRecord 1.5s infinite; }

.input-row { display: flex; gap: 10px; }
#chat-input { flex-grow: 1; background: rgba(0,0,0,0.3); border: 1px solid var(--border-glass); color: white; padding: 12px 16px; border-radius: 20px; outline: none; }
#chat-input:focus { border-color: var(--primary); }
.btn-primary.small { padding: 0 20px; border-radius: 20px; }

.btn-next-person { width: 100%; background: linear-gradient(135deg, #E11D48, #BE123C); color: white; padding: 16px; border-radius: var(--radius-md); font-size: 18px; font-weight: 800; box-shadow: 0 4px 15px rgba(225, 29, 72, 0.4); text-transform: uppercase; letter-spacing: 1px; }
.btn-next-person:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(225, 29, 72, 0.6); }

.nsfw-blur { filter: blur(30px) grayscale(100%); transition: filter 0.5s; }
.nsfw-alert { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; color: white; background: rgba(0,0,0,0.8); padding: 30px; border-radius: var(--radius-lg); border: 2px solid var(--accent-red); z-index: 30; }
.nsfw-icon { font-size: 50px; margin-bottom: 10px; }

.flying-emoji { position: absolute; bottom: 20%; font-size: 45px; z-index: 100; pointer-events: none; animation: flyUp 2.5s ease-out forwards; filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5)); }
@keyframes flyUp { 0% { transform: translateY(0) scale(1); opacity: 1; } 50% { transform: translateY(-150px) scale(1.4); opacity: 0.9; } 100% { transform: translateY(-300px) scale(1); opacity: 0; } }

/* ===================================================
   👁️ FOCUS MODE (ODAK MODU) EKLENTİSİ (İKİYE BÖLÜNMÜŞ EKRAN)
   =================================================== */

/* Odak modu aktifken Sohbet Panelini gizle */
#main-layout.focus-mode .chat-sidebar {
    display: none !important;
}

/* Video alanı tüm ekranı kaplasın ve içini grid/flex'e çevirsin */
#main-layout.focus-mode .video-section {
    flex: 1 1 100% !important;
    display: flex !important;
    flex-direction: row !important; /* Kameraları yan yana dizer */
    gap: 10px;
    padding: 10px;
    background: #000;
}

/* Karşı Tarafın Kamerası (%50 genişlik) */
#main-layout.focus-mode .remote-wrapper {
    position: relative !important;
    flex: 1 !important; /* Alanın yarısını kaplar */
    height: 100% !important;
    border-radius: var(--radius-md);
    overflow: hidden;
}

/* Senin PIP Kameran (Artık PIP değil, %50 genişlikte ana ekran) */
#main-layout.focus-mode .local-wrapper.me {
    position: relative !important;
    flex: 1 !important; /* Alanın diğer yarısını kaplar */
    width: auto !important;
    height: 100% !important;
    bottom: auto !important;
    right: auto !important;
    top: auto !important;
    border: none !important; /* Kalın kenarlığı kaldır */
    box-shadow: none !important;
    border-radius: var(--radius-md);
    overflow: hidden;
}

/* Videoların ekrana tam oturması için */
#main-layout.focus-mode #remote-video,
#main-layout.focus-mode #local-video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

/* Focus Butonu Aktif Rengi */
#focus-btn.btn-active {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: white !important;
}

/* Focus modunda emojileri ve durum yazısını ortaya hizala */
#main-layout.focus-mode #session-status,
#main-layout.focus-mode .reaction-bar,
#main-layout.focus-mode .control-bar {
    z-index: 30;
}

/* ===================================================
   📱 MOBİL GÖRÜNÜM (AŞAĞIDAN BLUR KALDIRILMIŞ HALİ)
   =================================================== */
@media screen and (max-width: 768px) {
    body, html { overflow: hidden; position: fixed; width: 100%; height: 100%; }
    
    #setup-screen { padding: 80px 20px 20px 20px; justify-content: flex-start; overflow-y: auto; }
    .setup-header h1 { font-size: 32px; }
    .setup-header p { font-size: 16px; margin-bottom: 30px; }
    .setup-cards { flex-direction: column; gap: 20px; }
    .card { max-width: 100%; padding: 30px 20px; }

    .layout-desktop { display: block !important; padding: 0; position: relative; }
    
    .video-section { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border-radius: 0; z-index: 1; }
    #remote-video { object-fit: cover !important; }

    .local-wrapper.me { width: 90px; height: 130px; bottom: auto; top: 80px; right: 15px; border-radius: 12px; border: 1.5px solid rgba(255,255,255,0.4); }

    .reaction-bar { left: 10px; padding: 8px; background: rgba(0,0,0,0.3); border-radius: 20px; }
    .reaction-bar button { width: 40px; height: 40px; font-size: 18px; }

    .control-bar { position: absolute; right: 15px; top: 220px; bottom: auto; left: auto; transform: none; flex-direction: column; background: rgba(0,0,0,0.3); padding: 10px; gap: 15px; }
    .left-controls, .right-controls { flex-direction: column; }
    .control-bar button { width: 42px; height: 42px; }

    .chat-sidebar { position: absolute; bottom: 0; left: 0; width: 100%; height: 45vh; z-index: 10; background: none !important; backdrop-filter: none !important; border: none; border-radius: 0; pointer-events: none; }
    .chat-sidebar > * { pointer-events: auto; } 
    .chat-header { display: none; } 

    #chat-messages { max-height: 25vh; padding: 10px; text-shadow: 1px 1px 2px black; mask-image: linear-gradient(to bottom, transparent, black 20%); }
    .msg { font-size: 14px; padding: 8px 12px; }

    .chat-input-area { padding: 10px; gap: 10px; }
    .chat-tools { justify-content: flex-start; gap: 15px; }
    
    #chat-input { font-size: 16px; background: rgba(0,0,0,0.6); backdrop-filter: none; border: 1px solid rgba(255,255,255,0.3); }

    .btn-next-person { padding: 18px; font-size: 18px; border-radius: 30px; margin-top: 5px; box-shadow: 0 4px 20px rgba(225, 29, 72, 0.6); }
    
    .top-bar { padding: 15px 20px; }
    .logo { font-size: 20px; }
}