/* ============================================
   ToolKit Pro - Premium Dark Theme
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
    /* Основные цвета */
    --bg-primary: #0a0a12;
    --bg-secondary: #111120;
    --bg-card: #16162a;
    --bg-card-hover: #1c1c38;
    --bg-elevated: #1e1e3a;
    --bg-input: #0e0e1e;

    /* Текст */
    --text-primary: #f0f0f8;
    --text-secondary: #b8b8d0;
    --text-muted: #7878a0;
    --text-dim: #505070;

    /* Акценты - неоновая палитра */
    --accent-primary: #7c6cf0;
    --accent-secondary: #a78bfa;
    --accent-glow: rgba(124, 108, 240, 0.25);
    --accent-green: #34d399;
    --accent-pink: #f472b6;
    --accent-cyan: #22d3ee;
    --accent-orange: #fb923c;
    --accent-red: #f87171;

    /* Границы */
    --border-color: #2a2a4a;
    --border-light: rgba(124, 108, 240, 0.15);

    /* Скругления */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 50px;

    /* Тени */
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-card-hover: 0 8px 35px rgba(0, 0, 0, 0.4), 0 0 30px rgba(124, 108, 240, 0.08);
    --shadow-glow: 0 0 25px rgba(124, 108, 240, 0.12);
    --shadow-glow-strong: 0 0 40px rgba(124, 108, 240, 0.2);

    /* Градиенты */
    --gradient-primary: linear-gradient(135deg, #7c6cf0, #a78bfa, #c084fc);
    --gradient-hero: linear-gradient(135deg, #0a0a12 0%, #111120 40%, #0f0f2a 100%);
    --gradient-card: linear-gradient(135deg, rgba(124, 108, 240, 0.08), rgba(192, 132, 252, 0.03));
    --gradient-btn: linear-gradient(135deg, #7c6cf0, #6d5ee0);
    --gradient-btn-hover: linear-gradient(135deg, #8d7df5, #7c6cf0);
    --gradient-success: linear-gradient(135deg, #34d399, #10b981);
    --gradient-danger: linear-gradient(135deg, #f87171, #ef4444);

    /* Анимации */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========== БАЗОВЫЕ СТИЛИ ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

::selection {
    background: rgba(124, 108, 240, 0.3);
    color: #fff;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ========== НАВИГАЦИЯ ========== */
.navbar {
    background: rgba(10, 10, 18, 0.85) !important;
    backdrop-filter: blur(24px) saturate(1.2);
    -webkit-backdrop-filter: blur(24px) saturate(1.2);
    border-bottom: 1px solid var(--border-color);
    padding: 14px 0;
    transition: var(--transition-normal);
}

.navbar.scrolled {
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.4rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-brand .brand-icon {
    font-size: 1.5rem;
    -webkit-text-fill-color: initial;
    color: var(--accent-primary);
}

.nav-link {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-secondary) !important;
    padding: 8px 16px !important;
    border-radius: var(--radius-full);
    transition: var(--transition-normal);
}

.nav-link:hover {
    color: var(--text-primary) !important;
    background: rgba(124, 108, 240, 0.08);
}

/* ========== HERO СЕКЦИЯ ========== */
.hero-section {
    background: var(--gradient-hero);
    padding: 100px 0 70px;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -60%;
    left: -40%;
    width: 180%;
    height: 180%;
    background:
        radial-gradient(ellipse at 25% 40%, rgba(124, 108, 240, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 75% 60%, rgba(192, 132, 252, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(52, 211, 153, 0.04) 0%, transparent 40%);
    pointer-events: none;
    animation: heroGlow 20s ease-in-out infinite alternate;
}

@keyframes heroGlow {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-15px, 15px) scale(1.02); }
    100% { transform: translate(15px, -10px) scale(0.98); }
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(124, 108, 240, 0.12);
    border: 1px solid rgba(124, 108, 240, 0.2);
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    color: var(--accent-secondary);
    margin-bottom: 20px;
}

.hero-badge i {
    font-size: 0.75rem;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 900;
    line-height: 1.1;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
    letter-spacing: -1px;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 650px;
    margin: 0 auto 35px;
    line-height: 1.7;
}

/* Поиск */
.search-box {
    max-width: 550px;
    margin: 0 auto;
    position: relative;
}

.search-box .form-control {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    padding: 16px 24px 16px 52px;
    font-size: 1rem;
    transition: var(--transition-normal);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.search-box .form-control:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(124, 108, 240, 0.1), 0 4px 20px rgba(0, 0, 0, 0.3);
    outline: none;
}

.search-box .form-control::placeholder {
    color: var(--text-muted);
}

.search-box .search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.1rem;
    pointer-events: none;
}

/* ========== СТАТИСТИКА ========== */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px 16px;
    text-align: center;
    transition: var(--transition-normal);
}

.stat-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow-glow);
}

.stat-number {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.2;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 4px;
    font-weight: 500;
}

/* ========== КАТЕГОРИИ ИНСТРУМЕНТОВ ========== */
.tool-category {
    margin-bottom: 40px;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.category-header .cat-icon {
    font-size: 1.8rem;
    line-height: 1;
}

.category-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.3px;
}

.category-count {
    background: var(--bg-elevated);
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    margin-left: auto;
}

/* ========== КАРТОЧКИ ИНСТРУМЕНТОВ ========== */
.tool-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    text-align: center;
    transition: var(--transition-slow);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    height: 100%;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: var(--transition-normal);
}

.tool-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-card-hover);
}

