:root {
    --primary-color: #00d2ff;
    --secondary-color: #9d50bb;
    --bg-color: #0b0e14;
    --bg-darker: #07090d;
    --text-color: #ffffff;
    --text-secondary: #d1d1d1;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --nav-bg: rgba(11, 14, 20, 0.8);
    --card-shadow: rgba(0, 0, 0, 0.5);
    --hero-overlay: rgba(7, 9, 13, 0.7);
}

[data-theme="light"] {
    --bg-color: #f8f9fa;
    --bg-darker: #ffffff;
    --text-color: #000000;
    --text-secondary: #444444;
    --glass-bg: #ffffff;
    --glass-border: #ced4da;
    --nav-bg: rgba(255, 255, 255, 0.95);
    --card-shadow: rgba(0, 0, 0, 0.15);
    --hero-overlay: rgba(255, 255, 255, 0.8);
}

[data-theme="light"] .glass-nav .nav-link,
[data-theme="light"] #theme-toggle {
    color: #000000 !important;
}

[data-theme="light"] .glass-nav.scrolled {
    background-color: #ffffff !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    color: var(--text-color);
}

.bg-dark {
    background-color: var(--bg-color) !important;
}

.bg-darker {
    background-color: var(--bg-darker) !important;
}

.text-secondary {
    color: var(--text-secondary) !important;
}

.text-white-target {
    color: var(--text-color) !important;
}

/* Glassmorphism */
.glass-nav {
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1.5rem 0;
    transition: all 0.3s ease;
}

.glass-nav.scrolled {
    padding: 0.8rem 0;
    background: var(--nav-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.navbar-brand {
    font-size: 2.8rem !important;
    transition: all 0.3s ease !important;
    margin-right: 2rem;
}

.glass-nav.scrolled .navbar-brand {
    font-size: 2.2rem !important;
}

.glass-nav .nav-link {
    color: var(--text-color) !important;
    font-weight: 500;
    transition: color 0.3s ease;
}

.glass-nav .nav-link:hover,
.glass-nav .nav-link.active {
    color: var(--primary-color) !important;
}

.navbar-toggler {
    filter: none;
    border-color: var(--glass-border);
}

[data-theme="light"] .navbar-toggler-icon {
    filter: invert(1);
}

#theme-toggle {
    color: var(--text-color) !important;
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px var(--card-shadow);
    border-color: var(--primary-color);
}

/* Text Gradient */
.text-gradient {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Hero Section */
.hero-section {
    position: relative;
    padding: 120px 0 80px;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.hero-carousel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.hero-carousel .carousel-inner,
.hero-carousel .carousel-item {
    height: 100%;
}

.hero-carousel .carousel-item {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.hero-carousel .carousel-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--hero-overlay);
}

.hero-blob {
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(0, 210, 255, 0.15) 0%, rgba(157, 80, 187, 0.05) 100%);
    filter: blur(80px);
    border-radius: 50%;
    z-index: -1;
    animation: float 20s infinite alternate;
}

.blob-1 { top: -100px; right: -100px; }
.blob-2 { bottom: -100px; left: -100px; background: radial-gradient(circle, rgba(157, 80, 187, 0.15) 0%, rgba(0, 210, 255, 0.05) 100%); }

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.1); }
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.hero-subtitle {
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    color: var(--text-secondary);
    max-width: 600px;
    margin-bottom: 2.5rem;
    font-weight: 500;
}

@media (max-width: 991px) {
    .hero-title { font-size: clamp(2rem, 8vw, 3rem); }
}

@media (max-height: 800px) {
    .hero-section {
        padding: 100px 0 50px;
    }
    .hero-title {
        font-size: clamp(2rem, 5vw, 3.8rem);
        margin-bottom: 1rem;
    }
    .hero-subtitle {
        margin-bottom: 1.5rem;
    }
}

/* Buttons */
.btn-primary {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.4);
}

