﻿:root {
    --bg-main: #0f172a;
    --bg-soft: #111827;
    --bg-elevated: #172033;
    --bg-card: rgba(30, 41, 59, 0.94);
    
    --border-soft: rgba(255, 255, 255, 0.08);
    --border-mid: rgba(255, 255, 255, 0.14);
    
    --text-main: #ffffff;
    --text-soft: #cbd5e1;
    --text-muted: #94a3b8;

    --accent-1: #8b5cf6;
    --accent-2: #38bdf8;
    
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    color-scheme: dark;
}

body {
    min-height: 100vh;
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-main);
    background:
        radial-gradient(circle at 0% 0%, rgba(56, 189, 248, 0.16), transparent 26%),
        radial-gradient(circle at 100% 0%, rgba(139, 92, 246, 0.16), transparent 24%),
        radial-gradient(circle at 50% 100%, rgba(34, 197, 94, 0.08), transparent 28%),
        linear-gradient(180deg, #0b1220 0%, #0f172a 45%, #111827 100%);
    caret-color: transparent;
}

a, button, h1, h2, h3, p, div, span, label, li, strong, em, b, i, pre, code {
    caret-color: transparent;
}

a {
    color: inherit;
    text-decoration: none;
}

/* =========================================
   РЇР”Р•Р РќРћР• РџР РђР’РР›Рћ РџР РћРўРР’ Р§Р•Р РќРћР“Рћ РўР•РљРЎРўРђ
   ========================================= */
.force-white,
.force-white * {
    color: #ffffff !important;
    background-color: transparent !important;
}
/* ========================================= */

.header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 34px;
    background: rgba(11, 18, 32, 0.78);
    border-bottom: 1px solid var(--border-soft);
    backdrop-filter: blur(14px);
}

.logo {
    color: var(--text-main);
    font-size: 31px;
    font-weight: 800;
    letter-spacing: 1px;
    user-select: none;
    -webkit-user-select: none;
    cursor: pointer;
    transition: transform 0.18s ease, color 0.18s ease;
}

.logo:hover {
    color: #ffffff;
    transform: translateY(-1px);
}

/* SVG Logo styles */
.site-logo {
    cursor: pointer;
    transition: transform 0.2s ease;
    display: block;
}

.site-logo:hover {
    transform: scale(1.05);
}

.nav {
    display: flex;
    gap: 16px;
    margin-right: auto;
    margin-left: 24px;
}

.nav a {
    color: var(--text-soft);
    font-size: 15px;
    font-weight: 600;
    padding: 8px 0;
    transition: color 0.18s ease;
}

.nav a:hover {
    color: #ffffff;
}

.main {
    max-width: 1280px;
    width: 100%;
    margin-inline: auto;
    padding: 44px 22px 70px;
    box-sizing: border-box;
}

.page-title {
    margin: 0 0 10px 0;
    font-size: 48px;
    font-weight: 800;
    letter-spacing: -1px;
    color: var(--text-main);
    user-select: none;
}

.page-subtitle {
    margin: 0 0 30px 0;
    font-size: 17px;
    color: var(--text-soft);
    user-select: none;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 18px;
}

.card {
    display: block;
    padding: 24px 22px;
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.92) 0%, rgba(17, 24, 39, 0.98) 100%);
    border: 1px solid var(--border-soft);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
    user-select: none;
    cursor: pointer;
}

.card:hover {
    transform: translateY(-3px);
    border-color: rgba(129, 140, 248, 0.35);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
}

.card-title {
    margin: 0 0 12px 0;
    font-size: 30px;
    font-weight: 800;
    color: var(--text-main);
}

.card-text {
    margin: 0;
    font-size: 15px;
    color: var(--text-soft);
}

.filters, .filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
    padding: 16px;
    border-radius: var(--radius-md);
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid var(--border-soft);
}

label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 170px;
    color: var(--text-main);
    font-size: 14px;
    font-weight: 600;
}

select, input, textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-mid);
    background: rgba(15, 23, 42, 0.94);
    color: #ffffff !important;
    font-size: 15px;
    box-shadow: none;
}

