/* Temel sıfırlama ve değişkenler */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #0f172a; /* slate-900 */
    background: #f8fafc; /* slate-50 */
    line-height: 1.5;
}

/* Tema desteği */
[data-theme="dark"] body,
body[data-theme="dark"] {
    color: #e2e8f0; /* slate-200 */
    background: #0b1220; /* slate-950 */
}

/* Normal durumda */
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 16px;
}

/* Focus mode'da container daha geniş ve kenarlardan az boşluk */
body .focus-mode.container,
body .focus-mode .container {
    max-width: 95vw !important; /* Viewport genişliğinin %95'i */
    width: 95vw !important;
    margin: 0 auto;
    padding: 8px;
}

/* Focus mode'da panel tam genişlikte */
.focus-mode .panel:has(#countdown) {
    width: 100% !important;
    max-width: none !important;
    margin: 8px 0;
    padding: 24px;
}

/* Timer paneli sadece focus mode'da görünür */
.panel:has(#countdown) { display: none; }

/* Odak modu: sadece sayaç kartı + mesaj + kontrol butonları */
.focus-mode .panel { display: none; } /* Tüm panelleri gizle */
.focus-mode .container { max-width: 98%; padding: 8px; } /* Ekranı daha fazla kullan */
.focus-mode .panel:has(#countdown) { display: block; } /* Sadece timer panelini göster */
.focus-mode #timer-title,
.focus-mode #teacher-msg-title,
.focus-mode #countdown,
.focus-mode #progress,
.focus-mode #active-message { display: block; }
.focus-mode #focus-controls { display: flex; }
.focus-mode section[aria-labelledby="timer-title"] { display: block; }
/* Focus mode'da kontrol butonlarını göster */
.focus-mode .controls-row { display: flex; }
/* Öğretmen mesaj paneli tamamen gizli kalır */

/* Focus mode'da öğretmen mesajı butonların altında */
.focus-mode .panel:has(#countdown) {
    display: flex !important;
    flex-direction: column !important;
}

.focus-mode .countdown { order: 0 !important; }
.focus-mode .progress-wrap { order: 1 !important; }
.focus-mode #focus-controls { order: 2 !important; }
.focus-mode #active-message { 
    order: 3 !important; 
    margin-top: 24px !important;
}

/* Odak görünümde sayaç daha da büyük */
.focus-mode .countdown { font-size: 12rem; padding: 16px 20px; }

.active-message { margin-top: 12px; font-size: 2rem; font-weight: 600; text-align: center; }
[data-theme="dark"] .active-message { color: #e5e7eb; }

.focus-controls { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 12px; flex-wrap: nowrap; }
.focus-left, .focus-right, .focus-center { display: flex; gap: 10px; align-items: center; }

@media (max-width: 600px) {
    .focus-controls { flex-wrap: wrap; row-gap: 8px; column-gap: 8px; }
    .focus-left, .focus-center, .focus-right { flex: 1 1 100%; justify-content: space-between; }
}

.top-banner {
    position: sticky;
    top: 0;
    width: 100%;
    background: #ef4444; /* red-500 */
    color: #fff;
    padding: 12px 16px;
    text-align: center;
    font-weight: 700;
    z-index: 50;
}

/* Logo bar */
.logo-bar { width: 100%; position: relative; display: flex; justify-content: center; align-items: center; padding: 12px 0; }
.logo-img { height: 48px; width: auto; }
.icon-btn { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: #334155; color: #fff; border: none; border-radius: 9999px; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,0.15); }
.icon-btn:hover { background: #1f2937; }
[data-theme="dark"] .icon-btn { background: #1f2937; }
[data-theme="dark"] .logo-bar { background: #0b1220; }

.panel {
    background: #ffffff;
    border: 1px solid #e2e8f0; /* slate-200 */
    border-radius: 12px;
    padding: 16px;
    margin: 16px 0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

[data-theme="dark"] .panel { background: #0f172a; border-color: #1f2937; }

.teacher-form .form-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.label { display: block; margin-bottom: 8px; font-weight: 600; }
.help { margin-top: 8px; color: #475569; font-size: 0.9rem; }
[data-theme="dark"] .help { color: #94a3b8; }

input[type="number"], textarea, select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 1rem;
    background: #f9fafb;
}
/* Dark mode input stilleri */
[data-theme="dark"] input[type="number"],
[data-theme="dark"] textarea,
[data-theme="dark"] select {
    background: #1e293b; /* slate-800 - koyu ama okunabilir arka plan */
    border-color: #475569; /* slate-600 - belirgin kenarlık */
    color: #f1f5f9; /* slate-100 - açık renk metin */
    transition: all 0.2s ease;
}

/* Dark mode focus stilleri */
[data-theme="dark"] input[type="number"]:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] select:focus {
    outline: none;
    background: #334155; /* slate-700 - focus'ta biraz daha koyu */
    border-color: #60a5fa; /* blue-400 - parlak mavi kenarlık */
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2); /* blue-400 ile uyumlu glow efekti */
    color: #f8fafc; /* slate-50 - daha parlak metin */
}

/* Placeholder rengi */
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
    color: #94a3b8; /* slate-400 - okunabilir placeholder */
}

input[type="number"]:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #3b82f6; /* blue-500 */
    box-shadow: 0 0 0 3px rgba(59,130,246,0.25);
    background: #fff;
}

.btn {
    appearance: none;
    border: none;
    background: #334155; /* slate-700 */
    color: #fff;
    padding: 10px 16px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.05s ease, background 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
.btn:hover { background: #1f2937; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn.primary { background: #2563eb; }
.btn.primary:hover { background: #1d4ed8; }
.btn.success { background: #16a34a; }
.btn.success:hover { background: #15803d; }

.countdown {
    display: none; /* Başlangıçta gizli */
    font-variant-numeric: tabular-nums;
    font-size: 4rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-align: center;
    padding: 8px 12px;
    border-radius: 12px;
    background: #0ea5e9; /* sky-500 */
    color: #fff;
}
[data-theme="dark"] .countdown { background: #2563eb; }

.progress-wrap {
    width: 100%;
    height: 14px;
    background: #e2e8f0;
    border-radius: 9999px;
    overflow: hidden;
    margin-top: 12px;
}
[data-theme="dark"] .progress-wrap { background: #1f2937; }
.progress { height: 100%; width: 0%; background: #22c55e; transition: width 0.3s linear, background-color 0.3s linear; }
[data-theme="dark"] .progress { background: #10b981; }

/* Yeni düzenler */
.controls-form .grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}
.controls-form .field { display: flex; flex-direction: column; }
.controls-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }

.teacher-msg textarea { width: 100%; }
.messages-list { margin-top: 12px; display: grid; gap: 8px; }
.msg-item { padding: 8px 10px; background: #f1f5f9; border-radius: 8px; }
[data-theme="dark"] .msg-item { background: #111827; color: #e5e7eb; }
.actions { display: flex; gap: 12px; }

/* Sesli uyarı butonu (pill) */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.audio-toggle-wrap { display: flex; align-items: center; }
.pill-toggle { background: #334155; color: #fff; border: none; padding: 8px 14px; border-radius: 9999px; font-weight: 700; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,0.15); }
.pill-toggle:hover { background: #1f2937; }
.pill-toggle[aria-pressed="true"] { background: #16a34a; }
[data-theme="dark"] .pill-toggle { background: #1f2937; }
[data-theme="dark"] .pill-toggle[aria-pressed="true"] { background: #22c55e; }

.footer {
    padding: 24px 16px;
    text-align: center;
    color: #475569;
}

/* Mobil uyum */
@media (max-width: 600px) {
    .teacher-form .form-row { flex-direction: column; align-items: stretch; }
    .countdown { font-size: 3rem; }
    .controls-form .grid { grid-template-columns: repeat(2, 1fr); }
}

/* Erişilebilirlik: yüksek kontrast modu desteği (basit örnek) */
@media (prefers-contrast: more) {
    .countdown { box-shadow: 0 0 0 3px #000 inset; }
}

/* Başlangıçta gizli butonlar - sadece geri sayım başladığında görünür */
#pause-btn,
#stop-btn,
#plus1-btn,
#minus1-btn {
    display: none;
}