.btn-outline-light {
    border-radius: 50px;
    padding: 10px 30px;
    border: 1px solid var(--glass-border);
    color: var(--text-color);
}

.btn-outline-light:hover {
    background: var(--glass-bg);
    color: var(--text-color);
}

/* Services */
.service-icon {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    display: block;
}

/* Form */
.form-control {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-color);
    border-radius: 10px;
    padding: 12px 20px;
    font-weight: 500;
}

.form-control::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.form-control:focus {
    background: var(--bg-darker);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0, 210, 255, 0.15);
    color: var(--text-color);
}

#three-container {
    height: clamp(300px, 60vh, 600px);
    width: 100%;
    position: relative;
    z-index: 9999;
    pointer-events: none;
}

#three-container canvas {
    display: block;
}

.z-index-2 {
    z-index: 2;
}

@keyframes float-img {
    0% { transform: translateY(0); }
    100% { transform: translateY(-20px); }
}

.floating-animation {
    animation: float-img 3s ease-in-out infinite alternate;
}

.carousel-control-prev,
.carousel-control-next {
    width: 50px;
    height: 50px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.5;
    transition: all 0.3s ease;
}

.carousel-control-prev {
    left: -80px;
}

.carousel-control-next {
    right: -80px;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    background-color: var(--glass-border);
    border-radius: 50%;
    padding: 20px;
    filter: brightness(0.5);
}

[data-theme="light"] .carousel-control-prev-icon,
[data-theme="light"] .carousel-control-next-icon {
    filter: invert(1) brightness(0.2);
}

@media (max-width: 1400px) {
    .carousel-control-prev { left: -40px; }
    .carousel-control-next { right: -40px; }
}

@media (max-width: 1200px) {
    .carousel-control-prev { left: 10px; }
    .carousel-control-next { right: 10px; }
    .carousel-control-prev, .carousel-control-next { opacity: 0.2; }
}

/* Process Infographic */
.process-infographic {
    position: relative;
    padding: 4rem 0;
}

.process-container {
    display: flex;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}

.process-item {
    text-align: center;
    flex: 1;
    position: relative;
    padding: 0 15px;
}

.process-icon-wrapper {
    width: 80px;
    height: 80px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 1.5rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    z-index: 2;
}

.process-item:hover .process-icon-wrapper {
    transform: scale(1.15);
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
}

.process-line {
    position: absolute;
    top: 40px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    opacity: 0.2;
    z-index: 1;
}

.process-item:last-child .process-line {
    display: none;
}

.process-number {
    position: absolute;
    top: -10px;
    right: -5px;
    width: 25px;
    height: 25px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

@media (max-width: 991px) {
    .process-container {
        flex-direction: column;
    }
    .process-item {
        margin-bottom: 3rem;
        text-align: left;
        display: flex;
        align-items: flex-start;
    }
    .process-icon-wrapper {
        margin: 0 1.5rem 0 0;
        flex-shrink: 0;
    }
    .process-line {
        left: 40px;
        top: 80px;
        width: 2px;
        height: 100%;
    }
}

/* Project Cards */
.project-card {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    height: 300px;
}

.project-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    background: linear-gradient(to top, rgba(7, 9, 13, 0.9), transparent);
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s ease;
}

.project-card:hover .project-overlay {
    transform: translateY(0);
    opacity: 1;
}

.project-card:hover img {
    transform: scale(1.1);
}

/* Testimonials */
.testimonial-card {
    border-left: 4px solid var(--primary-color);
}

.testimonial-text {
    font-style: italic;
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Preloader */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader {
    width: 50px;
    height: 50px;
    border: 3px solid var(--glass-border);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Back to Top Button */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    border: none;
    box-shadow: 0 5px 15px rgba(0, 210, 255, 0.3);
}

#back-to-top.show {
    opacity: 1;
    visibility: visible;
}

#back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 210, 255, 0.5);
}
