/* ============================================
   Maarif 26 - AI Robot Avatar Ekranı
   7 inç yuvarlak ekran optimize
   ============================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #00c896;
  --primary-dark: #009e78;
  --primary-glow: rgba(0,200,150,0.35);
  --bg-dark: #0a0e1a;
  --bg-mid: #0f1628;
  --face-bg: #111827;
  --eye-bg: #1a2540;
  --eye-glow: #00d4ff;
  --pupil: #001a33;
  --mouth-bg: #0d1520;
  --text-light: #e8f4ff;
  --text-muted: #7a9abf;
  --bubble-bg: rgba(15, 22, 40, 0.95);
  --ring-color: rgba(0,200,150,0.4);
  --font: 'Segoe UI', 'Helvetica Neue', sans-serif;
}

html, body {
  width: 100%;
  height: 100%;
  background: #000;
  font-family: var(--font);
  overflow: hidden;
  touch-action: manipulation;
}

/* ─── Ekran Sarmalayıcı ─── */
.screen-wrapper {
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

.robot-screen {
  width: min(100vw, 100vh);
  height: min(100vw, 100vh);
  max-width: 600px;
  max-height: 600px;
  border-radius: 50%;
  background: radial-gradient(ellipse at 40% 35%, #141e35 0%, #0a0e1a 70%);
  position: relative;
  overflow: hidden;
  border: 3px solid rgba(0,200,150,0.3);
  box-shadow:
    0 0 40px rgba(0,200,150,0.2),
    0 0 80px rgba(0,200,150,0.1),
    inset 0 0 60px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

/* ─── Arka Plan Parlamalar ─── */
.bg-glow {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
.glow-1 {
  width: 60%;
  height: 60%;
  top: -10%;
  left: 20%;
  background: radial-gradient(circle, rgba(0,200,150,0.08) 0%, transparent 70%);
  animation: floatGlow 4s ease-in-out infinite;
}
.glow-2 {
  width: 40%;
  height: 40%;
  bottom: 5%;
  right: 10%;
  background: radial-gradient(circle, rgba(0,100,255,0.06) 0%, transparent 70%);
  animation: floatGlow 6s ease-in-out infinite reverse;
}
@keyframes floatGlow {
  0%,100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-8px) scale(1.05); }
}

/* ─── Robot Yüzü ─── */
.robot-face {
  position: relative;
  z-index: 2;
  margin-top: 7%;
  width: 52%;
  height: 52%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.face-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid var(--ring-color);
  animation: rotateSlow 12s linear infinite;
  box-shadow: 0 0 15px var(--primary-glow);
}
.ring-2 {
  width: 110%;
  height: 110%;
  border-color: rgba(0,200,150,0.15);
  border-width: 1px;
  animation-duration: 20s;
  animation-direction: reverse;
}
@keyframes rotateSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.face-inner {
  width: 85%;
  height: 85%;
  border-radius: 50%;
  background: radial-gradient(ellipse at 45% 40%, #1a2540 0%, #0d1425 100%);
  border: 2px solid rgba(0,200,150,0.25);
  box-shadow:
    inset 0 0 30px rgba(0,0,0,0.6),
    0 0 20px rgba(0,200,150,0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* ─── Gözler ─── */
.eyes-row {
  display: flex;
  gap: 18%;
  margin-bottom: 8%;
  position: relative;
  z-index: 3;
}

.eye-socket {
  width: clamp(30px, 10vmin, 54px);
  height: clamp(30px, 10vmin, 54px);
  border-radius: 50%;
  background: var(--eye-bg);
  border: 2px solid rgba(0,200,150,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    inset 0 2px 8px rgba(0,0,0,0.6),
    0 0 12px rgba(0,212,255,0.2);
  position: relative;
  overflow: hidden;
}

.eye {
  width: 72%;
  height: 72%;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #1a3a5c 0%, #001225 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.15s ease;
}

.pupil {
  width: 48%;
  height: 48%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #003366 0%, #000810 100%);
  position: relative;
  transition: transform 0.1s ease;
  box-shadow: 0 0 8px rgba(0,150,255,0.4);
}
.pupil-shine {
  position: absolute;
  top: 15%;
  left: 20%;
  width: 30%;
  height: 30%;
  border-radius: 50%;
  background: rgba(200,240,255,0.9);
}
.eye-shine {
  position: absolute;
  top: 10%;
  right: 12%;
  width: 22%;
  height: 22%;
  border-radius: 50%;
  background: rgba(0,212,255,0.5);
}

/* Göz kırpma */
.eye-socket::after {
  content: '';
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--eye-bg);
  border-radius: 50%;
  transition: top 0.1s ease;
}
.eye-socket.blink::after { top: 0; }

/* ─── Ağız ─── */
.mouth-container {
  width: 50%;
  position: relative;
  z-index: 3;
}

.mouth {
  width: 100%;
  height: clamp(18px, 6vmin, 32px);
  background: var(--mouth-bg);
  border-radius: 0 0 20px 20px;
  border: 2px solid rgba(0,200,150,0.3);
  border-top: none;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  transition: height 0.2s ease, border-radius 0.2s ease;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.7);
}

.mouth.talking {
  border-radius: 10px;
  border-top: 2px solid rgba(0,200,150,0.3);
  animation: talkAnim 0.15s ease-in-out infinite alternate;
}
@keyframes talkAnim {
  from { height: clamp(14px, 5vmin, 26px); }
  to   { height: clamp(28px, 9vmin, 46px); }
}

.mouth-inner {
  width: 80%;
  height: 40%;
  background: linear-gradient(to bottom, #001a33 0%, #000810 100%);
  border-radius: 0 0 10px 10px;
}
.teeth-row {
  width: 100%;
  height: 4px;
  background: repeating-linear-gradient(
    90deg,
    rgba(200,230,255,0.6) 0px, rgba(200,230,255,0.6) 6px,
    transparent 6px, transparent 10px
  );
}

/* Konuşma dalgaları */
.speech-waves {
  display: none;
  position: absolute;
  gap: 3px;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}
.speech-waves.active { display: flex; }
.speech-waves span {
  display: block;
  width: 3px;
  background: var(--primary);
  border-radius: 2px;
  animation: waveAnim 0.5s ease-in-out infinite alternate;
}
.speech-waves span:nth-child(1) { height: 4px; animation-delay: 0s; }
.speech-waves span:nth-child(2) { height: 10px; animation-delay: 0.1s; }
.speech-waves span:nth-child(3) { height: 14px; animation-delay: 0.05s; }
.speech-waves span:nth-child(4) { height: 10px; animation-delay: 0.15s; }
.speech-waves span:nth-child(5) { height: 4px; animation-delay: 0.08s; }
@keyframes waveAnim {
  from { transform: scaleY(0.5); }
  to   { transform: scaleY(1.5); }
}

/* ─── Yanak Parlamaları ─── */
.cheek {
  position: absolute;
  width: 22%;
  height: 12%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,200,150,0.15) 0%, transparent 70%);
  bottom: 22%;
  opacity: 0;
  transition: opacity 0.5s;
}
.left-cheek { left: 8%; }
.right-cheek { right: 8%; }
.cheek.active { opacity: 1; }

/* ─── Durum Çubuğu ─── */
.status-bar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2%;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 8px var(--primary);
  animation: pulse 2s ease-in-out infinite;
}
.status-dot.thinking { background: #ffa500; box-shadow: 0 0 8px #ffa500; }
.status-dot.talking { background: #00d4ff; box-shadow: 0 0 8px #00d4ff; }
.status-dot.error { background: #ff4455; box-shadow: 0 0 8px #ff4455; animation: none; }
@keyframes pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}
.status-text {
  font-size: clamp(9px, 2.5vmin, 13px);
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 600;
}

/* ─── Konuşma Balonu ─── */
.speech-bubble {
  position: relative;
  z-index: 5;
  width: 82%;
  margin-top: 3%;
  background: var(--bubble-bg);
  border: 1.5px solid rgba(0,200,150,0.3);
  border-radius: 16px;
  padding: clamp(8px,2vmin,14px) clamp(10px,2.5vmin,16px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.5), 0 0 15px rgba(0,200,150,0.1);
  min-height: clamp(40px, 10vmin, 70px);
  display: flex;
  align-items: center;
  max-height: 22%;
  overflow: hidden;
}
.bubble-content {
  font-size: clamp(10px, 2.8vmin, 15px);
  color: var(--text-light);
  line-height: 1.5;
  text-align: center;
  width: 100%;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.typing-cursor::after {
  content: '▋';
  color: var(--primary);
  animation: blink 0.7s step-end infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

/* ─── Giriş Alanı ─── */
.input-area {
  position: relative;
  z-index: 5;
  width: 82%;
  margin-top: 3%;
}
.input-box {
  display: flex;
  gap: 8px;
  background: rgba(15,22,40,0.9);
  border: 1.5px solid rgba(0,200,150,0.3);
  border-radius: 30px;
  padding: clamp(5px,1.5vmin,9px) clamp(8px,2vmin,14px);
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}
#questionInput {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-light);
  font-size: clamp(10px, 2.8vmin, 14px);
  font-family: var(--font);
}
#questionInput::placeholder { color: var(--text-muted); }
#sendBtn {
  background: var(--primary);
  border: none;
  border-radius: 50%;
  width: clamp(28px, 7vmin, 40px);
  height: clamp(28px, 7vmin, 40px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.1s;
  flex-shrink: 0;
}
#sendBtn:hover { background: var(--primary-dark); transform: scale(1.05); }
#sendBtn:active { transform: scale(0.95); }
#sendBtn svg {
  width: 45%;
  height: 45%;
  color: #fff;
  margin-left: 2px;
}
#sendBtn:disabled { background: #334; cursor: not-allowed; transform: none; }

/* Hızlı sorular */
.quick-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
  justify-content: center;
}
.quick-btns button {
  background: rgba(0,200,150,0.1);
  border: 1px solid rgba(0,200,150,0.3);
  border-radius: 20px;
  color: var(--primary);
  font-size: clamp(8px, 2.2vmin, 11px);
  padding: 3px 10px;
  cursor: pointer;
  transition: background 0.2s;
  font-family: var(--font);
}
.quick-btns button:hover { background: rgba(0,200,150,0.2); }

/* ─── Responsive ─── */
@media (max-width: 400px) {
  .eyes-row { gap: 15%; }
  .speech-bubble { width: 88%; margin-top: 2%; }
  .input-area { width: 88%; }
}
