/* =========================================
   1. THEME VARIABLES & SETUP
   ========================================= */
:root {
    /* DARK MODE (Default) */
    --bg-body: #020617;
    --bg-card: #0f172a;
    --bg-glass: rgba(15, 23, 42, 0.95);
    /* Increased opacity for mobile readability */
    --text-main: #ffffff;
    --text-muted: #cbd5e1;
    --primary: #6366f1;
    --accent: #8b5cf6;
    --border-color: rgba(255, 255, 255, 0.1);
    --icon-color: #cbd5e1;
}

[data-theme="light"] {
    /* LIGHT MODE */
    --bg-body: #f1f5f9;
    --bg-card: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.95);
    --text-main: #0f172a;
    --text-muted: #475569;
    --primary: #4f46e5;
    --accent: #7c3aed;
    --border-color: rgba(0, 0, 0, 0.1);
    --icon-color: #475569;
}

/* =========================================
   2. GLOBAL RESETS & TYPOGRAPHY
   ========================================= */
html {
    font-size: 16px;
    scroll-behavior: smooth;
    overflow-x: hidden;
    /* Critical for mobile */
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    transition: background 0.3s, color 0.3s;
    overflow-x: hidden;
    /* Critical for mobile */
    position: relative;
    width: 100%;
}

a {
    text-decoration: none;
    transition: 0.3s;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Fluid Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-main);
    margin-bottom: 1rem;
}

.display-3 {
    font-size: clamp(2rem, 5vw, 4rem);
}

.lead {
    font-size: clamp(1rem, 1.2vw, 1.25rem);
}

/* Icons */
i {
    color: var(--icon-color);
    transition: color 0.3s;
}

.text-primary i,
.text-success i,
.text-danger i,
.text-warning i {
    color: inherit !important;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: var(--bg-body);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

/* Hide horizontal scrollbar for clean look but allow scroll */
.scroll-container::-webkit-scrollbar {
    display: none;
}

/* =========================================
   3. COMPONENTS (BUTTONS & NAV)
   ========================================= */
.btn-tech {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white !important;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    white-space: nowrap;
}

.btn-tech:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-outline-tech {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    white-space: nowrap;
}

.btn-outline-tech:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* NAVBAR */
.navbar {
    padding: 15px 0;
    transition: 0.3s;
    background: rgba(var(--bg-body), 0.8);
    /* Slight transparent bg */
    backdrop-filter: blur(10px);
}

.navbar-brand img {
    width: 50px;
    height: 50px;
}

.navbar-brand span {
    font-size: 1.2rem;
    font-weight: 700;
}

.nav-link {
    color: var(--text-muted) !important;
    font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary) !important;
}

/* Mobile Menu Toggler */
.navbar-toggler {
    border: none;
    padding: 0;
}

.navbar-toggler:focus {
    box-shadow: none;
}

.theme-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* =========================================
   4. HERO SECTION (3D Logic)
   ========================================= */
.hero-section {
    padding: 140px 0 80px;
    position: relative;
    overflow: hidden;
    /* Stops 3D element from creating horizontal scroll */
}

/* Background Grid */
.hero-bg-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(var(--border-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-color) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.15;
    z-index: -1;
    transform: perspective(500px) rotateX(20deg);
    transform-origin: top;
}

.hero-title span {
    background: linear-gradient(to right, #38bdf8, #818cf8, #c084fc);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* 3D Dashboard Container */
.dash-3d-container {
    perspective: 1000px;
    position: relative;
    z-index: 1;
}

.dash-window {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: rotateY(-10deg) rotateX(5deg);
    transition: transform 0.5s ease;
}

.dash-window:hover {
    transform: rotateY(0deg) rotateX(0deg);
}

/* Floating Badges */
.dash-3d-container .position-absolute {
    background: var(--bg-card);
    z-index: 2;
    transition: transform 0.3s;
}

/* =========================================
   5. TECH MARQUEE
   ========================================= */
.tech-marquee {
    padding: 25px 0;
    overflow: hidden;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-card);
}

.marquee-track {
    display: flex;
    gap: 40px;
    width: max-content;
    animation: marquee-scroll 25s linear infinite;
}

.tech-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 1rem;
}

.tech-item i {
    font-size: 1.5rem;
}

@keyframes marquee-scroll {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}

/* =========================================
   6. SCROLL SECTIONS (Projects & Pricing)
   ========================================= */
.h-scroll-section {
    padding: 60px 0;
    background: linear-gradient(180deg, var(--bg-body) 0%, var(--bg-card) 100%);
}

.scroll-container {
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    padding: 20px 0;
    cursor: grab;
    -webkit-overflow-scrolling: touch;
    /* Smooth scroll on iOS */
    padding-left: 5vw;
    /* Start with some padding on mobile */
    padding-right: 5vw;
}

.scroll-container.active {
    cursor: grabbing;
}

/* The sizing magic for responsiveness */
.scroll-item {
    display: inline-block;
    width: 80vw;
    /* Slightly smaller on mobile */
    max-width: 320px;
    /* Tighter cap on desktop */
    margin-right: 16px;
    vertical-align: top;
    white-space: normal;
    /* Allow text inside to wrap */
}

/* Wider cards for pricing rows */
.scroll-container.pricing-scroll .scroll-item {
    width: 92vw;
    max-width: 440px;
}

/* Pricing Cards */
.pricing-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 22px;
    transition: 0.3s;
    text-align: center;
    position: relative;
}

.pricing-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}

.pricing-card small {
    font-size: 0.85rem;
}

