/* ============================================
   Geometrik Cisimlerin Özellikleri — Stil
   ============================================ */

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

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    color: #1e293b;
    user-select: none;
    -webkit-user-select: none;
}

/* ---- Tab Bar ---- */
.tab-bar {
    display: flex;
    gap: 6px;
    padding: 10px 12px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-shrink: 0;
    max-width: 100vw;
}
.tab-bar::-webkit-scrollbar { display: none; }

.tab {
    flex-shrink: 0;
    padding: 10px 18px;
    border: 2px solid transparent;
    border-radius: 12px;
    background: rgba(255,255,255,0.08);
    color: #cbd5e1;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}
.tab:hover { background: rgba(255,255,255,0.15); color: white; }
.tab.active {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border-color: rgba(255,255,255,0.3);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

/* ---- Canvas Container ---- */
.canvas-container {
    flex: 1;
    position: relative;
    min-height: 300px;
    background: linear-gradient(180deg, #f0f4ff 0%, #e2e8f0 100%);
    touch-action: none;
    overflow: hidden;
}
.canvas-container::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 1;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="300" height="200"><text x="50%" y="50%" dominant-baseline="middle" text-anchor="middle" fill="%23000" fill-opacity="0.05" stroke="%23fff" stroke-width="2" stroke-opacity="0.1" font-family="sans-serif" font-size="24" font-weight="800" transform="rotate(-25, 150, 100)">tekteogren.com.tr</text></svg>');
    background-repeat: repeat;
    -webkit-mask-image: radial-gradient(ellipse at center, transparent 25%, black 60%);
    mask-image: radial-gradient(ellipse at center, transparent 25%, black 60%);
}
.canvas-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}
.canvas-hint {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.5);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    pointer-events: none;
    opacity: 0.7;
    transition: opacity 0.5s;
}
.canvas-hint.hidden { opacity: 0; }

/* ---- Background Picker ---- */
.bg-picker {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(255,255,255,0.6);
    padding: 8px;
    border-radius: 24px;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    z-index: 10;
}
.bg-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid white;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.bg-swatch:hover { transform: scale(1.15); }
.bg-swatch.active { 
    border-color: #6366f1; 
    transform: scale(1.15); 
    box-shadow: 0 0 0 3px rgba(99,102,241,0.3); 
}

/* ---- Mode Bar ---- */
.mode-bar {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    background: white;
    border-top: 1px solid #e2e8f0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-shrink: 0;
    max-width: 100vw;
}
.mode-bar::-webkit-scrollbar { display: none; }

.mode-btn {
    flex: 1;
    min-width: 120px;
    padding: 12px 10px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: white;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.mode-btn:hover { border-color: #a5b4fc; background: #f5f3ff; }
.mode-btn.active {
    border-color: #6366f1;
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    color: #4338ca;
    box-shadow: 0 2px 8px rgba(99,102,241,0.2);
}
.mode-btn[data-mode="vertices"].active { border-color: #ef4444; color: #dc2626; background: #fef2f2; }
.mode-btn[data-mode="edges"].active { border-color: #3b82f6; color: #2563eb; background: #eff6ff; }
.mode-btn[data-mode="faces"].active { border-color: #f59e0b; color: #d97706; background: #fffbeb; }

/* ---- Status Bar ---- */
.status-bar {
    padding: 12px 16px;
    background: white;
    border-top: 1px solid #e2e8f0;
    text-align: center;
    flex-shrink: 0;
}
.instruction {
    font-size: 16px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 4px;
}
.counter-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 6px;
}
#counter-text {
    font-size: 18px;
    font-weight: 800;
    color: #6366f1;
}
.reset-btn {
    background: #f1f5f9;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 4px 12px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.reset-btn:hover { background: #e2e8f0; }

.progress-wrapper { padding: 0 20px; }
.progress-track {
    width: 100%;
    height: 10px;
    background: #e2e8f0;
    border-radius: 5px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 5px;
    transition: width 0.4s ease;
}
.progress-fill.vertices { background: linear-gradient(90deg, #ef4444, #f87171); }
.progress-fill.edges { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.progress-fill.faces { background: linear-gradient(90deg, #f59e0b, #fbbf24); }

/* ---- Info Panel ---- */
.info-panel {
    padding: 10px 16px 14px;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(12px);
    flex-shrink: 0;
}
.info-grid {
    display: flex;
    gap: 10px;
    justify-content: center;
}
.info-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 10px 20px;
    background: rgba(255,255,255,0.08);
    border-radius: 12px;
    min-width: 90px;
    transition: all 0.3s;
}
.info-card.highlight {
    background: rgba(255,255,255,0.2);
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255,255,255,0.15);
}
.info-icon { font-size: 20px; }
.info-value { font-size: 24px; font-weight: 800; color: white; }
.info-label { font-size: 11px; color: #94a3b8; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }

/* ---- Celebration ---- */
.celebration {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    pointer-events: none;
}
.celebration-content {
    text-align: center;
    animation: celebPop 0.5s ease;
}
.celebration-emoji { font-size: 80px; animation: celebBounce 0.6s ease; }
.celebration-text {
    font-size: 28px;
    font-weight: 800;
    color: white;
    text-shadow: 0 3px 10px rgba(0,0,0,0.4);
    margin-top: 8px;
}
@keyframes celebPop { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes celebBounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-20px); } }

/* ---- No Feature Message ---- */
.no-feature-msg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255,255,255,0.95);
    padding: 20px 30px;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    text-align: center;
    z-index: 20;
    animation: celebPop 0.3s ease;
}
.no-feature-icon { font-size: 36px; display: block; margin-bottom: 8px; }
.no-feature-text { font-size: 16px; font-weight: 700; color: #475569; }

/* ---- Confetti ---- */
.confetti-piece {
    position: fixed;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    z-index: 200;
    pointer-events: none;
    animation: confettiFall 1.5s ease-out forwards;
}
@keyframes confettiFall {
    0% { opacity: 1; transform: translateY(0) rotate(0deg); }
    100% { opacity: 0; transform: translateY(100vh) rotate(720deg); }
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
    .tab { padding: 8px 14px; font-size: 12px; }
    .mode-btn { min-width: 100px; padding: 10px 6px; font-size: 11px; }
    .instruction { font-size: 14px; }
    .info-card { padding: 8px 14px; min-width: 75px; }
    .info-value { font-size: 20px; }
    .celebration-emoji { font-size: 60px; }
    .celebration-text { font-size: 22px; }
}
