:root {
    --primary-color: rgba(114, 143, 206);
    --secondary-color: rgba(53, 78, 140);
    --dark-color: #212529;
    --light-color: #f8f9fa;
    --white: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    color: var(--dark-color);
    overflow-x: hidden;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

/* Navbar */
.navbar {
    transition: all 0.3s ease;
    padding: 1rem 0;
    background-color: rgba(255, 255, 255, 0.95) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.navbar-nav .nav-link {
    font-weight: 500;
    margin: 0 0.5rem;
    position: relative;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.navbar-nav .nav-link:hover::after {
    width: 80%;
}

/* Hero Section with Canvas + Grid */
.hero-section {
    position: relative;
    min-height: 100vh;
    background-color: var(--secondary-color);           /* rgba(53, 78, 140) */
    overflow: hidden;
    display: flex;
    align-items: center;
    padding-top: 0;

    /* Статичен grid фон – под canvas анимацията */
    background-image:
        linear-gradient(rgba(255,255,255, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255, 0.08) 1px, transparent 1px);
    background-size: 50px 50px;                         /* размер на квадратите – можеш да пробваш 40px, 60px, 80px */
}

#demo-canvas {
    position: absolute;
    inset: 0;                                           /* вместо top/left/right/bottom */
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;                               /* мишката минава през canvas-а към съдържанието */
}

.hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    width: 100%;
}

.hero-stats {
    border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.stat-item {
    text-align: center;
}

.stat-item h3 {
    font-size: 2.5rem;
    color: var(--white);
}

.stat-item p {
    color: rgba(255, 255, 255, 0.8);
}

.hero-scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4;
    animation: bounce 2s infinite;
}

.hero-scroll-indicator i {
    font-size: 2rem;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* Animations */
.animate-fade-in {
    animation: fadeIn 1s ease-in;
}

.animate-fade-in-delay {
    animation: fadeIn 1s ease-in 0.3s backwards;
}

.animate-fade-in-delay-2 {
    animation: fadeIn 1s ease-in 0.6s backwards;
}

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

/* Buttons */
.btn {
    padding: 0.75rem 2rem;
    font-weight: 600;
    border-radius: 50px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
}

.btn-primary {
    background: var(--primary-color);
    border: none;
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-outline-light {
    border: 2px solid var(--white);
    color: var(--white);
}

.btn-outline-light:hover {
    background: var(--white);
    color: var(--primary-color);
    transform: translateY(-2px);
}

/* Icon Boxes */
.icon-box {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.icon-box i {
    font-size: 1.2rem;
}

/* Team Members */
.team-member {
    padding: 1.5rem;
    background: var(--white);
    border-radius: 15px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.team-member:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* About Image */
.about-image-wrapper {
    position: relative;
}

.about-image-wrapper::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    right: 20px;
    bottom: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 15px;
    z-index: -1;
}

/* Service Cards */
.service-card {
    padding: 2rem;
    background: var(--white);
    border-radius: 15px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border-left: 4px solid var(--primary-color);
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
    border-left-width: 6px;
}

.service-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.service-card h5 {
    color: var(--dark-color);
    font-weight: 600;
    line-height: 1.6;
}

/* Contact Cards */
.contact-card {
    padding: 3rem 2rem;
    background: var(--white);
    border-radius: 15px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.contact-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.contact-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
}

.contact-card a {
    transition: color 0.3s ease;
}

.contact-card a:hover {
    color: var(--primary-color) !important;
}

/* Modal */
.modal-content {
    border: none;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    padding: 2rem 2rem 1rem;
}

.modal-body {
    padding: 1rem 2rem 2rem;
}

.form-control {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

/* Footer */
footer {
    margin-top: 0;
}

footer a {
    text-decoration: none;
    transition: opacity 0.3s ease;
}

footer a:hover {
    opacity: 0.8;
}

/* Gallery Carousel Styles */
#gallery .carousel-item img {
    height: 500px;
    object-fit: cover;
    width: 100%;
}

#gallery .carousel-caption {
    background: rgba(0, 0, 0, 0.6);
    padding: 20px;
    border-radius: 10px;
}

.carousel {
    overflow: hidden;
}

.carousel-inner {
    overflow: hidden;
}

/* Предотврати хоризонтален скрол */
.container-fluid,
section,
.row {
    overflow-x: hidden;
}

.row {
    margin-left: -15px;
    margin-right: -15px;
}

.row > * {
    padding-left: 15px;
    padding-right: 15px;
}

/* Utility Classes */
.text-primary { color: var(--primary-color) !important; }
.bg-primary   { background-color: var(--primary-color) !important; }
.shadow-sm    { box-shadow: var(--shadow) !important; }
.shadow-lg    { box-shadow: var(--shadow-lg) !important; }
.rounded-4    { border-radius: 15px !important; }

/* Responsive */
@media (max-width: 991px) {
    .hero-section {
        background-attachment: scroll;
        padding-top: 100px;
        min-height: 100vh;
    }
    
    .navbar-nav .nav-link {
        margin: 0.5rem 0;
    }
    
    .navbar-nav .nav-link::after {
        display: none;
    }
    
    .stat-item h3 {
        font-size: 2rem;
    }
    
    .about-image-wrapper::before {
        top: -10px;
        left: -10px;
        right: 10px;
        bottom: 10px;
    }
}

@media (max-width: 767px) {
    .hero-section {
        padding-top: 80px;
        padding-bottom: 40px;
    }
    
    .hero-scroll-indicator {
        bottom: 10px;
    }
    
    .hero-content h1,
    .hero-content .display-3 {
        font-size: 2rem !important;
        line-height: 1.3;
        margin-bottom: 1rem;
    }
    
    .hero-content .lead {
        font-size: 1rem !important;
    }
    
    .display-3 { font-size: 2.5rem; }
    .display-5 { font-size: 2rem; }
    
    .btn {
        padding: 0.6rem 1.5rem;
        font-size: 0.85rem;
    }
    
    .service-card { padding: 1.5rem; }
    .contact-card { padding: 2rem 1.5rem; }
    
    .hero-stats .row > div {
        margin-bottom: 1rem;
    }
    
    #gallery .carousel-item img {
        height: 300px;
    }
}