/* ============================================================
   Цифраниум — кастомные стили (поверх Tailwind CDN)
   ============================================================ */

:root {
    --bg: #07050d;
    --bg-soft: #0b0717;
    --bg-deep: #050309;
    --primary: #8b5cf6;
    --accent: #d946ef;
    --border: rgba(255, 255, 255, 0.08);
}

html { scroll-behavior: smooth; }

body {
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
    background: var(--bg);
    color: #f5f3ff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: rgba(139, 92, 246, 0.35);
    color: #ffffff;
}

/* ---------- Скроллбар ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(139, 92, 246, 0.5), rgba(217, 70, 239, 0.4));
    border-radius: 9999px;
    border: 2px solid var(--bg-deep);
}
::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(139, 92, 246, 0.8), rgba(217, 70, 239, 0.6));
}

.scrollbar-thin {
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 92, 246, 0.5) transparent;
}
.scrollbar-thin::-webkit-scrollbar { width: 6px; height: 6px; }
.scrollbar-thin::-webkit-scrollbar-thumb { background: rgba(139, 92, 246, 0.5); border-radius: 9999px; }
.scrollbar-thin::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   Утилитарные классы
   ============================================================ */

.text-gradient-violet {
    background: linear-gradient(135deg, #c4b5fd 0%, #f0abfc 60%, #fbcfe8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.text-gradient-aurora {
    background: linear-gradient(120deg, #8b5cf6 0%, #d946ef 50%, #14b8a6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.aurora-bg {
    background:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(139, 92, 246, 0.25), transparent 60%),
        radial-gradient(ellipse 60% 50% at 100% 50%, rgba(217, 70, 239, 0.18), transparent 60%),
        radial-gradient(ellipse 60% 50% at 0% 80%, rgba(99, 102, 241, 0.16), transparent 60%);
}

.bg-grid {
    background-image:
        linear-gradient(to right, rgba(139, 92, 246, 0.06) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(139, 92, 246, 0.06) 1px, transparent 1px);
    background-size: 56px 56px;
}

.bg-dot {
    background-image: radial-gradient(circle, rgba(139, 92, 246, 0.15) 1px, transparent 1px);
    background-size: 24px 24px;
}

.glass {
    background: rgba(255, 255, 255, 0.025);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.glass-strong {
    background: rgba(17, 10, 34, 0.72);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(139, 92, 246, 0.18);
}

.glow-violet { box-shadow: 0 0 80px -20px rgba(139, 92, 246, 0.55); }
.border-glow {
    box-shadow:
        0 0 0 1px rgba(139, 92, 246, 0.25),
        0 0 40px -10px rgba(139, 92, 246, 0.45);
}

.mask-fade-b {
    -webkit-mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
}

.text-balance { text-wrap: balance; }
.text-pretty { text-wrap: pretty; }

/* SEO-link внутри seo-text-block */
.seo-link {
    color: #c4b5fd;
    text-decoration: underline;
    text-decoration-color: rgba(167, 139, 250, 0.4);
    text-underline-offset: 2px;
    transition: color .15s, text-decoration-color .15s;
}
.seo-link:hover {
    color: #ddd6fe;
    text-decoration-color: #c4b5fd;
}

/* ============================================================
   Markdown content (.markdown-content)
   ============================================================ */

.markdown-content {
    color: #d4d4d8;
    font-size: 16px;
    line-height: 1.75;
}
.markdown-content > * + * { margin-top: 1rem; }

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4 {
    color: #ffffff;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.01em;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}
.markdown-content h1 { font-size: 2rem; }
.markdown-content h2 {
    font-size: 1.5rem;
    color: #c4b5fd;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}
.markdown-content h3 { font-size: 1.25rem; color: #ddd6fe; }

.markdown-content p { color: #d4d4d8; }

.markdown-content ul,
.markdown-content ol {
    padding-left: 1.5rem;
    margin: 1rem 0;
}
.markdown-content ul li {
    list-style: disc;
    margin: 0.4rem 0;
}
.markdown-content ol li {
    list-style: decimal;
    margin: 0.4rem 0;
}
.markdown-content li::marker { color: #8b5cf6; }

.markdown-content a {
    color: #c4b5fd;
    text-decoration: underline;
    text-decoration-color: rgba(167, 139, 250, 0.4);
    text-underline-offset: 2px;
    transition: color .15s;
}
.markdown-content a:hover { color: #ddd6fe; }

.markdown-content strong { color: #ffffff; font-weight: 600; }
.markdown-content em { color: #f0abfc; font-style: italic; }

.markdown-content code {
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.2);
    color: #ddd6fe;
    padding: 0.15em 0.4em;
    border-radius: 6px;
    font-size: 0.9em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.markdown-content pre {
    background: #0b0717;
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}
.markdown-content pre code {
    background: transparent;
    border: 0;
    color: #e4e4e7;
    padding: 0;
    font-size: 0.875rem;
    line-height: 1.6;
}

.markdown-content blockquote {
    border-left: 3px solid #8b5cf6;
    background: rgba(139, 92, 246, 0.06);
    padding: 0.75rem 1.25rem;
    margin: 1.25rem 0;
    border-radius: 0 8px 8px 0;
    color: #c4b5fd;
    font-style: italic;
}

/* ============================================================
   Анимации
   ============================================================ */

@keyframes pulse-glow {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}
.animate-pulse-glow { animation: pulse-glow 4s ease-in-out infinite; }

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
.animate-float { animation: float 6s ease-in-out infinite; }

@keyframes marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}
.animate-marquee { animation: marquee 40s linear infinite; }

@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.animate-spin-slow { animation: spin-slow 24s linear infinite; }

@keyframes fade-in-up {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in-up { animation: fade-in-up 0.6s ease-out both; }

/* ============================================================
   Админ-панель
   ============================================================ */

.admin-input,
.admin-textarea,
.admin-select {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 0.625rem 0.875rem;
    color: #f5f3ff;
    font-size: 14px;
    line-height: 1.4;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.admin-input:focus,
.admin-textarea:focus,
.admin-select:focus {
    outline: none;
    border-color: rgba(139, 92, 246, 0.55);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
    background: rgba(255, 255, 255, 0.06);
}
.admin-input::placeholder,
.admin-textarea::placeholder { color: rgba(161, 161, 170, 0.6); }

.admin-textarea { font-family: inherit; min-height: 100px; resize: vertical; }
.admin-textarea.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 13px; min-height: 320px; }

.admin-label {
    display: block;
    margin-bottom: 0.4rem;
    color: #a1a1aa;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.admin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.55rem 1.1rem;
    border-radius: 9999px;
    background: linear-gradient(135deg, #8b5cf6, #d946ef);
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    border: 0;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s, opacity .15s;
    box-shadow: 0 0 24px -6px rgba(139, 92, 246, 0.8);
}
.admin-btn:hover { transform: translateY(-1px); box-shadow: 0 0 32px -6px rgba(139, 92, 246, 1); }
.admin-btn:active { transform: translateY(0); }
.admin-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.admin-btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.55rem 1.1rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.05);
    color: #f5f3ff;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.12);
    cursor: pointer;
    transition: background .15s, border-color .15s;
    text-decoration: none;
}
.admin-btn-outline:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.2); }

.admin-btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    border-radius: 9999px;
    background: rgba(244, 63, 94, 0.12);
    color: #fda4af;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid rgba(244, 63, 94, 0.25);
    cursor: pointer;
    transition: background .15s;
}
.admin-btn-danger:hover { background: rgba(244, 63, 94, 0.2); }

.admin-sidebar {
    background: #0b0717;
    border-right: 1px solid rgba(139, 92, 246, 0.15);
}

.admin-nav-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 0.85rem;
    border-radius: 10px;
    color: #a1a1aa;
    font-size: 14px;
    font-weight: 500;
    transition: background .15s, color .15s;
    text-decoration: none;
}
.admin-nav-link:hover {
    background: rgba(139, 92, 246, 0.08);
    color: #f5f3ff;
}
.admin-nav-link.active {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.18), rgba(217, 70, 239, 0.1));
    color: #ffffff;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.admin-card {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 1.25rem;
    transition: border-color .15s, background .15s;
}
.admin-card:hover {
    border-color: rgba(139, 92, 246, 0.25);
    background: rgba(255, 255, 255, 0.04);
}

.admin-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.admin-badge-green { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.3); }
.admin-badge-amber { background: rgba(245, 158, 11, 0.15); color: #fcd34d; border: 1px solid rgba(245, 158, 11, 0.3); }
.admin-badge-violet{ background: rgba(139, 92, 246, 0.15); color: #c4b5fd; border: 1px solid rgba(139, 92, 246, 0.3); }
.admin-badge-zinc  { background: rgba(161, 161, 170, 0.12); color: #d4d4d8; border: 1px solid rgba(161, 161, 170, 0.25); }

/* Чекбокс-стайл для админки */
.admin-checkbox {
    width: 18px;
    height: 18px;
    accent-color: #8b5cf6;
}

/* Скрытый скроллбар для горизонтальных блоков */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Контейнер страницы */
.page-container { max-width: 80rem; margin: 0 auto; padding-left: 1rem; padding-right: 1rem; }
@media (min-width: 640px) { .page-container { padding-left: 1.5rem; padding-right: 1.5rem; } }
@media (min-width: 1024px) { .page-container { padding-left: 2rem; padding-right: 2rem; } }