select:focus, input:focus {
    outline: none;
    border-color: rgba(56, 189, 248, 0.65);
}

option {
    background: #111827 !important;
    color: #ffffff !important;
}

button, .btn, .btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    color: #ffffff !important;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 10px 24px rgba(56, 189, 248, 0.18);
    transition: transform 0.18s ease, opacity 0.18s ease;
}

button:hover {
    transform: translateY(-1px);
    opacity: 0.98;
}

/* РљРђР РўРћР§РљРђ Р—РђР”РђР§Р РќРђ РЎРўР РђРќРР¦Р• Р Р•РЁР•РќРРЇ */
.problem-card {
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.94) 0%, rgba(17, 24, 39, 0.98) 100%);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.problem-title {
    margin: 0 0 8px 0;
    font-size: 32px;
    font-weight: 800;
    color: var(--text-main);
}

.problem-text {
    font-size: 18px;
    line-height: 1.7;
    margin-bottom: 24px;
}

.answer {
    padding: 18px;
    margin-top: 20px;
    border-radius: 14px;
    background: rgba(34, 197, 94, 0.1); /* Р›РµРіРєРёР№ Р·РµР»РµРЅС‹Р№ С„РѕРЅ */
    border: 1px solid rgba(34, 197, 94, 0.22);
    font-size: 17px;
}

.solution {
    padding: 18px;
    margin-top: 16px;
    border-radius: 14px;
    background: rgba(56, 189, 248, 0.08); /* Р›РµРіРєРёР№ СЃРёРЅРёР№ С„РѕРЅ */
    border: 1px solid rgba(56, 189, 248, 0.18);
    font-size: 17px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    margin-bottom: 18px;
    color: var(--text-soft);
    font-weight: 600;
    transition: color 0.18s ease, transform 0.18s ease;
}

.back-link:hover {
    color: #ffffff;
    transform: translateX(-2px);
}

@media (max-width: 860px) {
    .header { padding: 16px 18px; }
    .logo { font-size: 24px; }
    .main { padding: 30px 16px 52px; }
    .page-title { font-size: 36px; }
    .problem-title { font-size: 26px; }
    .problem-card { padding: 18px; }
    .problem-text, .answer, .solution { font-size: 16px; }
}

/* РђРґР°РїС‚РёРІРЅР°СЏ РІРµСЂСЃС‚РєР° РґР»СЏ РјРѕР±РёР»СЊРЅС‹С… */
@media (max-width: 768px) {
    /* РќР°РІРёРіР°С†РёСЏ */
    .header {
        flex-wrap: wrap;
        padding: 10px 15px;
    }
    
    .nav {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--bg-elevated);
        flex-direction: column;
        padding: 15px;
        border-bottom: 1px solid var(--border-soft);
        z-index: 100;
        gap: 8px;
    }
    
    .nav.active {
        display: flex !important;
    }
    
    .nav a {
        width: 100%;
        padding: 14px;
        text-align: center;
        font-size: 15px;
        background: rgba(30, 41, 59, 0.6);
        border-radius: 8px;
        border: 1px solid var(--border-soft);
        transition: all 0.2s;
    }
    
    .nav a:active {
        background: rgba(56, 189, 248, 0.2);
        border-color: var(--accent-2);
    }
    
    /* Hamburger РєРЅРѕРїРєР° */
    .hamburger {
        display: block !important;
        background: none;
        border: none;
        color: var(--text-main);
        font-size: 24px;
        cursor: pointer;
        padding: 8px;
    }
    
    /* РљР°СЂС‚РѕС‡РєРё РІ РѕРґРЅСѓ РєРѕР»РѕРЅРєСѓ */
    .cards-grid {
        grid-template-columns: 1fr !important;
    }
    
    /* AI-С‚СЊСЋС‚РѕСЂ РЅР° РІСЃСЋ С€РёСЂРёРЅСѓ */
    #tutorChat {
        width: 100vw !important;
        height: 100vh !important;
        bottom: 0 !important;
        right: 0 !important;
        border-radius: 0 !important;
    }
    
    #tutorBtn {
        bottom: 10px !important;
        right: 10px !important;
    }
    
    /* РљСЂСѓРїРЅРµРµ С€СЂРёС„С‚С‹ Рё РєРЅРѕРїРєРё */
    body {
        font-size: 16px;
    }
    
    button, .btn, a.card {
        min-height: 44px;
        font-size: 16px;
    }
    
    input, textarea {
        font-size: 16px;
        padding: 12px;
    }
}


