:root {
    --bg-color: #f4f7f6;
    --text-color: #333;
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --card-bg: #ffffff;
    --header-bg: rgba(255, 255, 255, 0.95);
    --border-color: #e0e0e0;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    --font-family: 'Inter', sans-serif;
}

[data-theme="dark"] {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --primary-color: #4dabf7;
    --secondary-color: #adb5bd;
    --card-bg: #1e1e1e;
    --header-bg: rgba(18, 18, 18, 0.95);
    --border-color: #333;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background-color: var(--header-bg);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--primary-color);
    text-decoration: none;
}

.logo span {
    color: var(--text-color);
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

nav a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

nav a:hover {
    color: var(--primary-color);
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.language-theme-switch {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.lang-switch {
    padding: 8px 15px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.lang-switch:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

/* Buttons */
.btn {
    padding: 12px 25px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.4);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: #fff;
}

.btn-large {
    padding: 15px 35px;
    font-size: 1.1rem;
}

/* Hero Section */
#hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(0,123,255,0.1), rgba(0,0,0,0.2));
}

#particle-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-content p {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Content Sections */
.content-section {
    padding: 80px 0;
}

.bg-alternate {
    background-color: var(--card-bg);
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.feature-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

/* Modules Grid */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
}

.module-item {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.3s ease;
}

.module-item:hover {
    transform: scale(1.05);
}

.module-item i {
    font-size: 2rem;
    color: var(--primary-color);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    text-align: center;
}

.stat-item h3 {
    font-size: 3rem;
    font-weight: 900;
    color: var(--primary-color);
}

.stat-item p {
    font-size: 1.2rem;
    font-weight: 500;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.gallery-item img:hover {
    transform: scale(1.03);
}

/* Pricing Grid */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    align-items: center;
}

.pricing-card {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow);
    position: relative;
    transition: transform 0.3s ease;
}

.pricing-card:hover {
    transform: translateY(-10px);
}

.pricing-card.featured {
    border: 2px solid var(--primary-color);
    transform: scale(1.05);
}

.featured-badge {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--primary-color);
    color: #fff;
    padding: 5px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.pricing-card h3 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.price {
    font-size: 1.2rem;
    color: var(--secondary-color);
    margin-bottom: 2rem;
}

.price span {
    font-size: 3rem;
    font-weight: 900;
    color: var(--primary-color);
}

.pricing-card ul {
    list-style: none;
    margin-bottom: 2rem;
}

.pricing-card li {
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border-color);
}

.pricing-card li i {
    margin-right: 0.5rem;
}

.pricing-card li i.fa-check {
    color: #28a745;
}

.pricing-card li i.fa-times {
    color: #dc3545;
}

/* Footer */
footer {
    background-color: var(--card-bg);
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.social-links {
    margin-top: 1rem;
}

.social-links a {
    color: var(--secondary-color);
    font-size: 1.5rem;
    margin: 0 10px;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: var(--primary-color);
}

/* Theme Switch */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
}
.theme-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}
.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}
.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}
input:checked + .slider {
    background-color: var(--primary-color);
}
input:checked + .slider:before {
    transform: translateX(26px);
}
.slider.round {
    border-radius: 34px;
}
.slider.round:before {
    border-radius: 50%;
}

/* Scroll Animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        gap: 1rem;
    }
    nav ul {
        gap: 1rem;
        font-size: 0.9rem;
    }
    .hero-content h1 {
        font-size: 2.5rem;
    }
    .hero-content p {
        font-size: 1.1rem;
    }
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    .pricing-card.featured {
        transform: scale(1);
    }
}

/* ==========================================================================
   Стилове за модален прозорец (Попъп)
   ========================================================================== */
/* Фонът, който затъмнява страницата */
.modal-overlay {
    position: fixed; /* Остава на едно място при скролиране */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* Полупрозрачен черен фон */
    display: flex; /* Помага за центрирането на съдържанието */
    justify-content: center;
    align-items: center;
    z-index: 1000; /* Да е отгоре на всичко останало */
    opacity: 0; /* Скрит по подразбиране */
    visibility: hidden; /* Скрит по подразбиране */
    transition: opacity 0.3s ease, visibility 0.3s ease; /* Плавен преход */
}

/* Промоционен модал стилове */
.promotion-modal {
    position: relative;
    min-width: 400px;
    max-width: 600px;
}

.promotion-content {
    position: relative;
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.discount-badge {
    flex-shrink: 0;
    background: #e74c3c;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 2rem;
    font-weight: 900;
    box-shadow: 0 4px 10px rgba(231, 76, 60, 0.4);
    min-width: 80px;
    text-align: center;
    align-self: flex-start;
}

.promotion-text {
    flex: 1;
    min-width: 0;
}

.promotion-text h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--text-color);
}

.promotion-text p {
    margin-bottom: 15px;
    line-height: 1.6;
}

