/*
Theme Name: FrogStar
Author: FrogStar Dev
Author URI: https://frogstar.ru
Description: Высокотехнологичная тема для AI & Automation с тёмной/светлой темой, нейросетевой анимацией и слайдерами.
Version: 1.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: frogstar
Tags: dark, light, custom-menu, theme-options, threaded-comments
*/

/* БАЗОВЫЕ ПЕРЕМЕННЫЕ (ТЕМНАЯ ТЕМА ПО УМОЛЧАНИЮ) */
:root {
    --bg-deep: #0A0A0F;
    --bg-card: #14141B;
    --border-tech: #282E3E;
    --text-white: #FFFFFF;
    --text-main: #E8EDF5;
    --text-secondary: #A6B3C9;
    --accent-blue: #0066FF;
    --accent-blue-rgb: 0, 102, 255;
    --accent-purple: #6C3CE1;
    --glow-cyan: #00D4FF;
    --glow-cyan-rgb: 0, 212, 255;
    --logo-color: #0066FF;
}

/* СВЕТЛАЯ ТЕМА */
html[data-theme="light"] {
    --bg-deep: #F4F7FC;
    --bg-card: #FFFFFF;
    --border-tech: #DCE3EF;
    --text-white: #0A0A0F; /* Заголовки становятся черными */
    --text-main: #1E2630;
    --text-secondary: #5A6A7F;
    --accent-blue: #0066FF;
    --accent-blue-rgb: 0, 102, 255;
    --accent-purple: #6C3CE1;
    --glow-cyan: #0088CC;
    --glow-cyan-rgb: 0, 136, 204;
    --logo-color: #0066FF;
}

/* ЗЕЛЁНАЯ СХЕМА (smartgrow.frogstar.ru): растения, гидропоника, ИИ */
body.scheme-green {
    --accent-blue: #00C853;
    --accent-blue-rgb: 0, 200, 83;
    --accent-purple: #00BFA5;
    --glow-cyan: #00E676;
    --glow-cyan-rgb: 0, 230, 118;
    --logo-color: #00C853;
}

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

body {
    background-color: var(--bg-deep);
    color: var(--text-main);
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

a {
    color: var(--accent-blue);
    text-decoration: none;
}

/* КОНТЕЙНЕР 80% */
.container {
    width: 80%;
    max-width: 1400px;
    margin: 0 auto;
}

/* ШАПКА (HEADER) */
.site-header {
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    background-color: var(--bg-deep);
    border-bottom: 1px solid var(--border-tech);
    transition: background-color 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
    padding: 15px 0;
}

/* WordPress admin bar не наезжает на фиксированную шапку */
body.admin-bar .site-header {
    top: 32px;
}

@media (max-width: 782px) {
    body.admin-bar .site-header {
        top: 46px;
    }
}

/* Класс для JS: при скролле становится прозрачным на 40% */
.site-header.scrolled {
    background-color: rgba(10, 10, 15, 0.6); /* Темная тема */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 10px 0;
}

html[data-theme="light"] .site-header.scrolled {
    background-color: rgba(244, 247, 252, 0.6); /* Светлая тема */
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 80%;
    margin: 0 auto;
}

/* Логотип */
.logo svg,
.logo img.custom-logo {
    height: 70px;
    width: auto;
    fill: var(--logo-color, var(--text-white));
    display: block;
}

/* Кастомный логотип рисуем маской в сплошном цвете схемы — без прозрачности и
   без бледности. Синий #0066FF в обеих темах, зелёный #00C853 в scheme-green. */
.logo-fill {
    display: block;
    width: 70px;
    height: 70px;
    background-color: var(--logo-color, #0066FF);
    -webkit-mask: var(--logo-url) no-repeat center / contain;
    mask: var(--logo-url) no-repeat center / contain;
}

/* Меню */
.main-nav ul {
    display: flex;
    list-style: none;
    gap: 25px;
}

.main-nav a {
    color: var(--text-main);
    font-weight: 500;
    transition: color 0.2s;
}

.main-nav a:hover {
    color: var(--glow-cyan);
}

/* Иконки справа */
.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-main);
    padding: 5px;
    display: flex;
    align-items: center;
}

.icon-btn svg {
    width: 24px;
    height: 24px;
}

/* Иконки темы: солнце в тёмной, луна в светлой */
.icon-sun { display: block; }
.icon-moon { display: none; }
html[data-theme="light"] .icon-sun { display: none; }
html[data-theme="light"] .icon-moon { display: block; }

/* ПОДВАЛ (FOOTER) */
.site-footer {
    width: 100%;
    background-color: var(--bg-deep);
    border-top: 1px solid var(--border-tech);
    padding: 40px 0 20px 0;
    margin-top: 60px;
}

.footer-inner {
    width: 80%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
}

