/* === MAIN.CSS === */
/* assets/css/main.css */
/* НАЗНАЧЕНИЕ: дизайн-система "Органическое" - OKLCH, Comfortaa/Nunito, базовые компоненты */
/* СВЯЗИ: подключается во всех views; light override в конце файла */

:root {
    /* Тёплая зелёно-охристая палитра (тема природы, тепла, животных) */
    --bg-primary:   oklch(0.21 0.018 145);   /* тёмный тёплый зелёный */
    --bg-elevated:  oklch(0.25 0.022 145);
    --bg-card:      oklch(0.27 0.024 140);
    --bg-input:     oklch(0.30 0.020 140);

    --accent:       oklch(0.78 0.15 75);      /* тёплый охристо-жёлтый */
    --accent-soft:  oklch(0.78 0.15 75 / 0.14);
    --accent-2:     oklch(0.72 0.13 155);     /* зелёный-трава */
    --accent-warm:  oklch(0.70 0.16 35);      /* тёплый коралл (CTA) */

    --text-primary: oklch(0.96 0.012 110);
    --text-muted:   oklch(0.72 0.020 120);
    --text-faint:   oklch(0.55 0.018 120);

    --border:       oklch(0.40 0.020 140 / 0.5);
    --border-soft:  oklch(0.50 0.020 140 / 0.25);

    --radius-sm: 10px;
    --radius:    16px;
    --radius-lg: 24px;

    --shadow:    0 4px 24px oklch(0.10 0.02 145 / 0.4);
    --shadow-lg: 0 12px 48px oklch(0.08 0.02 145 / 0.5);

    --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
    --ease-out-expo:  cubic-bezier(0.16, 1, 0.3, 1);

    --font-display: 'Comfortaa', system-ui, sans-serif;
    --font-body:    'Nunito', system-ui, sans-serif;

    --maxw: 1200px;
}

html.light-theme {
    --bg-primary:   oklch(0.97 0.014 95);     /* тёплый кремовый */
    --bg-elevated:  oklch(0.99 0.010 95);
    --bg-card:      oklch(1 0 0);
    --bg-input:     oklch(0.96 0.012 95);

    --accent:       oklch(0.68 0.15 65);
    --accent-soft:  oklch(0.68 0.15 65 / 0.12);
    --accent-2:     oklch(0.58 0.13 150);
    --accent-warm:  oklch(0.62 0.18 32);

    --text-primary: oklch(0.25 0.020 140);
    --text-muted:   oklch(0.45 0.020 140);
    --text-faint:   oklch(0.60 0.018 140);

    --border:       oklch(0.55 0.020 140 / 0.22);
    --border-soft:  oklch(0.55 0.020 140 / 0.12);

    --shadow:    0 4px 24px oklch(0.50 0.04 95 / 0.12);
    --shadow-lg: 0 12px 48px oklch(0.50 0.04 95 / 0.16);
}

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

.no-transition, .no-transition * { transition: none !important; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 16px;
    min-height: 100vh;
    transition: background 0.4s var(--ease-out-quart), color 0.4s var(--ease-out-quart);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.4rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.6rem); }

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

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* --- Header --- */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: color-mix(in oklch, var(--bg-primary) 86%, transparent);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-soft);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; }
.logo-paw { font-size: 1.6rem; }
.nav { display: flex; align-items: center; gap: 8px; }
.nav a { padding: 8px 14px; border-radius: var(--radius-sm); color: var(--text-muted); font-weight: 600; transition: all 0.2s; }
.nav a:hover, .nav a.active { color: var(--text-primary); background: var(--accent-soft); }

/* --- Buttons --- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 22px; border-radius: var(--radius-sm);
    font-family: var(--font-body); font-weight: 700; font-size: 0.98rem;
    border: none; cursor: pointer; transition: all 0.25s var(--ease-out-quart);
    white-space: nowrap;
}
.btn-primary { background: var(--accent-warm); color: oklch(0.99 0 0); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px var(--accent-soft); filter: brightness(1.05); }
.btn-ghost { background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-accent { background: var(--accent); color: oklch(0.2 0.02 80); }
.btn-accent:hover { transform: translateY(-2px); filter: brightness(1.05); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* --- Theme toggle --- */
.mode-btn { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-muted); transition: all 0.2s; }
.mode-btn:hover { color: var(--accent); border-color: var(--accent); }
.mode-icon-light { display: none; }
.mode-icon-dark  { display: block; }
html.light-theme .mode-icon-light { display: block; }
html.light-theme .mode-icon-dark  { display: none; }

/* --- Cards --- */
.card { background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: var(--radius); box-shadow: var(--shadow); }

/* --- Chips --- */
.chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 12px; border-radius: 999px;
    font-size: 0.82rem; font-weight: 600;
    background: var(--accent-soft); color: var(--accent);
    white-space: nowrap;
}

/* --- Toast --- */
.toast-wrap { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
    background: var(--bg-elevated); color: var(--text-primary);
    padding: 14px 20px; border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg); border: 1px solid var(--border);
    font-weight: 600; min-width: 260px;
    animation: toastIn 0.4s var(--ease-out-expo);
}
.toast.success { border-left: 4px solid var(--accent-2); }
.toast.error   { border-left: 4px solid var(--accent-warm); }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* --- Skeleton --- */
.skeleton { background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-elevated) 50%, var(--bg-card) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius); }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* --- Footer --- */
.site-footer { margin-top: 80px; padding: 40px 0; border-top: 1px solid var(--border-soft); color: var(--text-muted); text-align: center; }
.site-footer a { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