.promotion-image {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: 8px;
    margin: 15px 0;
}

.promotion-btn {
    display: inline-block;
    margin-top: 10px;
}

/* Responsive за промоционен модал */
@media (max-width: 768px) {
    .promotion-modal {
        min-width: auto;
        width: 95%;
    }
    
    .promotion-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .discount-badge {
        align-self: center;
    }
}

/* ==========================================================================
   Lightbox за галерия
   ========================================================================== */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    animation: lightboxZoom 0.3s ease;
}

@keyframes lightboxZoom {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 50px;
    color: white;
    cursor: pointer;
    z-index: 2001;
    transition: all 0.3s ease;
    line-height: 1;
    font-weight: 300;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.lightbox-close:hover {
    color: var(--primary-color);
    transform: rotate(90deg);
}

/* Курсор pointer за снимките в галерията */
.gallery-clickable {
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.gallery-clickable:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

/* Responsive за lightbox */
@media (max-width: 768px) {
    .lightbox-close {
        top: 10px;
        right: 15px;
        font-size: 40px;
    }
    
    .lightbox-content {
        max-width: 95%;
    }
}

/* Клас, който показва модалния прозорец */
.modal-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

/* Белият прозорец със съдържанието */
.modal-content {
    background-color: var(--bg-color, #ffffff); /* Използва променлива за тема или бял фон */
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    color: var(--text-color, #333333); /* Използва променлива за тема */
}

/* Бутон за затваряне (X) */
.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    text-decoration: none;
    color: #aaa;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #000;
}

/* Стилизиране на формата в модала */
.modal-content form {
    display: flex;
    flex-direction: column;
    margin-top: 20px;
}

.modal-content label {
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--text-color, #333);
}

.modal-content input,
.modal-content textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box; /* Важно за правилно оразмеряване */
    background-color: var(--input-bg, #fff);
    color: var(--input-text, #333);
    font-family: 'Inter', sans-serif;
}

.modal-content button {
    align-self: flex-start; /* Подравнява бутона вляво */
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s;
}

/* Съобщение за успех */
.success-message {
    padding: 15px;
    background-color: #e8f5e9;
    border: 1px solid #c8e6c9;
    border-radius: 4px;
    color: #2e7d32;
    text-align: center;
    font-weight: 500;
}

/* ==========================================================================
   Стилове за новия Demo блок
   ========================================================================== */

#demo-request .demo-request-content {
    text-align: center;
}

#demo-request p {
    margin-top: 1.5rem; /* Разстояние между бутона и текста */
    font-size: 1.1rem;
    color: var(--text-color);
}

#demo-request p a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 700;
    transition: text-decoration 0.2s ease;
}

#demo-request p a:hover {
    text-decoration: underline;
}

/* ===
=======================================================================
   Видео инструкции
   ========================================================================== */
.section-subtitle {
    text-align: center;
    font-size: 1.2rem;
    color: var(--text-color);
    opacity: 0.8;
    max-width: 700px;
    margin: 0 auto 3rem;
}

.tutorials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.tutorial-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tutorial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.tutorial-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    background: linear-gradient(135deg, var(--primary-color), #667eea);
    overflow: hidden;
}

.tutorial-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tutorial-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 4rem;
    opacity: 0.3;
}

.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tutorial-card:hover .play-overlay {
    opacity: 1;
}

.play-overlay i {
    font-size: 4rem;
    color: white;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.tutorial-info {
    padding: 1.5rem;
}

.tutorial-info h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.tutorial-info p {
    font-size: 0.95rem;
    color: var(--text-color);
    opacity: 0.7;
    line-height: 1.5;
}

.no-tutorials {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-color);
    opacity: 0.6;
}

.no-tutorials i {
    font-size: 4rem;
    margin-bottom: 1rem;
    display: block;
}

.no-tutorials p {
    font-size: 1.2rem;
}

/* Video Modal */
.video-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.video-modal-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.video-modal-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    animation: videoModalZoom 0.3s ease;
}

@keyframes videoModalZoom {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.video-modal-content h3 {
    color: white;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    text-align: center;
}

.video-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.video-modal-close {
    position: absolute;
    top: -50px;
    right: 0;
    font-size: 50px;
    color: white;
    cursor: pointer;
    z-index: 2001;
    transition: all 0.3s ease;
    line-height: 1;
    font-weight: 300;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.video-modal-close:hover {
    color: var(--primary-color);
    transform: rotate(90deg);
}

/* Active nav link */
nav a.active {
    color: var(--primary-color);
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .tutorials-grid {
        grid-template-columns: 1fr;
    }
    
    .video-modal-content {
        width: 95%;
    }
    
    .video-modal-close {
        top: -40px;
        font-size: 40px;
    }
    
    .video-modal-content h3 {
        font-size: 1.2rem;
    }
}