/* ============================================================
   CAPS LOCK TOGGLE BUTTON
   ============================================================ */

.caps-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    background: rgba(30, 41, 59, 0.8);
    border: 2px solid var(--border-mid);
    border-radius: 8px;
    color: var(--text-soft);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    min-width: 80px;
    gap: 6px;
}

.caps-toggle-btn:hover {
    background: rgba(30, 41, 59, 1);
    border-color: var(--accent-2);
    color: var(--text-main);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.caps-toggle-btn:active {
    transform: translateY(0);
}

.caps-toggle-btn.active {
    background: linear-gradient(135deg, #38ef7d 0%, #11998e 100%);
    border-color: #38ef7d;
    color: #000;
    font-weight: 700;
    box-shadow: 0 0 20px rgba(56, 239, 125, 0.5);
    animation: pulse-glow 2s ease-in-out infinite;
}

.caps-toggle-btn.active:hover {
    background: linear-gradient(135deg, #4fffb0 0%, #1ac9b8 100%);
    transform: translateY(-2px);
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(56, 239, 125, 0.5); }
    50% { box-shadow: 0 0 30px rgba(56, 239, 125, 0.8); }
}

/* Неоновый caret */
input, textarea, [contenteditable] {
    caret-color: #38ef7d;
}

.answer-input, .solution-input, .math-input {
    caret-color: #11998e;
}

.input-with-caps {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.input-with-caps input, .input-with-caps textarea {
    flex: 1;
    min-width: 200px;
}

@media (max-width: 768px) {
    .caps-toggle-btn { padding: 10px 14px; font-size: 13px; min-width: 70px; }
}

@media (max-width: 480px) {
    .input-with-caps { flex-direction: column; }
    .input-with-caps input, .input-with-caps textarea { width: 100%; }
    .caps-toggle-btn { width: 100%; }
}

/* ── Daily Quest Navbar Link ── */
.daily-nav-link,
.daily-link {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    padding: 6px 14px !important;
    margin-right: 8px;
    background: linear-gradient(135deg,
                rgba(249,115,22,0.25),
                rgba(56,239,125,0.25)) !important;
    border: 1px solid rgba(249,115,22,0.5) !important;
    border-radius: 8px !important;
    color: #fff !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    transition: all 0.2s ease;
}

.daily-nav-link:hover,
.daily-link:hover {
    box-shadow: 0 0 16px rgba(249,115,22,0.6) !important;
    transform: translateY(-1px);
    text-decoration: none;
}

.daily-flame,
.daily-icon {
    animation: flame-nav 1.8s ease-in-out infinite alternate;
    display: inline-block;
}

@keyframes flame-nav {
    0%   { filter: drop-shadow(0 0 3px #f97316); transform: scale(1); }
    100% { filter: drop-shadow(0 0 8px #fbbf24); transform: scale(1.08); }
}

.daily-badge {
    font-size: 0.7em;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    background: #38ef7d;
    color: #000;
    line-height: 1.4;
}

.daily-badge.done {
    background: #11998e;
    color: #fff;
}

.daily-badge.new {
    background: #f97316;
    color: #fff;
    animation: pulse-new 1.5s infinite;
}

@keyframes pulse-new {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.12); }
}

/* ── Daily Quest btn-solve ── */
.btn-solve {
    display: inline-block;
    padding: 12px 24px;
    background: linear-gradient(135deg, #11998e, #38ef7d);
    color: #000 !important;
    font-weight: 700;
    border-radius: 10px;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(56,239,125,0.4);
    transition: all 0.25s ease;
}

.btn-solve:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(56,239,125,0.6);
    text-decoration: none;
}
