/* CSS Variables for Theme Support */
:root {
    --primary-color: #00d4ff;
    --secondary-color: #ff6b6b;
    --accent-color: #4ecdc4;
    --text-color: #333333;
    --light-text: #666666;
    --white: #ffffff;
    --black: #000000;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --border-color: #e0e0e0;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --gradient: linear-gradient(135deg, #00d4ff, #4ecdc4);
    --invert-icon: invert(0);
}

/* Dark Theme Variables (Professional Blueish/Slate) */
[data-theme="dark"] {
    --primary-color: #00d4ff;
    --secondary-color: #ff6b6b;
    --accent-color: #4ecdc4;
    --text-color: #f1f5f9;
    --light-text: #94a3b8;
    --white: #1e293b;
    --black: #ffffff;
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --border-color: #334155;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    --gradient: linear-gradient(135deg, #00d4ff, #4ecdc4);
    --invert-icon: invert(1);
}

/* Fix Bootstrap defaults for dark mode readability */
.card, .accordion-item, .accordion-button, .offcanvas {
    background-color: var(--card-bg) !important;
    border-color: var(--border-color) !important;
    color: var(--text-color) !important;
}
.card-text, .card-body p, .accordion-body {
    color: var(--light-text) !important;
}
.btn-close { filter: var(--invert-icon); }

/* Theme Toggle Button in Header */
.theme-toggle-header {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.theme-toggle-header:hover {
    color: var(--primary-color);
    transform: rotate(30deg);
}

/* Smooth Transitions for Theme Change */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* FIX: Prevent Horizontal Scrolling globally */
html, body {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
header {
    background: var(--white);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
}

header.scrolled {
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.15);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-color);
    text-decoration: none;
}

.logo:hover {
    color: var(--primary-color);
    transform: translateX(5px);
}

.logo-icon {
    width: 45px;
    height: 45px;
    background: var(--gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    box-shadow: 0 5px 15px rgba(0, 212, 255, 0.3);
}

.logo-icon i {
    color: white;
    font-size: 24px;
}

.nav-links {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 35px;
}

.nav-links .nav-item .nav-link {
    color: var(--text-color) !important;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    position: relative;
    padding: 0 !important;
    transition: color 0.3s ease, background-color 0.3s ease;
}

/* Underline effect for Desktop Nav links ONLY */
@media (min-width: 993px) {
    .nav-links .nav-link::after {
        content: '';
        position: absolute;
        bottom: -5px;
        left: 0;
        width: 0;
        height: 2px;
        background: var(--gradient);
        transition: width 0.3s ease;
    }

    .nav-links .nav-link:hover::after, 
    .nav-links .nav-link.active::after {
        width: 100%;
    }

    .nav-links .nav-link:hover, 
    .nav-links .nav-link.active {
        color: var(--primary-color) !important;
    }
}

.cta-button {
    background: var(--gradient);
    color: white;
    padding: 12px 28px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 5px 20px rgba(0, 212, 255, 0.3);
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.5);
}

/* Hero Section */
.hero {
    padding: 150px 0 80px;
    background: linear-gradient(135deg, var(--white) 0%, var(--bg-color) 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero-text h1 {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 20px;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-text p {
    font-size: 1.2rem;
    color: var(--light-text);
    margin-bottom: 30px;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
}

.btn-primary-custom, .btn-secondary-custom {
    padding: 15px 35px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-primary-custom {
    background: var(--gradient);
    color: white;
    box-shadow: 0 5px 20px rgba(0, 212, 255, 0.3);
}

.btn-primary-custom:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.5);
}

.btn-secondary-custom {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary-custom:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-3px);
}

.hero-features {
    display: flex;
    gap: 40px;
}

.feature {
    display: flex;
    align-items: center;
    gap: 15px;
}

.feature-icon {
    width: 50px;
    height: 50px;
    background: rgba(0, 212, 255, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-icon i {
    color: var(--primary-color);
    font-size: 24px;
}

.hero-image img {
    width: 100%;
    height: auto;
    border-radius: 20px;
    box-shadow: var(--shadow);
}

/* Stats Section */
.stats {
    padding: 80px 0;
    background: var(--white);
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    text-align: center;
}

.stat-item h3 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 10px;
}

/* Services Section */
.services {
    padding: 80px 0;
    background: var(--bg-color);
}

.section-title {
    text-align: center;
    margin-bottom: 60px;
}

.section-title h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--gradient);
    border-radius: 2px;
}