.footer-nav a {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-nav a:hover {
    color: var(--accent-blue);
}

/* Матричный шум (пока просто линия, JS добавим позже) */
.matrix-divider {
    height: 2px;
    width: 100%;
    margin-top: 30px;
    background: var(--border-tech);
}

/* ===================== HERO ===================== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 120px 0 80px 0;
}

#neural-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero-inner {
    position: relative;
    z-index: 1;
    text-align: center;
}

.hero-title {
    color: var(--text-white);
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.1;
}

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

/* Сканирующая строка (бежит сверху вниз по Hero) */
.scan-line {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 2px;
    background: var(--glow-cyan);
    box-shadow: 0 0 12px var(--glow-cyan), 0 0 40px var(--glow-cyan);
    filter: blur(0.5px);
    z-index: 1;
    animation: scanMove 5s linear infinite;
}

@keyframes scanMove {
    0%   { top: 0;    opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

/* ===================== КНОПКИ ===================== */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.btn-primary {
    background-color: var(--accent-blue);
    color: #fff;
    box-shadow: 0 0 20px rgba(var(--accent-blue-rgb), 0.5);
}

.btn-primary:hover {
    background-color: var(--glow-cyan);
    color: var(--bg-deep);
    box-shadow: 0 0 30px rgba(var(--glow-cyan-rgb), 0.6);
}

.btn-card {
    background-color: var(--accent-blue);
    color: #fff;
    padding: 8px 18px;
    font-size: 0.9rem;
}

.btn-card:hover {
    background-color: var(--glow-cyan);
    color: var(--bg-deep);
}

/* ===================== СЕКЦИИ ===================== */
.section-title {
    color: var(--text-white);
    font-size: 2rem;
    text-align: center;
    margin: 0 0 40px 0;
    position: relative;
}

.advantages,
.products-section,
.blog-section {
    padding: 80px 0;
}

/* ===================== ГОЛОГРАФИЧЕСКИЕ КАРТОЧКИ ===================== */
.advantages-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.holographic-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-tech);
    border-radius: 8px;
    padding: 30px 24px;
    text-align: center;
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    transform-style: preserve-3d;
    perspective: 600px;
}

.holographic-card:hover {
    background-color: transparent;
    border: 1px solid var(--glow-cyan);
    box-shadow: 0 0 24px rgba(var(--glow-cyan-rgb), 0.35), inset 0 0 24px rgba(var(--glow-cyan-rgb), 0.1);
    transform: translateZ(30px);
}

.card-icon {
    color: var(--accent-purple);
    margin-bottom: 16px;
    display: flex;
    justify-content: center;
}

.card-icon svg {
    width: 48px;
    height: 48px;
    transition: transform 0.3s ease;
}

.holographic-card:hover .card-icon svg {
    transform: translateZ(40px);
}

.holographic-card h3 {
    color: var(--text-white);
    font-size: 1.1rem;
    margin-bottom: 12px;
}

.holographic-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* ===================== СЛАЙДЕРЫ ===================== */
.slider {
    position: relative;
    overflow: hidden;
}

.slider-track {
    display: flex;
    gap: 24px;
    transition: transform 0.5s ease;
    will-change: transform;
}

.product-card,
.blog-card {
    flex: 0 0 calc(33.333% - 16px);
    background-color: var(--bg-card);
    border: 1px solid var(--border-tech);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover,
.blog-card:hover {
    border-color: var(--glow-cyan);
    box-shadow: 0 0 20px rgba(var(--glow-cyan-rgb), 0.2);
}

.product-thumb img,
.blog-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 6px;
}

.product-title,
.blog-title {
    color: var(--text-white);
    font-size: 1.05rem;
    line-height: 1.3;
}

.product-title a,
.blog-title a {
    color: inherit;
}

.product-title a:hover,
.blog-title a:hover {
    color: var(--glow-cyan);
}

.product-excerpt,
.blog-excerpt {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.blog-meta time {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Кнопки слайдера */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-tech);
    border-radius: 50%;
    background-color: var(--bg-card);
    color: var(--text-main);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.slider-btn:hover {
    border-color: var(--glow-cyan);
    color: var(--glow-cyan);
    box-shadow: 0 0 14px rgba(var(--glow-cyan-rgb), 0.4);
}

.slider-prev { left: -55px; }
.slider-next { right: -55px; }

/* ===================== МАТРИЧНЫЙ ШУМ / ЛЕНТА РОСТА ===================== */
#matrixCanvasContainer {
    height: 2px;
    width: 100%;
    overflow: hidden;
    position: relative;
    margin-top: 0;
    background: transparent;
}

/* На smartgrow (зелёная схема) нижняя лента выше — растут листья */
body.scheme-green #matrixCanvasContainer {
    height: 42px;
}

#matrix-noise {
    display: block;
    width: 100%;
    height: 100%;
}

/* АДАПТИВ (МОБИЛЬНЫЕ УСТРОЙСТВА) */
@media (max-width: 768px) {
    .main-nav {
        display: none; /* Временно скрываем, позже сделаем бургер-меню */
    }
    .header-inner, .footer-inner, .container {
        width: 90%;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .advantages-grid {
        grid-template-columns: 1fr;
    }

    .product-card,
    .blog-card {
        flex: 0 0 calc(100% - 24px);
    }

    .slider-prev { left: -40px; }
    .slider-next { right: -40px; }
}