/* =========================================
   1. Змінні та Теми (Dark/Light Mode)
   ========================================= */
:root {
    /* Світла тема (Default) */
    --bg-body: #ffffff;
    --bg-alt: #f4f6f8;
    --text-main: #2c3e50;
    --text-muted: #6c757d;
    --accent-blue: #004e92;
    --accent-yellow: #ffcc00;
    --nav-bg: rgba(255, 255, 255, 0.95);
    --card-bg: #ffffff;
    --shadow: 0 4px 6px rgba(0,0,0,0.1);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-body: #121212;
        --bg-alt: #1e1e1e;
        --text-main: #e0e0e0;
        --text-muted: #a0a0a0;
        --accent-blue: #4dabf7;
        --accent-yellow: #ffd700;
        --nav-bg: rgba(18, 18, 18, 0.95);
        --card-bg: #2d2d2d;
        --shadow: 0 4px 6px rgba(0,0,0,0.5);
    }
}

body.dark-theme { --bg-body: #121212; --bg-alt: #1e1e1e; --text-main: #e0e0e0; --text-muted: #a0a0a0; --accent-blue: #4dabf7; --nav-bg: rgba(18, 18, 18, 0.95); --card-bg: #2d2d2d; --shadow: 0 4px 6px rgba(0,0,0,0.5); }
body.light-theme { --bg-body: #ffffff; --bg-alt: #f4f6f8; --text-main: #2c3e50; --accent-blue: #004e92; --nav-bg: rgba(255, 255, 255, 0.95); --card-bg: #ffffff; --shadow: 0 4px 6px rgba(0,0,0,0.1); }

/* =========================================
   2. База та Layout
   ========================================= */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    transition: background 0.3s, color 0.3s;
}
.container { width: 90%; max-width: 1200px; margin: 0 auto; padding: 0 15px; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* =========================================
   3. Навігація та Логотип
   ========================================= */
.navbar {
    position: sticky; top: 0;
    background: var(--nav-bg);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    padding: 1rem 0;
    backdrop-filter: blur(10px);
}
.nav-container { display: flex; justify-content: space-between; align-items: center; }

/* Логотип (Картинка + Текст) */
.logo { display: flex; align-items: center; gap: 12px; color: var(--text-main); }
.logo img { height: 45px; width: auto; }
.logo-text { font-weight: 700; font-size: 1.3rem; letter-spacing: 0.5px; }

/* Гамбургер */
.hamburger { display: none; cursor: pointer; }
.bar { display: block; width: 25px; height: 3px; margin: 5px auto; transition: all 0.3s ease-in-out; background-color: var(--text-main); }
.hamburger.active .bar:nth-child(2) { opacity: 0; }
.hamburger.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.nav-links { display: flex; gap: 2rem; align-items: center; }
.nav-links a { font-weight: 600; transition: color 0.3s; }
.nav-links a:hover { color: var(--accent-blue); }
#theme-toggle { background: none; border: 1px solid var(--text-main); color: var(--text-main); padding: 5px 10px; border-radius: 20px; cursor: pointer; font-size: 1.2rem; }

/* =========================================
   4. Hero Section & Energy Grid
   ========================================= */
.hero {
    height: 80vh;
    display: flex; align-items: center;
    position: relative; overflow: hidden;
    background: radial-gradient(circle at center, rgba(0,78,146,0.4), rgba(0,0,0,0.9));
}
.hero-content { position: relative; z-index: 2; color: #fff; max-width: 600px; }
.hero h1 { font-size: 3rem; margin-bottom: 1rem; line-height: 1.2; }
.hero p { font-size: 1.2rem; margin-bottom: 2rem; opacity: 0.9; }

/* Сітка */
.power-grid { position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; z-index: 1; pointer-events: none; }
.grid-line { position: absolute; background: rgba(255, 255, 255, 0.05); box-shadow: 0 0 5px rgba(0, 78, 146, 0.1); }
.grid-line.vertical { top: 0; bottom: 0; width: 1px; }
.grid-line.horizontal { left: 0; right: 0; height: 1px; }
.grid-line::after { content: ''; position: absolute; background: linear-gradient(90deg, transparent, var(--accent-yellow), transparent); box-shadow: 0 0 15px var(--accent-yellow); opacity: 0; }
.vertical::after { top: -100px; left: 0; width: 100%; height: 100px; background: linear-gradient(180deg, transparent, var(--accent-yellow), transparent); animation: dropFlow 4s infinite ease-in-out; animation-delay: var(--d); }
.horizontal::after { left: -100px; top: 0; height: 100%; width: 100px; animation: sideFlow 5s infinite ease-in-out; animation-delay: var(--d); }

.btn { display: inline-block; padding: 12px 30px; border-radius: 5px; font-weight: bold; cursor: pointer; border: none; transition: transform 0.2s; }
.btn-primary { background-color: var(--accent-yellow); color: #000; }
.btn-primary:hover { transform: translateY(-2px); }

/* =========================================
   5. Секції
   ========================================= */
.section { padding: 80px 0; }
.bg-alt { background-color: var(--bg-alt); }
.section-title { text-align: center; font-size: 2.5rem; margin-bottom: 50px; color: var(--accent-blue); }

.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.about-icon-container { display: flex; justify-content: center; }
.feature-list { margin-top: 30px; }
.feature-list li { margin-bottom: 15px; font-size: 1.1rem; display: flex; align-items: center; gap: 10px; }

.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 30px; }
.card { background: var(--card-bg); padding: 30px; border-radius: 10px; box-shadow: var(--shadow); text-align: center; transition: transform 0.3s; height: 100%; display: flex; flex-direction: column; align-items: center; }
.card:hover { transform: translateY(-10px); }
.card-icon { color: var(--accent-blue); margin-bottom: 20px; }
.card p { flex-grow: 1; }
.disclaimer { text-align: center; margin-top: 30px; font-size: 0.9rem; color: var(--text-muted); }

.contact-wrapper { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; }
.phone-link { font-size: 1.2rem; font-weight: bold; color: var(--text-main); }
.contact-form input, .contact-form textarea { width: 100%; padding: 12px; margin-bottom: 15px; border: 1px solid #ccc; border-radius: 5px; background: var(--bg-body); color: var(--text-main); font-family: inherit; }

/* =========================================
   6. Анімації
   ========================================= */
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn 1s ease-out forwards; opacity: 0; }
.fade-in-delay { animation: fadeIn 1s ease-out 0.5s forwards; opacity: 0; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 204, 0, 0.7); } 70% { box-shadow: 0 0 0 10px rgba(255, 204, 0, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 204, 0, 0); } }
.pulse-btn { animation: pulse 2s infinite; }
@keyframes dropFlow { 0% { top: -100%; opacity: 0; } 50% { opacity: 1; } 100% { top: 100%; opacity: 0; } }
@keyframes sideFlow { 0% { left: -100%; opacity: 0; } 50% { opacity: 1; } 100% { left: 100%; opacity: 0; } }

/* Малювання іконок */
.icon-draw, .icon-draw-circle { stroke-dasharray: 500; stroke-dashoffset: 500; animation: drawLine 5s ease-in-out infinite; opacity: 0; }
@keyframes drawLine { 0% { stroke-dashoffset: 500; opacity: 0; } 10% { opacity: 1; } 50% { stroke-dashoffset: 0; opacity: 1; } 90% { stroke-dashoffset: 0; opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; } }

/* =========================================
   7. Footer (Hacker/Matrix Style)
   ========================================= */
footer {
    background-color: #050505 !important; /* Чорний фон */
    padding: 25px 0;
    border-top: 2px solid #1a1a1a;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    margin-top: auto; /* Щоб не прилипав */
}

.console-text {
    color: #4af626 !important; /* Кислотно-зелений */
    text-align: center;
    margin: 0;
    text-shadow: 0 0 5px rgba(74, 246, 38, 0.3);
}

.console-text a {
    color: #2d9bf0 !important; /* Яскраво-синій */
    text-decoration: none;
    font-weight: bold;
    border-bottom: 1px dashed transparent;
    transition: all 0.3s;
}

.console-text a:hover {
    color: #61bfff !important;
    border-bottom-color: #61bfff;
    text-shadow: 0 0 8px rgba(45, 155, 240, 0.6);
}

.client-name { color: #ffffff !important; font-weight: normal; }
.readme-link { color: #ff9d00 !important; }
.separator { color: #444; margin: 0 10px; }

/* =========================================
   Секція: Нормативна база
   ========================================= */
.docs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 30px;
}

.docs-list {
    list-style: none;
}

.docs-list li {
    margin-bottom: 20px;
    text-align: left;
    position: relative;
    padding-left: 25px;
}

/* Додаємо акуратну іконку документа перед кожним посиланням */
.docs-list li::before {
    content: '📄';
    position: absolute;
    left: 0;
    top: 2px;
    font-size: 0.9rem;
    opacity: 0.7;
}

.docs-list a {
    color: var(--text-main); /* Автоматично змінюється (чорний/білий) залежно від теми */
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.5;
    display: inline-block;
    transition: color 0.3s ease;
}

.docs-list a:hover {
    color: var(--accent-blue); /* Фірмовий синій колір при наведенні */
    text-decoration: underline;
}

/* =========================================
   8. Мобільна Адаптивність
   ========================================= */
@media (max-width: 768px) {
    .hamburger { display: block; z-index: 1001; }
    .nav-links {
        position: fixed; left: -100%; top: 70px; gap: 0;
        flex-direction: column; background-color: var(--bg-body);
        width: 100%; text-align: center; transition: 0.3s;
        box-shadow: 0 10px 10px rgba(0,0,0,0.1);
        padding: 20px 0; border-bottom: 1px solid var(--accent-blue);
    }
    .nav-links.active { left: 0; }
    .nav-links li { margin: 16px 0; }
    
    .hero h1 { font-size: 2rem; }
    .about-grid, .contact-wrapper, .cards-grid { grid-template-columns: 1fr; }
    .about-icon-container { display: none; }
    
    .logo img { height: 35px; }
    .logo-text { font-size: 1.1rem; }
    
    /* Футер на мобільному */
    .separator { display: none; }
    .console-text { font-size: 0.75rem; line-height: 2; }
    .console-text a, .console-text span { display: block; } /* У стовпчик */
}

/* =========================================
   Стилі для графіка роботи у формі
   ========================================= */
.form-schedule-note {
    font-size: 0.85rem;
    color: var(--text-muted); /* Автоматично підлаштується під світлу/темну тему */
    margin-bottom: 15px;
    margin-top: -5px;
    text-align: left;
    line-height: 1.4;
}

/* Адаптація для телефонів (центруємо підказку) */
@media (max-width: 768px) {
    .form-schedule-note {
        text-align: center;
    }
}