.tool-card:hover::before {
    opacity: 1;
}

.tool-card-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 12px;
    transition: var(--transition-normal);
}

.tool-card:hover .tool-card-icon {
    transform: scale(1.15);
}

.tool-card-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 6px;
    transition: var(--transition-normal);
}

.tool-card:hover .tool-card-title {
    color: var(--accent-secondary);
}

.tool-card-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

a.tool-card-link {
    text-decoration: none;
    display: block;
    height: 100%;
}

/* ========== СТРАНИЦА ИНСТРУМЕНТА ========== */
.tool-page {
    padding: 30px 0 60px;
}

.tool-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 36px;
    box-shadow: var(--shadow-card);
    max-width: 800px;
    margin: 0 auto;
}

.tool-header {
    margin-bottom: 30px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.tool-icon-big {
    font-size: 2.8rem;
    line-height: 1;
}

.tool-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.tool-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 4px;
}

/* ========== ФОРМЫ ========== */
.form-label {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 6px;
}

.form-control,
.form-select {
    background: var(--bg-input);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    padding: 12px 16px;
    font-size: 0.95rem;
    transition: var(--transition-normal);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(124, 108, 240, 0.12);
    background: var(--bg-input);
    color: var(--text-primary);
    outline: none;
}

.form-control::placeholder {
    color: var(--text-dim);
}

.form-control:read-only {
    opacity: 0.8;
}

.form-select {
    cursor: pointer;
}

.form-select option {
    background: var(--bg-card);
    color: var(--text-primary);
}

.form-text {
    color: var(--text-muted) !important;
    font-size: 0.8rem;
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    line-height: 1.5;
}

/* ========== ОБЛАСТЬ ЗАГРУЗКИ ФАЙЛОВ ========== */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 50px 30px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-normal);
    background: var(--gradient-card);
    position: relative;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--accent-primary);
    background: rgba(124, 108, 240, 0.05);
    box-shadow: var(--shadow-glow);
}

.upload-area .upload-icon {
    font-size: 3.5rem;
    color: var(--accent-primary);
    margin-bottom: 16px;
    transition: var(--transition-normal);
}

.upload-area:hover .upload-icon {
    transform: scale(1.1);
}

.upload-area h5 {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.upload-area p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.upload-area .file-info {
    color: var(--accent-green) !important;
    font-weight: 600;
    margin-top: 10px;
    padding: 6px 16px;
    background: rgba(52, 211, 153, 0.08);
    border-radius: var(--radius-sm);
    display: inline-block;
}

/* ===== Загрузка файла: прозрачный оверлей =====
   Вместо display:none + input.click() (который блокируется на мобильных),
   файловый input растягивается на всю область и остаётся прозрачным.
   Нажатие в любом месте области открывает системный выбор файла — работает
   нативно на iOS/Android без JavaScript. */
.upload-area .file-input-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

.upload-area {
    overflow: hidden;
}

/* ========== КНОПКИ ========== */
.btn {
    font-weight: 600;
    padding: 12px 28px;
    border-radius: var(--radius-md);
    transition: var(--transition-normal);
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--gradient-btn);
    color: #fff;
    border-radius: var(--radius-md);
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 600;
}

