/* Global Reset & Base */
:root {
    --primary: #06b6d4;
    --secondary: #3b82f6;
    --accent: #f59e0b;
    --dark: #0f172a;
    --light: #f8fafc;
    --glass: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background-color: var(--light);
    color: var(--dark);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
}

/* Gradient Mesh Background Animation */
/* Gradient Mesh Background Animation (Dark Theme) */
.gradient-bg {
    background: linear-gradient(-45deg, #0f172a, #1e293b, #0f172a, #172554);
    background-size: 400% 400%;
    animation: gradient 15s ease infinite;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 1;
}

@keyframes gradient {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Glassmorphism Utilities */
.glass-panel {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
}

.glass-panel-dark {
    background: rgba(15, 23, 42, 0.6);
    /* Slate-900 with opacity */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
}


.glass-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.glass-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 50px -10px rgba(6, 182, 212, 0.3);
    border-color: var(--primary);
}

/* 3D Perspective & Animations */
.perspective-1000 {
    perspective: 1000px;
}

.rotate-on-hover {
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.rotate-on-hover:hover {
    transform: rotateY(10deg) rotateX(5deg);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, var(--primary), var(--secondary));
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary);
}

/* Comparison Slider */
.img-comp-container {
    position: relative;
    height: 400px;
    /* Adjust as needed */
    overflow: hidden;
    border-radius: 2rem;
    box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.3);
}

.img-comp-img {
    position: absolute;
    width: 100%;
    /* Changed from auto to 100% to ensure underlying image fills container */
    height: 100%;
    overflow: hidden;
}

.img-comp-img img {
    display: block;
    vertical-align: middle;
    width: 100%;
    /* Ensure width is 100% by default */
    height: 100%;
    /* Ensure height is 100% by default */
    object-fit: cover;
    /* Maintain aspect ratio */
    max-width: none !important;
    /* Critical fix for Tailwind reset */
}

.img-comp-slider {
    position: absolute;
    z-index: 9;
    cursor: ew-resize;
    width: 40px;
    height: 40px;
    background-color: white;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.4);
    transition: transform 0.1s;
}

.img-comp-slider::before {
    content: '↔';
    font-weight: bold;
    color: var(--dark);
}

.img-comp-slider:active {
    transform: translate(-50%, -50%) scale(1.2);
}

/* Animations */
@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }
}

.animate-float {
    animation: float 4s ease-in-out infinite;
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.33);
        opacity: 1;
    }

    80%,
    100% {
        opacity: 0;
    }
}

.pulse-ring::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    border: 1px solid var(--primary);
    animation: pulse-ring 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

/* Masonry Grid */
.masonry-grid {
    column-count: 3;
    column-gap: 1.5rem;
}

@media (max-width: 1024px) {
    .masonry-grid {
        column-count: 2;
    }
}

@media (max-width: 640px) {
    .masonry-grid {
        column-count: 1;
    }
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 1.5rem;
}

/* Form Styles */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 28px;
    height: 28px;
    background: white;
    border: 4px solid var(--primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    margin-top: -12px;
    transition: transform 0.2s;
}

/* Custom Range Slider */
input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
    padding: 10px 0;
    /* Increase touch area */
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 28px;
    width: 28px;
    border-radius: 50%;
    background: #ffffff;
    border: 4px solid var(--primary);
    /* Cyan ring */
    cursor: pointer;
    margin-top: -11px;
    /* Center thumb on track (6px track / 2 - 28px thumb / 2) */
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.5);
    /* Glowing effect */
    transition: transform 0.1s ease, box-shadow 0.2s ease;
}

input[type=range]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 25px rgba(6, 182, 212, 0.8);
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    cursor: pointer;
}

input[type=range]:focus {
    outline: none;
}

/* Custom Segmented Control Buttons */
.segment-btn {
    position: relative;
    z-index: 10;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.segment-btn.active {
    color: #0f172a;
    /* slate-900 */
    background: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transform: scale(1.02);
}

.segment-btn:not(.active) {
    color: #94a3b8;
    /* slate-400 */
}

.segment-btn:not(.active):hover {
    color: #e2e8f0;
    /* slate-200 */
    background: rgba(255, 255, 255, 0.05);
}

/* Service Card Active State */
.service-btn.active {
    border-color: var(--primary);
    background-color: rgba(6, 182, 212, 0.1);
    /* Cyan tint */
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.2);
    transform: translateY(-4px) scale(1.02);
}

/* Mobile Menu */
.mobile-menu {
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.77, 0, 0.175, 1);
}

.mobile-menu.active {
    transform: translateX(0);
}

.menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 40;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}