/* ========== BASE RESET & VARIABLES ========== */
:root {
    --bg: #0a0a0f;
    --bg-card: #12121a;
    --bg-card-hover: #1a1a25;
    --bg-elevated: #1e1e2a;
    --text: #e8e8f0;
    --text-dim: #8888a0;
    --text-muted: #55556a;
    --accent: #f59e0b;
    --accent-hover: #fbbf24;
    --accent-dim: rgba(245, 158, 11, 0.15);
    --accent-glow: rgba(245, 158, 11, 0.3);
    --danger: #ef4444;
    --danger-dim: rgba(239, 68, 68, 0.15);
    --success: #22c55e;
    --success-dim: rgba(34, 197, 94, 0.15);
    --info: #3b82f6;
    --info-dim: rgba(59, 130, 246, 0.15);
    --border: rgba(255, 255, 255, 0.06);
    --border-light: rgba(255, 255, 255, 0.1);
    --radius: 14px;
    --radius-sm: 10px;
    --radius-lg: 20px;
    --shadow: 0 4px 24px rgba(0,0,0,0.3);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --header-height: 56px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ========== HEADER ========== */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    height: var(--header-height);
}

.header-inner {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 16px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.header-nokta-logo {
    height: 22px;
    width: auto;
}

.header-legend-logo {
    height: 18px;
    width: auto;
}

.reset-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-elevated);
    border-radius: 10px;
    color: var(--text-dim);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.reset-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text);
}

/* ========== MAIN ========== */
#mainContent {
    max-width: 480px;
    margin: 0 auto;
    padding-top: var(--header-height);
    min-height: 100dvh;
}

.screen {
    display: none;
    padding: 0 16px 32px;
    animation: fadeIn 0.3s ease;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========== WELCOME SCREEN ========== */
.welcome-hero {
    text-align: center;
    padding: 40px 8px 32px;
}

.hero-logos {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.hero-legend-logo {
    height: 36px;
    width: auto;
}

.hero-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.5px;
    margin-bottom: 12px;
}

.hero-desc {
    color: var(--text-dim);
    font-size: 15px;
    line-height: 1.5;
    max-width: 340px;
    margin: 0 auto;
}

.welcome-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.main-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    color: var(--text);
    width: 100%;
}

.main-option:hover, .main-option:active {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.option-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.problem-icon {
    background: var(--danger-dim);
    color: var(--danger);
}

.settings-icon {
    background: var(--accent-dim);
    color: var(--accent);
}

.option-content {
    flex: 1;
    min-width: 0;
}

.option-content h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 3px;
    letter-spacing: -0.2px;
}

.option-content p {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.4;
}

.option-arrow {
    color: var(--text-muted);
    flex-shrink: 0;
}

/* ========== PROGRESS BAR ========== */
.progress-bar {
    height: 3px;
    background: var(--bg-elevated);
    margin: 16px 0 0;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #fbbf24);
    border-radius: 2px;
    transition: width 0.4s ease;
    width: 0%;
}

/* ========== QUESTION SCREEN ========== */
.question-container {
    padding: 28px 0 20px;
}

.question-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.question-text {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.question-hint {
    font-size: 14px;
    color: var(--text-dim);
    line-height: 1.5;
    margin-bottom: 20px;
}

.question-hint:empty {
    display: none;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.option-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    color: var(--text);
    font-size: 15px;
    font-weight: 500;
    width: 100%;
    line-height: 1.4;
    font-family: var(--font);
}

.option-btn:hover, .option-btn:active {
    background: var(--bg-card-hover);
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

.option-btn .opt-emoji {
    font-size: 22px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elevated);
    border-radius: 10px;
    flex-shrink: 0;
}

.option-btn .opt-text {
    flex: 1;
}

.option-btn .opt-desc {
    display: block;
    font-size: 12px;
    color: var(--text-dim);
    font-weight: 400;
    margin-top: 2px;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: var(--font);
    transition: color 0.2s;
}

.back-btn:hover {
    color: var(--text);
}

/* ========== RESULTS SCREEN ========== */
.results-content {
    padding: 24px 0;
}

.result-header {
    text-align: center;
    margin-bottom: 24px;
}

.result-header .result-icon {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 28px;
}

.result-icon.settings-result {
    background: var(--accent-dim);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.result-icon.problem-result {
    background: var(--success-dim);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.result-header h2 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
}

.result-header p {
    font-size: 14px;
    color: var(--text-dim);
}

/* Settings Card */
.settings-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 12px;
    animation: slideUp 0.4s ease both;
}

.settings-card:nth-child(2) { animation-delay: 0.05s; }
.settings-card:nth-child(3) { animation-delay: 0.1s; }
.settings-card:nth-child(4) { animation-delay: 0.15s; }
.settings-card:nth-child(5) { animation-delay: 0.2s; }

.settings-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    font-size: 15px;
    font-weight: 600;
    color: var(--accent);
}

.settings-card-title .card-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--accent-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

/* Setting Row */
.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.setting-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.setting-row:first-of-type {
    padding-top: 0;
}

.setting-name {
    font-size: 14px;
    color: var(--text-dim);
    font-weight: 400;
}

.setting-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    background: var(--bg-elevated);
    padding: 4px 12px;
    border-radius: 8px;
    min-width: 48px;
    text-align: center;
}

.setting-value.highlight {
    background: var(--accent-dim);
    color: var(--accent);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* Tip Card */
.tip-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    animation: slideUp 0.4s ease both;
}

.tip-card.warning {
    border-color: rgba(245, 158, 11, 0.2);
    background: rgba(245, 158, 11, 0.04);
}

.tip-card.info {
    border-color: rgba(59, 130, 246, 0.2);
    background: rgba(59, 130, 246, 0.04);
}

.tip-card.success {
    border-color: rgba(34, 197, 94, 0.2);
    background: rgba(34, 197, 94, 0.04);
}

.tip-card .tip-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tip-card.warning .tip-title { color: var(--accent); }
.tip-card.info .tip-title { color: var(--info); }
.tip-card.success .tip-title { color: var(--success); }

.tip-card .tip-text {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.6;
}

.tip-card .tip-text strong {
    color: var(--text);
    font-weight: 600;
}

/* Step List */
.step-list {
    list-style: none;
    counter-reset: steps;
}

.step-list li {
    counter-increment: steps;
    padding: 10px 0 10px 36px;
    position: relative;
    font-size: 14px;
    color: var(--text-dim);
    line-height: 1.5;
    border-bottom: 1px solid var(--border);
}

.step-list li:last-child {
    border-bottom: none;
}

.step-list li::before {
    content: counter(steps);
    position: absolute;
    left: 0;
    top: 10px;
    width: 24px;
    height: 24px;
    border-radius: 8px;
    background: var(--accent-dim);
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.step-list li strong {
    color: var(--text);
    font-weight: 600;
}

/* Buttons */
.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--accent), #d97706);
    color: #000;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.25);
}

.results-actions {
    padding: 0 0 40px;
}

/* Section Divider */
.section-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 14px;
}

.section-divider span {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}

.section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Responsive */
@media (max-width: 380px) {
    .welcome-hero h1 {
        font-size: 28px;
    }
    .question-text {
        font-size: 20px;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 4px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 2px;
}