.btn-primary:hover {
    background: var(--gradient-btn-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(124, 108, 240, 0.3);
    color: #fff;
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-lg {
    padding: 16px 36px;
    font-size: 1.05rem;
    border-radius: var(--radius-lg);
}

.btn-success {
    background: var(--gradient-success);
    color: #fff;
}

.btn-success:hover {
    box-shadow: 0 6px 25px rgba(52, 211, 153, 0.3);
    transform: translateY(-2px);
    color: #fff;
}

.btn-outline-primary {
    background: transparent;
    border: 2px solid var(--accent-primary);
    color: var(--accent-primary);
}

.btn-outline-primary:hover {
    background: var(--accent-primary);
    color: #fff;
}

.btn-outline-success {
    background: transparent;
    border: 2px solid var(--accent-green);
    color: var(--accent-green);
}

.btn-outline-success:hover {
    background: var(--accent-green);
    color: #fff;
}

.btn-copy {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 6px 14px;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

/* ========== ОБЛАСТЬ РЕЗУЛЬТАТА ========== */
.result-area {
    display: none;
    margin-top: 24px;
    padding: 24px;
    background: rgba(52, 211, 153, 0.05);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(52, 211, 153, 0.15);
    animation: fadeInUp 0.4s ease;
}

.result-area.show {
    display: block;
}

.result-area.error {
    background: rgba(248, 113, 113, 0.06);
    border-color: rgba(248, 113, 113, 0.2);
}

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

.result-content {
    color: var(--text-primary);
}

.result-content h6 {
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.result-content pre {
    background: var(--bg-input) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    padding: 16px !important;
    color: var(--text-primary) !important;
    font-size: 0.9rem;
    max-height: 350px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

.result-content code {
    color: var(--accent-cyan);
    background: rgba(34, 211, 238, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
}

.result-content table {
    color: var(--text-primary);
}

.result-content table td,
.result-content table th {
    border-color: var(--border-color);
    padding: 10px 12px;
}

.result-content .table th {
    color: var(--text-secondary);
    font-weight: 600;
}

.result-content .display-4,
.result-content .display-6 {
    color: var(--accent-primary) !important;
    margin: 10px 0;
}

/* Спиннер */
.spinner {
    display: none;
}

.spinner.show {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.spinner.show + .btn-text {
    display: none;
}

.btn-text {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* ========== ФУТЕР ========== */
footer {
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
    padding: 50px 0 30px;
}

footer h5 {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
}

footer h6 {
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

footer p {
    color: var(--text-muted) !important;
    font-size: 0.85rem;
}

footer a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition-normal);
    font-size: 0.85rem;
}

footer a:hover {
    color: var(--accent-secondary);
}

footer ul li {
    margin-bottom: 6px;
}

/* ========== 404 СТРАНИЦА ========== */
.error-404 {
    font-size: 8rem;
    font-weight: 900;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.error-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.error-text {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* ========== ДОПОЛНИТЕЛЬНЫЕ УТИЛИТЫ ========== */
.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glass-card {
    background: rgba(22, 22, 42, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
}

/* Анимация пульсации для загрузки */
@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 10px rgba(124, 108, 240, 0.1); }
    50% { box-shadow: 0 0 25px rgba(124, 108, 240, 0.25); }
}

.btn-primary:not(:disabled) {
    animation: pulse-glow 3s ease-in-out infinite;
}

/* QR-код */
.qr-code-container {
    text-align: center;
    padding: 20px;
    background: #fff;
    border-radius: var(--radius-lg);
    display: inline-block;
    margin: 10px auto;
}

.qr-code-container img {
    max-width: 300px;
    height: auto;
}

/* ========== АДАПТИВНОСТЬ ========== */
@media (max-width: 992px) {
    .hero-title {
        font-size: 2.8rem;
    }
    .tool-container {
        padding: 28px 20px;
    }
}

@media (max-width: 768px) {
    .hero-section {
        padding: 70px 0 50px;
    }
    .hero-title {
        font-size: 2.2rem;
    }
    .hero-subtitle {
        font-size: 1rem;
    }
    .tool-container {
        padding: 20px 16px;
        border-radius: var(--radius-lg);
    }
    .tool-title {
        font-size: 1.4rem;
    }
    .upload-area {
        padding: 30px 20px;
    }
    .stat-number {
        font-size: 1.5rem;
    }
    .error-404 {
        font-size: 5rem;
    }
}

@media (max-width: 576px) {
    .hero-title {
        font-size: 1.8rem;
    }
    .category-title {
        font-size: 1.2rem;
    }
    .tool-card {
        padding: 16px 12px;
    }
    .tool-card-icon {
        font-size: 2rem;
    }
}

/* ============================================
   ToolKit Pro - Fixes (contrast + new components)
   ============================================ */

/* Читаемые метки чекбоксов на тёмном фоне */
.form-check-label {
    color: var(--text-secondary);
    cursor: pointer;
}

.form-check-input {
    background-color: var(--bg-input);
    border-color: var(--border-color);
    cursor: pointer;
}

.form-check-input:checked {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
}

/* Результаты: тёмные блоки, светлый текст — полный контраст */
.result-pre {
    background: var(--bg-input) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    padding: 16px !important;
    color: var(--text-primary) !important;
    font-size: 0.9rem;
    max-height: 350px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    line-height: 1.5;
}

.result-box {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    color: var(--text-primary);
    overflow-x: auto;
    word-break: break-word;
}

.result-box code {
    color: var(--accent-cyan);
    background: transparent;
    padding: 0;
}

/* Таблицы результатов: читаемый текст */
.result-content .table {
    --bs-table-color: var(--text-primary);
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--border-color);
    color: var(--text-primary);
}

.result-content .table td,
.result-content .table th {
    color: var(--text-primary);
}

.result-content .table th {
    color: var(--text-secondary);
    font-weight: 600;
}

/* Предпросмотр QR-кода: белый фон под QR */
.qr-preview {
    text-align: center;
    padding: 20px;
    background: #ffffff;
    border-radius: var(--radius-lg);
    display: inline-block;
    margin: 10px auto;
    width: 100%;
}

.qr-preview img {
    max-width: 280px;
    width: 100%;
    height: auto;
}

/* Уведомления (алерты) читаемы */
.result-content .alert {
    color: var(--text-primary);
}

/* Поля дат: иконка-календарь читаема на тёмном фоне */
input[type="date"].form-control {
    color-scheme: dark;
}

/* ============================================
   ToolKit Pro - Contrast fixes v2
   ============================================ */

/* Bootstrap .text-muted почти невидим на тёмном фоне.
   Делаем его светлее и читаемым (но всё ещё "вторичный" цвет). */
body .text-muted,
.tool-container .text-muted,
.tool-header .text-muted,
.hero-section .text-muted,
.tool-card-desc,
.tool-desc,
.upload-area p,
footer .text-muted {
    color: #b8b8d0 !important;   /* --text-secondary: светлее чем был */
}

/* Описание инструмента под заголовком */
.tool-desc {
    color: var(--text-secondary) !important;
    font-size: 1rem;
    opacity: 1;
}

/* Подпись карточки инструмента на главной */
.tool-card-desc {
    color: var(--text-secondary) !important;
    opacity: 1;
    font-size: 0.85rem;
}

/* Статистика и подписи */
.stat-label {
    color: var(--text-secondary) !important;
}

/* Превью обработанного изображения */
.result-image-preview {
    text-align: center;
    padding: 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin: 10px 0;
}

.result-image-preview img {
    max-width: 100%;
    max-height: 340px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    box-shadow: var(--shadow-card);
}

/* Кнопка скачивания — заметная */
.result-content .btn-success {
    font-size: 1.05rem;
    font-weight: 700;
}

/* Форм-подсказки (form-text) тоже читаемы */
.form-text {
    color: var(--text-secondary) !important;
}

/* ===== ИЗБРАННОЕ (звёздочки) ===== */
.tool-card-wrap { position: relative; }
.fav-btn {
    position: absolute;
    top: 8px; right: 8px;
    z-index: 5;
    width: 30px; height: 30px;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: var(--bg-elevated);
    color: var(--text-muted);
    font-size: 16px;
    line-height: 1;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all .2s ease;
}
.fav-btn:hover { color: #fbbf24; border-color: #fbbf24; transform: scale(1.1); }
.fav-btn.active { color: #fbbf24; border-color: #fbbf24; background: rgba(251,191,36,.12); }
.fav-btn.big { position: static; width: 38px; height: 38px; font-size: 22px; }

/* ===== БАННЕР КОНФИДЕНЦИАЛЬНОСТИ ===== */
.privacy-banner {
    background: linear-gradient(135deg, rgba(34,211,238,.12), rgba(124,108,240,.12));
    border: 1px solid rgba(34,211,238,.25);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    color: var(--text-primary);
    text-align: left;
}
.privacy-banner i { color: var(--accent-cyan); margin-right: 6px; }

/* ===== ЛОГОТИП ===== */
.brand-img { width: 28px; height: 28px; margin-right: 8px; vertical-align: middle; }

/* ===== DIFF VIEW ===== */
.diff-view {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    max-height: 400px;
    overflow: auto;
    white-space: pre-wrap;
}
.diff-eq { color: var(--text-secondary); }
.diff-ins { color: #34d399; background: rgba(52,211,153,.12); }
.diff-del { color: #f87171; background: rgba(248,113,113,.12); }
.diff-legend .diff-ins, .diff-legend .diff-del {
    padding: 2px 8px; border-radius: 4px; font-size: .8rem; margin-right: 10px;
}

/* ===== РЕДАКТОР СТРАНИЦ PDF ===== */
.page-map {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    background: var(--bg-input);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    min-height: 80px;
}
.page-thumb {
    position: relative;
    width: 120px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all .2s ease;
    background: #fff;
}
.page-thumb.deleted { opacity: .35; border-color: #f87171; }
.page-thumb.deleted::after {
    content: 'УДАЛЕНА';
    position: absolute; top: 40%; left: 0; right: 0;
    text-align: center; color: #f87171; font-weight: 700; font-size: .8rem;
}
.page-del-btn, .page-rot-btn {
    position: absolute;
    width: 24px; height: 24px;
    border: none; border-radius: 50%;
    font-size: 12px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
}
.page-del-btn { top: 4px; right: 4px; background: rgba(248,113,113,.9); color:#fff; }
.page-rot-btn { bottom: 4px; right: 4px; background: rgba(34,211,238,.9); color:#fff; }
.page-num {
    position: absolute; top: 4px; left: 4px;
    background: rgba(0,0,0,.6); color: #fff;
    font-size: .7rem; padding: 1px 6px; border-radius: 4px;
}


/* ===== КНОПКА "НА ГЛАВНУЮ" (мобильные) ===== */
.btn-back-home {
    background: rgba(124, 108, 240, 0.12);
    border: 1px solid rgba(124, 108, 240, 0.35);
    color: #fff !important;
    border-radius: var(--radius-full);
    padding: 7px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    text-decoration: none;
    white-space: nowrap;
    transition: var(--transition-normal);
    line-height: 1.4;
}
.btn-back-home i {
    color: var(--accent-secondary);
}
.btn-back-home:hover {
    background: var(--gradient-btn);
    border-color: transparent;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(124, 108, 240, 0.3);
}
@media (max-width: 575px) {
    .btn-back-home span {
        display: none;
    }
    .btn-back-home {
        padding: 7px 12px;
    }
}

/* ============================================
   SEO-блоки: хлебные крошки, текстовые разделы, FAQ
   ============================================ */
.seo-breadcrumbs {
    background: transparent;
    padding: 0;
    margin: 0;
}
.seo-breadcrumbs .breadcrumb-item a {
    color: var(--text-muted);
    text-decoration: none;
}
.seo-breadcrumbs .breadcrumb-item a:hover { color: var(--accent-secondary); }
.seo-breadcrumbs .breadcrumb-item.active { color: var(--text-secondary); }
.seo-breadcrumbs .breadcrumb-item + .breadcrumb-item::before { color: var(--text-dim); }

.tool-seo-content {
    margin-top: 2.5rem;
    padding: 1.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    line-height: 1.75;
}
.tool-seo-content p { margin-bottom: 1rem; }
.home-seo-content { color: var(--text-secondary); line-height: 1.75; }
.home-seo-content p { margin-bottom: 1rem; }

.seo-h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 1rem;
}
.seo-h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 1.75rem 0 .75rem;
}
.tool-seo-content > .seo-h2:first-child,
.home-seo-content .seo-h2:first-child { margin-top: 0; }

.seo-list { padding-left: 1.25rem; margin-bottom: 1rem; }
.seo-list li { margin-bottom: .5rem; }
.seo-list li::marker { color: var(--accent-secondary); }

.seo-faq-item {
    border-left: 3px solid var(--border-light);
    padding: .25rem 0 .25rem 1rem;
    margin-bottom: 1.25rem;
}
.seo-faq-q {
    font-size: 1.02rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: .35rem;
}
.seo-faq-item p { margin-bottom: 0; color: var(--text-secondary); }

.related-tools .tool-card { height: 100%; }
.seo-aside {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}
.seo-aside .seo-h3 { margin-top: 0; }
.seo-aside a { color: var(--text-secondary); text-decoration: none; }
.seo-aside a:hover { color: var(--accent-secondary); }

.footer-tools a { color: var(--text-muted); text-decoration: none; }
.footer-tools a:hover { color: var(--accent-secondary); }
.footer-tools li { margin-bottom: .35rem; }
