/* ══════════════════════════════════════════════════════════════
   sayilari-taniyalim.css  —  MatMod | Sayıları Tanıyalım
   Matching the provided design mockup
   ══════════════════════════════════════════════════════════════ */

:root {
    --navy-bg: #0b1120;
    --panel-bg: rgba(15, 23, 42, 0.6);
    --panel-border: rgba(56, 189, 248, 0.15);
    
    --primary: #3b82f6;
    --primary-glow: rgba(59, 130, 246, 0.5);
    --text-main: #f8fafc;
    --text-dim: #94a3b8;
    
    --accent-red: #ff6b6b;
    --accent-red-glow: rgba(255, 107, 107, 0.3);
    
    --nav-h: 80px;
    --gap: 16px;
    --radius-xl: 16px;
    --radius-md: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', system-ui, sans-serif; }

body {
    background-color: var(--navy-bg);
    background-image: 
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    color: var(--text-main);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Background Blobs for movement */
.bg-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    animation: blobFloat 15s infinite alternate;
}
.blob-1 { top: -10%; left: -10%; width: 50vw; height: 50vw; background: var(--accent-pink); opacity: 0.15; }
.blob-2 { bottom: -10%; right: -10%; width: 60vw; height: 60vw; background: var(--accent-purple); animation-delay: -5s; opacity: 0.15; }
.blob-3 { top: 40%; left: 40%; width: 40vw; height: 40vw; background: var(--accent-cyan); animation-delay: -10s; opacity: 0.1; }

@keyframes blobFloat {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(5%, 5%) scale(1.1); }
    100% { transform: translate(-5%, 10%) scale(0.9); }
}

/* ─── Navigation ─── */
.top-nav {
    height: var(--nav-h);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    background: rgba(11, 17, 32, 0.8);
    border-bottom: 1px solid var(--panel-border);
    backdrop-filter: blur(10px);
    z-index: 100;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-text { font-size: 1.4rem; font-weight: 900; color: #fff; }
.logo-text span { color: #8b5cf6; }

.mode-toggle {
    display: flex;
    gap: 16px; /* Çok daha fazla boşluk */
    background: rgba(255,255,255,0.05);
    padding: 8px; /* Dış boşluğu artırdık */
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.1);
}

.mode-btn {
    padding: 12px 36px; /* İç boşlukları çok daha genişlettik */
    border: none;
    background: transparent;
    color: var(--text-dim);
    font-size: 1rem; /* Yazıyı daha büyük yaptık */
    font-weight: 800; /* Çok daha belirgin */
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s;
}

.mode-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 0 10px var(--primary-glow);
}

.nav-right { display: flex; align-items: center; gap: 12px; }

.system-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    background: rgba(255,255,255,0.05);
    padding: 6px 14px;
    border-radius: 50px;
    border: 1px solid rgba(255,255,255,0.1);
}

.status-dot {
    width: 10px; height: 10px;
    background: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}

.nav-back-btn {
    color: #fff;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 6px 16px;
    background: rgba(255,255,255,0.05);
    border-radius: 50px;
    border: 1px solid rgba(255,255,255,0.1);
}

/* ─── Main Content ─── */
.main-container {
    flex: 1;
    display: grid;
    grid-template-columns: 280px 1fr 280px;
    grid-template-rows: 1fr auto;
    gap: var(--gap);
    padding: var(--gap);
    min-height: calc(100vh - var(--nav-h));
    align-content: space-between;
}

.panel {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-xl);
    padding: 20px;
    backdrop-filter: blur(10px);
}

.panel-title {
    font-size: 0.9rem;
    font-weight: 800;
    color: #60a5fa;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
    text-transform: uppercase;
}

/* ─── Left Panel: Rehber ─── */
.guide-text {
    font-size: 0.85rem;
    color: var(--text-dim);
    line-height: 1.5;
    margin-bottom: 20px;
}

.info-note {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-md);
    padding: 12px;
    font-size: 0.8rem;
    color: #34d399;
    line-height: 1.4;
    margin-bottom: 24px;
}