.section-title p {
    font-size: 1.2rem;
    color: var(--light-text);
    max-width: 600px;
    margin: 0 auto;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.service-card {
    background: var(--card-bg);
    padding: 40px 30px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient);
    transform: scaleX(0);
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow);
}

.service-icon {
    width: 80px;
    height: 80px;
    background: var(--gradient);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.3);
}

.service-icon i {
    color: white;
    font-size: 36px;
}

.service-card a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Process Section */
.process {
    padding: 80px 0;
    background: var(--white);
}

.process-timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.process-timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--gradient);
    transform: translateX(-50%);
}

.process-item {
    display: flex;
    justify-content: flex-end;
    padding-right: 40px;
    position: relative;
    margin: 50px 0;
    width: 50%;
}

.process-item:nth-child(even) {
    align-self: flex-end;
    justify-content: flex-start;
    padding-left: 40px;
    padding-right: 0;
    margin-left: 50%;
}

.process-content {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    width: 100%;
}

.process-number {
    position: absolute;
    right: -60px;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: var(--gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
    box-shadow: 0 5px 20px rgba(0, 212, 255, 0.3);
}

.process-item:nth-child(even) .process-number {
    right: auto;
    left: -60px;
}

/* About Section */
.about {
    padding: 80px 0;
    background: var(--white);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.about-text h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.about-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.about-feature {
    display: flex;
    align-items: center;
    gap: 15px;
}

.about-feature i {
    color: var(--primary-color);
}

.about-image img {
    width: 100%;
    height: auto;
    border-radius: 20px;
    box-shadow: var(--shadow);
}

/* Team Section */
.team {
    padding: 80px 0;
    background: var(--bg-color);
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.team-member {
    background: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    text-align: center;
}

.team-member:hover {
    transform: translateY(-10px);
}

.team-member img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.team-info {
    padding: 25px;
}

.team-social {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.team-social a {
    width: 35px;
    height: 35px;
    background: var(--bg-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
}

.team-social a:hover {
    background: var(--gradient);
    color: white;
}

/* Blog Section */
.blog {
    padding: 80px 0;
    background: var(--white);
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.blog-card {
    background: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.blog-card:hover {
    transform: translateY(-5px);
}

.blog-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.blog-content {
    padding: 25px;
}

.blog-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: var(--light-text);
}

.read-more {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Testimonials Section */
.testimonials {
    padding: 80px 0;
    background: var(--bg-color);
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.testimonial-card {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.testimonial-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.stars { color: #ffc107; margin-bottom: 15px; }
.testimonial-card p { color: var(--light-text); font-style: italic; }

.client-info { display: flex; align-items: center; gap: 15px; }
.client-avatar { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; }

/* Gallery Section */
.gallery {
    padding: 80px 0;
    background: var(--white);
}

/* FIX: Gallery Filters Flex Wrap to prevent Horizontal Scroll */
.gallery-filters {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap; /* This prevents the buttons from causing a horizontal scroll */
}

.filter-btn {
    padding: 10px 25px;
    background: transparent;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    color: var(--text-color);
    font-weight: 600;
    cursor: pointer;
}

.filter-btn.active, .filter-btn:hover {
    background: var(--gradient);
    color: white;
    border-color: transparent;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.gallery-item {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    height: 250px;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-item:hover img { transform: scale(1.1); }

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.8) 100%);
    display: flex;
    align-items: flex-end;
    padding: 20px;
    opacity: 0;
}

.gallery-item:hover .gallery-overlay { opacity: 1; }
.gallery-info h4 { color: white; margin-bottom: 5px; }

/* CTA Section */
.cta {
    padding: 100px 0;
    background: var(--gradient);
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.cta::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: rotate 30s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.cta-content { position: relative; z-index: 1; }
.cta .btn-primary-custom { background: white; color: var(--primary-color); }

/* FAQ Section */
.faq {
    padding: 80px 0;
    background: var(--bg-color);
}

.accordion { max-width: 800px; margin: 0 auto; }
.accordion-item { border-radius: 10px; margin-bottom: 15px; overflow: hidden; }
.accordion-button { font-weight: 600; padding: 20px; border: none; }
.accordion-button:not(.collapsed) { color: var(--primary-color); box-shadow: none; }
.accordion-button:focus { box-shadow: none; border-color: var(--primary-color); }
.accordion-button::after { filter: var(--invert-icon); }
.accordion-body { padding: 20px; }

/* Contact Section */
.contact {
    padding: 80px 0;
    background: var(--bg-color);
}

.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    margin-top: 50px;
}

.contact-form {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.form-group { margin-bottom: 25px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 600; }

.form-control, .form-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-color);
    color: var(--text-color);
}

.form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

textarea.form-control { resize: vertical; min-height: 120px; }

.contact-info { display: flex; flex-direction: column; gap: 30px; }
.info-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 25px;
    background: var(--card-bg);
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.info-item:hover { transform: translateX(10px); box-shadow: var(--shadow); }
.info-icon {
    width: 50px;
    height: 50px;
    background: var(--gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.info-icon i { color: white; font-size: 24px; }
.info-content a { color: var(--primary-color); text-decoration: none; }

/* Footer */
footer {
    background: var(--white);
    padding: 60px 0 20px;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}

.footer-column h3 { font-size: 1.3rem; margin-bottom: 20px; }
.footer-column ul { list-style: none; }
.footer-column ul li { margin-bottom: 10px; }
.footer-column ul a { color: var(--light-text); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.footer-column ul a:hover { color: var(--primary-color); transform: translateX(5px); }
.social-links { display: flex; gap: 15px; }
.social-links a {
    width: 40px;
    height: 40px;
    background: var(--bg-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
}
.social-links a:hover { background: var(--gradient); color: white; transform: translateY(-3px); }

/* Responsive Design & Bug Fixes */
@media (max-width: 992px) {
    .hero-content, .about-content, .contact-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .services-grid, .testimonials-grid, .gallery-grid, .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-container, .team-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Mobile Menu (Offcanvas) Styling */
    .nav-links {
        flex-direction: column;
        width: 100%;
        align-items: flex-start;
        gap: 8px; /* Slight gap between items */
        padding: 0 10px;
    }

    .nav-links .nav-item {
        width: 100%;
        border-bottom: none; /* Removed bottom border */
    }

    .nav-links .nav-item .nav-link {
        width: 100%;
        padding: 12px 20px !important;
        font-size: 1.1rem;
        display: block;
        border-radius: 10px; /* Rounded pill effect */
        color: var(--text-color) !important;
    }

    /* FIX: Active/Selected Link Style to match provided screenshot */
    .nav-links .nav-item .nav-link.active {
        background-color: #e5e7eb !important; /* Soft light grey */
        color: #111827 !important; /* Dark bold text */
        font-weight: 600;
    }

    /* Active link style for Dark Mode */
    [data-theme="dark"] .nav-links .nav-item .nav-link.active {
        background-color: #374151 !important; /* Darker grey for dark mode */
        color: #f9fafb !important; /* White text */
    }

    /* Hover effect for non-active links */
    .nav-links .nav-item .nav-link:hover:not(.active) {
        background-color: rgba(0, 0, 0, 0.05);
    }

    [data-theme="dark"] .nav-links .nav-item .nav-link:hover:not(.active) {
        background-color: rgba(255, 255, 255, 0.05);
    }
}

@media (max-width: 768px) {
    .hero-text h1 { font-size: 2.5rem; }
    .hero-buttons { flex-direction: column; }
    .hero-features { flex-direction: column; gap: 20px; }
    
    .services-grid, .testimonials-grid, .gallery-grid, .blog-grid, .team-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-container { grid-template-columns: 1fr; }
    .footer-content { grid-template-columns: 1fr; }
    .about-features { grid-template-columns: 1fr; }
    
    .process-timeline::before { left: 30px; }
    .process-item { width: 100%; padding-left: 80px; padding-right: 0; justify-content: flex-start; margin: 30px 0; }
    .process-item:nth-child(even) { margin-left: 0; }
    .process-number { left: 5px; right: auto; }
    .process-item:nth-child(even) .process-number { left: 5px; }
}