@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    /* ТЕМНАЯ ТЕМА (DEFAULT) - Business Dark */
    --bg-body: #0f172a;       /* Slate 900 */
    --bg-card: #1e293b;       /* Slate 800 */
    --bg-input: #334155;      
    --bg-header: rgba(15, 23, 42, 0.9);
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    --border: #334155;
    
    /* MARKETING BLUE & ORANGE */
    --accent: #3b82f6;        /* Bright Blue */
    --accent-hover: #2563eb;  /* Darker Blue */
    --secondary: #f97316;     /* Orange (для призывов к действию) */
    
    --radius: 12px;
    --shadow: 0 10px 40px -10px rgba(0,0,0,0.5);
}

/* СВЕТЛАЯ ТЕМА - Clean Business */
[data-theme="light"] {
    --bg-body: #ffffff;
    --bg-card: #f8fafc;       /* Очень светлый серый */
    --bg-input: #e2e8f0;
    --bg-header: rgba(255, 255, 255, 0.95);
    
    --text-main: #0f172a;
    --text-muted: #64748b;
    
    --border: #e2e8f0;
    
    --accent: #2563eb;        /* Solid Blue */
    --accent-hover: #1d4ed8;
    
    --shadow: 0 10px 30px -10px rgba(37, 99, 235, 0.1);
}

* { box-sizing: border-box; }

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: 'Manrope', sans-serif; /* Шрифт как у современных стартапов */
    margin: 0; line-height: 1.6;
    display: flex; flex-direction: column; min-height: 100vh;
    transition: background 0.3s, color 0.3s;
}

a { text-decoration: none; color: inherit; transition: 0.2s; }
main { flex: 1; }
.container { max-width: 900px; margin: 0 auto; padding: 0 20px; width: 100%; }

/* HEADER */
.main-header {
    background: var(--bg-header);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 1000; padding: 15px 0;
}
.header-inner { display: flex; justify-content: space-between; align-items: center; }

.logo { font-weight: 800; font-size: 1.4rem; letter-spacing: -0.5px; display: flex; align-items: center; gap: 8px; }
.logo span { color: var(--accent); }
.logo i { color: var(--secondary); }

.nav-links { display: flex; gap: 20px; align-items: center; }
.nav-links a { font-weight: 600; color: var(--text-muted); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.5px; }
.nav-links a:hover { color: var(--accent); }

/* BUTTONS */
.btn-primary {
    background: var(--accent);
    color: white; border: none; padding: 12px 24px;
    border-radius: var(--radius); font-weight: 700; cursor: pointer;
    display: inline-flex; align-items: center; gap: 8px; transition: 0.2s;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}
.btn-primary:hover { transform: translateY(-2px); background: var(--accent-hover); }

.btn-secondary {
    background: var(--secondary); color: white; border: none; padding: 12px 24px;
    border-radius: var(--radius); font-weight: 700; cursor: pointer;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

/* CARDS */
.post-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px; padding: 30px; margin-bottom: 30px;
    transition: 0.3s ease; box-shadow: var(--shadow);
    display: block;
}
.post-card:hover { transform: translateY(-5px); border-color: var(--accent); }

.post-category {
    font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px;
    color: var(--secondary); background: rgba(249, 115, 22, 0.1);
    padding: 5px 10px; border-radius: 6px; display: inline-block; margin-bottom: 15px;
}

.post-header h1 { font-size: 2.4rem; line-height: 1.2; margin: 10px 0; font-weight: 800; }

/* Content Typography */
.article-content { font-size: 1.15rem; color: var(--text-main); line-height: 1.8; }
.article-content h2 { margin-top: 40px; color: var(--accent); font-weight: 700; }
.article-content ul { padding-left: 20px; color: var(--text-muted); }
.article-content strong { color: var(--text-main); font-weight: 700; }

/* Code Blocks (Less prominent here, but needed) */
pre.command-block {
    background: #0f172a !important; /* Always dark slate */
    border: 1px solid var(--border); border-radius: 12px;
    padding: 20px 50px 20px 20px; margin: 30px 0;
    position: relative; font-family: 'JetBrains Mono', monospace; font-size: 0.9rem;
    overflow-x: auto; color: #e2e8f0;
}
.copy-btn-icon {
    position: absolute; top: 10px; right: 10px; z-index: 10;
    background: rgba(255,255,255,0.1); color: #94a3b8; width: 32px; height: 32px;
    border-radius: 8px; display: flex; align-items: center; justify-content: center;
    border: 1px solid rgba(255,255,255,0.1); cursor: pointer; transition: 0.2s;
}
.copy-btn-icon:hover { background: var(--accent); color: white; }