.info-note strong { color: #10b981; }

.how-to-play .panel-title { font-size: 0.8rem; margin-bottom: 12px; }

.instruction-step:nth-of-type(1) { --step-border: #3b82f6; }
.instruction-step:nth-of-type(2) { --step-border: #10b981; }

.instruction-step {
    background: rgba(255,255,255,0.03);
    border: 2px solid var(--step-border, rgba(255,255,255,0.05));
    padding: 12px;
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.instruction-step h4 { font-size: 0.85rem; color: #fff; margin-bottom: 4px; }
.instruction-step p { font-size: 0.75rem; color: var(--text-dim); }

/* ─── Center: Camera ─── */
.camera-section {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    background: #000;
    border: 1px solid var(--panel-border);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

#videoElement {
    position: absolute;
    width: 100%; height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

#drawingCanvas {
    position: absolute;
    width: 100%; height: 100%;
    object-fit: cover;
    z-index: 10;
    transform: scaleX(-1);
}

.scan-line {
    position: absolute;
    width: 100%;
    height: 4px;
    background: rgba(59, 130, 246, 0.5); /* blue glow */
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.8), 0 0 20px rgba(59, 130, 246, 0.5);
    z-index: 15;
    animation: scanLine 3s linear infinite;
    pointer-events: none;
}

@keyframes scanLine {
    0% { top: -10%; }
    100% { top: 110%; }
}

.camera-overlay {
    position: absolute;
    inset: 0;
    background: rgba(11, 17, 32, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
}

.start-btn {
    padding: 12px 24px;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    box-shadow: 0 0 20px var(--primary-glow);
}

/* ─── Right Panel: Takip ─── */
.live-track-card {
    background: rgba(255,255,255,0.02);
    border: 2px solid #8b5cf6;
    border-radius: var(--radius-md);
    padding: 30px 20px;
    text-align: center;
    margin-bottom: 40px;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.2);
}

.finger-count {
    font-size: 5rem;
    font-weight: 900;
    color: var(--accent-red);
    text-shadow: 0 0 30px var(--accent-red-glow);
    line-height: 1;
    margin-bottom: 10px;
}

.track-status {
    font-size: 0.85rem;
    color: var(--text-dim);
    font-weight: 600;
}

.mic-wrapper {
    display: flex;
    justify-content: center;
}

.mic-btn {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    border: 2px solid rgba(255,255,255,0.8);
    color: #fff;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(255,255,255,0.2);
    transition: all 0.3s;
}
.mic-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(255,255,255,0.4);
}

/* ─── Bottom Panel: Numbers ─── */
.numbers-panel {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-xl);
    backdrop-filter: blur(10px);
    margin-top: auto;
    align-self: end;
}
/* Cute colorful borders for number boxes */
.number-box:nth-child(1) { --cute-color: #ef4444; } /* 0 */
.number-box:nth-child(2) { --cute-color: #f97316; } /* 1 */
.number-box:nth-child(3) { --cute-color: #f59e0b; } /* 2 */
.number-box:nth-child(4) { --cute-color: #84cc16; } /* 3 */
.number-box:nth-child(5) { --cute-color: #10b981; } /* 4 */
.number-box:nth-child(6) { --cute-color: #06b6d4; } /* 5 */
.number-box:nth-child(7) { --cute-color: #3b82f6; } /* 6 */
.number-box:nth-child(8) { --cute-color: #8b5cf6; } /* 7 */
.number-box:nth-child(9) { --cute-color: #d946ef; } /* 8 */
.number-box:nth-child(10) { --cute-color: #f43f5e; } /* 9 */
.number-box:nth-child(11) { --cute-color: #14b8a6; } /* 10 */

.number-box {
    width: 60px; height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--cute-color);
    background: rgba(255,255,255,0.05);
    border: 3px solid var(--cute-color);
    border-radius: 18px; /* Daha tatlı yuvarlaklık */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.number-box.active {
    background: var(--cute-color);
    color: #fff;
    transform: scale(1.15) translateY(-5px);
    border-color: var(--cute-color);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

/* Visibility toggling */
.view-sayma .yazma-content { display: none !important; }
.view-yazma .sayma-content { display: none !important; }

/* Tracing Template */
.tracing-template {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 350px;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.15);
    z-index: 12;
    pointer-events: none;
    user-select: none;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

#trailCanvas {
    position: absolute;
    width: 100%; height: 100%;
    object-fit: cover;
    z-index: 15;
    transform: scaleX(-1);
    pointer-events: none;
}

/* ══════════════════════════════════════════
   AÇIK TEMA (Light Theme) Overrides
   localStorage'dan okunarak uygulanır
   ══════════════════════════════════════════ */
[data-theme="light"] {
    --navy-bg: #f0f4ff;
    --panel-bg: rgba(255, 255, 255, 0.75);
    --panel-border: rgba(74, 143, 231, 0.2);
    --text-main: #1e293b;
    --text-dim: #64748b;
    --primary: #3b82f6;
    --primary-glow: rgba(59, 130, 246, 0.4);
}

[data-theme="light"] body {
    background-color: #fce7f3; /* Belirgin pamuk şeker pembe zemin */
    background-image:
        linear-gradient(135deg, rgba(253, 244, 255, 0.9) 0%, rgba(252, 231, 243, 0.4) 100%),
        linear-gradient(rgba(236, 72, 153, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(236, 72, 153, 0.08) 1px, transparent 1px);
    color: #1e293b;
}

[data-theme="light"] .blob-1 { opacity: 0.4; } /* Pembe blob'u daha belirgin yap */
[data-theme="light"] .blob-2 { opacity: 0.25; }

[data-theme="light"] .top-nav {
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(74, 143, 231, 0.15);
    box-shadow: 0 2px 12px rgba(74, 143, 231, 0.08);
}

[data-theme="light"] .logo-text {
    color: #1e293b;
}

[data-theme="light"] .mode-toggle {
    background: rgba(74, 143, 231, 0.06);
    border-color: rgba(74, 143, 231, 0.15);
}

[data-theme="light"] .mode-btn {
    color: #334155;
    font-weight: 700;
}

[data-theme="light"] .mode-btn.active {
    color: #ffffff;
    background: #3b82f6;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

[data-theme="light"] .nav-back-btn {
    color: #475569;
    background: rgba(74, 143, 231, 0.06);
    border-color: rgba(74, 143, 231, 0.2);
}

[data-theme="light"] .system-status {
    background: rgba(34, 197, 94, 0.07);
    border-color: rgba(34, 197, 94, 0.2);
    color: #166534;
}

[data-theme="light"] .panel {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(74, 143, 231, 0.15);
    box-shadow: 0 4px 16px rgba(74, 143, 231, 0.06);
}

[data-theme="light"] .panel-title {
    color: #3b82f6;
}

[data-theme="light"] .info-note {
    background: rgba(16, 185, 129, 0.07);
    border-color: rgba(16, 185, 129, 0.18);
    color: #065f46;
}

[data-theme="light"] .instruction-step {
    background: rgba(74, 143, 231, 0.04);
    border-color: var(--step-border, rgba(74, 143, 231, 0.1));
}

[data-theme="light"] .instruction-step h4 {
    color: #1e293b;
}

[data-theme="light"] .camera-overlay {
    background: rgba(240, 244, 255, 0.92);
}

[data-theme="light"] .live-track-card {
    background: rgba(74, 143, 231, 0.04);
    border-color: #8b5cf6;
}

[data-theme="light"] .numbers-panel {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(74, 143, 231, 0.15);
}
[data-theme="light"] .number-box {
    background: #fff;
    border-color: var(--cute-color);
    color: var(--cute-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

[data-theme="light"] .number-box.active {
    background: var(--cute-color);
    color: #fff;
    border-color: var(--cute-color);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

[data-theme="light"] .mic-btn {
    background: rgba(74, 143, 231, 0.06);
    border-color: rgba(74, 143, 231, 0.4);
    color: #3b82f6;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.1);
}

[data-theme="light"] .tracing-template {
    color: rgba(0, 0, 0, 0.08);
    text-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
}

/* ─── Sliding Stars Animation ─── */
.sliding-star {
    position: fixed;
    top: -50px;
    font-size: 50px;
    color: #fcd34d;
    filter: drop-shadow(0 0 15px #fbbf24);
    z-index: 9999;
    pointer-events: none;
    transition: transform 2.5s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 2.5s ease-in;
}

[data-theme="light"] .sliding-star {
    filter: drop-shadow(0 0 15px #f59e0b);
}

/* ─── Sliding Stars Animation ─── */
.sliding-star {
    position: fixed;
    top: -50px;
    font-size: 50px;
    color: #fcd34d;
    filter: drop-shadow(0 0 15px #fbbf24);
    z-index: 9999;
    pointer-events: none;
    transition: transform 2.5s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 2.5s ease-in;
}

[data-theme="light"] .sliding-star {
    filter: drop-shadow(0 0 15px #f59e0b);
}
