:root {
    --primary: #00f2ea;
    --secondary: #ff0050;
    --bg-grad: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    --panel-bg: rgba(20, 20, 35, 0.9);
}

* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-grad);
    color: #fff;
    margin: 0;
    /* Mobil tarayıcılar için dinamik yükseklik */
    height: 100vh;
    height: 100dvh; 
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* --- HEADER --- */
header {
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0,0,0,0.2);
    flex-shrink: 0;
}

.brand { font-weight: bold; font-size: 1.1rem; letter-spacing: 1px; color: var(--primary); }
#settingsBtn { background: none; border: none; color: white; font-size: 1.4rem; cursor: pointer; }

/* --- AYARLAR --- */
#settingsPanel {
    position: absolute;
    top: 60px; right: 10px; left: 10px;
    max-width: 400px;
    margin: 0 auto;
    background: var(--panel-bg);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 15px;
    transform: translateY(-20px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s;
    z-index: 100;
    border: 1px solid rgba(255,255,255,0.1);
}
#settingsPanel.active { transform: translateY(0); opacity: 1; pointer-events: all; }
.setting-group { margin-bottom: 15px; }
.setting-group label { display: block; color: #aaa; margin-bottom: 5px; }
select, input[type=range] { width: 100%; padding: 10px; border-radius: 8px; border: none; background: #222; color: white; }

/* --- CHAT ALANI --- */
#chatContainer {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch; /* iOS smooth scroll */
}

.message {
    max-width: 85%;
    padding: 15px;
    border-radius: 20px;
    line-height: 1.5;
    word-wrap: break-word;
    font-size: 1rem;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.nova { align-self: flex-start; background: rgba(255,255,255,0.1); border-bottom-left-radius: 5px; }
.user { align-self: flex-end; background: linear-gradient(135deg, var(--primary), #00c6ff); color: #000; border-bottom-right-radius: 5px; font-weight: 500; }

/* --- GÖRSELLEŞTİRİCİ --- */
#visContainer {
    height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}

.ai-core {
    width: 60px; height: 60px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 0 20px var(--primary);
    transition: 0.3s;
    z-index: 2;
}

/* Durum Efektleri */
body.listening .ai-core { background: var(--secondary); transform: scale(1.1); box-shadow: 0 0 30px var(--secondary); }
body.processing .ai-core { background: #ffd700; animation: spin 1s infinite linear; }
body.speaking .ai-core { background: #b000ff; animation: pulse 0.5s infinite alternate; }

@keyframes spin { 100% { transform: rotate(360deg); } }
@keyframes pulse { from { transform: scale(1); } to { transform: scale(1.2); box-shadow: 0 0 40px #b000ff; } }

#statusText { margin-top: 15px; font-size: 0.8rem; letter-spacing: 2px; color: #888; text-transform: uppercase; }

/* --- KONTROLLER --- */
#controls {
    padding: 20px;
    display: flex;
    justify-content: center;
    gap: 15px;
    background: rgba(0,0,0,0.3);
    flex-shrink: 0;
    /* Butonların mobilde sıkışmasını engelle */
    flex-wrap: wrap; 
}

.btn {
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.2s;
    min-width: 140px;
    justify-content: center;
}

#talkBtn { background: var(--primary); color: #000; box-shadow: 0 5px 15px rgba(0,242,234,0.3); }
#talkBtn:active { transform: scale(0.95); }

#stopBtn { background: rgba(255,255,255,0.1); color: white; border: 1px solid rgba(255,255,255,0.2); }

/* --- MOBİL İYİLEŞTİRMELER --- */
@media (max-height: 600px) {
    #visContainer { height: 80px; }
    .ai-core { width: 40px; height: 40px; }
    #chatContainer { padding: 10px; }
}