/* FOOTER */
.main-footer { background: var(--bg-card); border-top: 1px solid var(--border); padding: 60px 0 30px; margin-top: 80px; }
.footer-col h4 { color: var(--text-main); margin-bottom: 20px; font-weight: 800; }
.footer-col a { display: block; margin-bottom: 10px; color: var(--text-muted); font-size: 0.95rem; }
.footer-col a:hover { color: var(--accent); }

/* SEARCH */
.search-wrapper { position: relative; margin: 40px 0; }
.search-input {
    width: 100%; padding: 18px 50px 18px 25px;
    border-radius: 12px; background: var(--bg-input); border: 2px solid transparent;
    font-size: 1.05rem; color: var(--text-main); transition: 0.2s;
}
.search-input:focus { border-color: var(--accent); background: var(--bg-card); }
.search-btn { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: transparent; border: none; color: var(--text-muted); cursor: pointer; }

/* Share Grid */
.share-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 15px; margin-top: 40px; }
.share-tile {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 20px; border-radius: 12px; color: white; border: none; cursor: pointer; transition: 0.2s;
    font-weight: 600; text-align: center; gap: 8px;
}
.share-tile:hover { transform: translateY(-3px); filter: brightness(1.1); }
.bg-tg { background: #229ED9; }
.bg-vk { background: #0077FF; }
.bg-copy { background: var(--bg-input); color: var(--text-main); border: 1px solid var(--border); }
/* Стиль для авто-ссылок (Яндекс) */
a.promo-link {
    color: var(--accent); /* Цвет акцента сайта */
    text-decoration: none;
    border-bottom: 1px dashed var(--accent); /* Пунктирное подчеркивание намекает на "подсказку" */
    font-weight: 600;
    transition: all 0.2s;
}

a.promo-link:hover {
    background-color: rgba(59, 130, 246, 0.1); /* Легкая подсветка при наведении */
    border-bottom-style: solid;
    color: #ff3333; /* Красный цвет Яндекса при наведении */
}
/* --- ЮРИДИЧЕСКИЙ БАННЕР (FIXED FIX) --- */
.legal-banner {
    position: fixed;          /* Плавающий элемент */
    bottom: 30px;             /* Отступ от низа */
    left: 50%;                /* Центр экрана */
    transform: translateX(-50%);
    
    width: 90%;
    max-width: 600px;         /* Ограничение ширины */
    
    /* Светлая тема по умолчанию */
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--border);
    border-left: 5px solid var(--accent); /* Синий акцент слева */
    
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    
    padding: 20px;
    z-index: 10000;
    
    /* Flexbox для выравнивания в ряд */
    display: none; /* JS включит flex */
    flex-direction: row;
    align-items: center; /* Центрируем по вертикали */
    justify-content: space-between;
    gap: 20px;
    
    animation: slideUp 0.5s ease-out;
}

/* Темная тема (через родительский атрибут) */
[data-theme="dark"] .legal-banner {
    background: rgba(30, 41, 59, 0.95); /* Темно-синий */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border-color: var(--border);
    border-left-color: var(--accent);
}

.legal-content {
    display: flex;
    align-items: center; /* Иконка по центру текста */
    gap: 15px;
}

.legal-icon {
    font-size: 1.8rem;
    color: var(--accent);
    flex-shrink: 0; /* Чтобы иконку не сжимало */
}

.legal-text strong {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 4px;
    color: var(--text-main);
}

.legal-text p {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--text-muted);
}

/* Кнопка ОК */
#accept-legal {
    padding: 10px 25px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap; /* Текст в одну строку */
    flex-shrink: 0;      /* Кнопку нельзя сжимать */
    height: auto;        /* Чтобы не растягивалась на всю высоту */
    align-self: center;  /* Выравнивание по центру */
}

/* Анимация */
@keyframes slideUp {
    from { transform: translate(-50%, 100%); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

/* Мобильная версия */
@media (max-width: 600px) {
    .legal-banner {
        flex-direction: column; /* Столбиком */
        align-items: flex-start;
        bottom: 15px;
        width: 95%;
    }
    
    #accept-legal {
        width: 100%; /* Кнопка во всю ширину */
        margin-top: 10px;
    }
}