.pricing-card ul {
    margin-bottom: 0.75rem;
}

.pricing-card li {
    margin-bottom: 0.4rem !important;
}

.price {
    font-size: 2.1rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 10px 0;
}

.price span {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* Pricing tags */
.pricing-tag {
    position: absolute;
    top: -10px;
    left: -12px;
    padding: 10px 20px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    box-shadow: 0 6px 14px rgba(99, 102, 241, 0.35);
}

.pricing-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

/* Portfolio Cards */
.portfolio-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: 0.3s;
}

.portfolio-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.2);
}

.browser-header {
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 12px;
    display: flex;
    gap: 6px;
    border-bottom: 1px solid var(--border-color);
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.red {
    background: #ef4444;
}

.yellow {
    background: #f59e0b;
}

.green {
    background: #22c55e;
}

.browser-view {
    height: 200px;
    overflow: hidden;
    position: relative;
}

.browser-view img {
    width: 100%;
    object-fit: cover;
    object-position: top;
    transition: transform 3s ease-in-out;
}

.portfolio-card:hover .browser-view img {
    transform: translateY(-20%);
}

/* =========================================
   7. TEAM & FOOTER
   ========================================= */
.team-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    text-align: center;
}

.team-img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

footer {
    background: #000000;
    border-top: 1px solid var(--border-color);
    padding: 60px 0 30px;
}

footer a,
footer p,
footer span {
    color: #94a3b8;
    font-size: 0.95rem;
}

footer a:hover {
    color: var(--primary);
}

footer .text-white {
    color: #fff !important;
}

/* WhatsApp Button */
a[href*="wa.me"] {
    transition: transform 0.3s;
    box-shadow: 0 4px 10px rgba(37, 211, 102, 0.4);
}

a[href*="wa.me"]:hover {
    transform: scale(1.1);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    padding: 20px;
}

.modal-overlay.open {
    display: flex;
    opacity: 1;
}

.modal-content {
    max-width: 900px;
    max-height: 80vh;
    width: 100%;
    object-fit: contain;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2rem;
    color: white;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* Floating contact buttons */
.floating-contact {
    position: fixed;
    right: 30px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: #fff;
    z-index: 1000;
    text-decoration: none;
    --contact-glow: rgba(37, 118, 211, 0.35);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
    animation: float-contact 3.4s ease-in-out infinite, pulse-contact 2.2s ease-out infinite;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.floating-contact::after {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.25);
    animation: ring-contact 2.4s ease-out infinite;
    pointer-events: none;
}

.floating-contact.call {
    bottom: 120px;
    background: #2576d3;
    --contact-glow: rgba(37, 118, 211, 0.35);
}

.floating-contact.whatsapp {
    bottom: 30px;
    background: #25d366;
    --contact-glow: rgba(37, 211, 102, 0.35);
}

.floating-contact:hover,
.floating-contact:focus-visible {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
}

@keyframes float-contact {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-4px);
    }
}

@keyframes pulse-contact {
    0% {
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
    }

    70% {
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28), 0 0 0 14px var(--contact-glow);
    }

    100% {
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28), 0 0 0 0 var(--contact-glow);
    }
}

@keyframes ring-contact {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.25);
    }

    80% {
        box-shadow: 0 0 0 16px rgba(255, 255, 255, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
}

/* =========================================
   8. MEDIA QUERIES (THE FIXES)
   ========================================= */

/* Tablets & Mobile (Below 991px) */
@media (max-width: 991px) {

    /* Navbar Fixes */
    .navbar-collapse {
        background: var(--bg-card);
        padding: 20px;
        margin-top: 15px;
        border-radius: 12px;
        border: 1px solid var(--border-color);
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    }

    /* Hero Fixes */
    .hero-section {
        padding-top: 100px;
        padding-bottom: 50px;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    /* Disable 3D on mobile to prevent overflow */
    .dash-3d-container {
        perspective: none;
        margin-top: 40px;
    }

    .dash-window {
        transform: none !important;
        width: 100%;
    }

    /* Hide floating badges on mobile */
    .dash-3d-container .position-absolute {
        display: none !important;
    }

    /* Center align hero text on mobile */
    .hero-section .col-lg-6:first-child {
        text-align: center;
    }

    .hero-section .d-inline-flex {
        margin: 0 auto 1.5rem auto;
        /* Center the badge */
    }

    .hero-section .d-flex.flex-wrap {
        justify-content: center;
        /* Center the checkmarks */
    }

    .hero-section .d-flex.gap-3 {
        justify-content: center;
        /* Center CTA buttons */
    }
}

/* Mobile Phones (Below 576px) */
@media (max-width: 576px) {
    .container {
        padding-left: 20px;
        padding-right: 20px;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .lead {
        font-size: 1rem;
    }

    /* Stack CTA buttons if screen is very small */
    .hero-section .d-flex.gap-3 {
        flex-direction: column;
        width: 100%;
    }

    .btn-tech,
    .btn-outline-tech {
        width: 100%;
        display: block;
        text-align: center;
    }

    /* Marquee Adjustment */
    .marquee-track {
        gap: 20px;
        animation-duration: 20s;
    }

    /* Footer Alignment */
    footer {
        text-align: center;
    }

    /* WhatsApp Button position fix */
    .floating-contact {
        width: 54px;
        height: 54px;
        font-size: 24px;
        right: 20px;
    }

    .floating-contact.call {
        bottom: 105px;
    }

    .floating-contact.whatsapp {
        bottom: 20px;
    }

}