/* ===== MODERN RESET & VARS ===== */
:root {
    /* Color Palette - Premium Dark Tech */
    --color-bg-dark: #020617;
    /* Slate 950 */
    --color-bg-card: #0f172a;
    /* Slate 900 */
    --color-primary: #3b82f6;
    /* Blue 500 */
    --color-primary-dark: #2563eb;
    /* Blue 600 */
    --color-secondary: #06b6d4;
    /* Cyan 500 */
    --color-accent: #8b5cf6;
    /* Violet 500 */

    --color-text-main: #f8fafc;
    /* Slate 50 */
    --color-text-muted: #94a3b8;
    /* Slate 400 */
    --color-border: rgba(255, 255, 255, 0.1);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    --gradient-text: linear-gradient(to right, #60a5fa, #22d3ee);
    --gradient-glow: radial-gradient(circle at center, rgba(59, 130, 246, 0.15) 0%, transparent 70%);

    /* Typography */
    --font-display: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Spacing & Layout */
    --container-width: 1280px;
    --header-height: 80px;
    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
    --radius-full: 9999px;

    /* Shadows & Effects */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.3);

    --glass-bg: rgba(15, 23, 42, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-backdrop: blur(12px);

    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --duration-short: 0.2s;
    --duration-medium: 0.4s;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg-dark);
    color: var(--color-text-main);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    position: relative;
    padding-top: var(--header-height);
}

/* Background Effects */
.bg-gradient-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background:
        radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 85% 30%, rgba(6, 182, 212, 0.08) 0%, transparent 40%);
    pointer-events: none;
    z-index: -1;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.1;
    color: var(--color-text-main);
}

h1 {
    font-size: clamp(3rem, 5vw, 4.5rem);
    letter-spacing: -0.02em;
}

h2 {
    font-size: clamp(2rem, 3vw, 3rem);
    letter-spacing: -0.01em;
}

h3 {
    font-size: clamp(1.5rem, 2vw, 2rem);
}

p {
    color: var(--color-text-muted);
    font-size: 1.125rem;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--duration-short) var(--ease-out);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Utilities */
.container {
    width: 90%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1rem;
}

.section {
    padding: 6rem 0;
    position: relative;
}

.text-gradient {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    transition: all var(--duration-short) var(--ease-out);
    cursor: pointer;
    font-family: var(--font-body);
}

.btn-primary {
    background: var(--color-primary);
    color: white;
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
}

.btn-primary:hover {
    background: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-main);
}

.btn-outline:hover {
    border-color: var(--color-primary);
    background: rgba(59, 130, 246, 0.1);
    color: white;
}

/* ===== HEADER & NAV ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: rgba(2, 6, 23, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
    z-index: 1000;
    display: flex;
    align-items: center;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--color-text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: var(--gradient-primary);
    border-radius: var(--radius-sm);
    display: grid;
    place-items: center;
    color: white;
    font-size: 1.2rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-text-muted);
}

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

.mobile-menu-btn {
    display: none;
    color: var(--color-text-main);
    font-size: 1.5rem;
    cursor: pointer;
}

/* ===== HERO SECTION ===== */
.hero {
    min-height: calc(100vh - var(--header-height));
    display: flex;
    align-items: center;
    padding: 4rem 0;
    overflow: hidden;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 4rem;
    align-items: center;
}

.hero-content {
    animation: fadeUp 0.8s var(--ease-out) forwards;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 1rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--radius-full);
    color: var(--color-primary);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.hero-title {
    margin-bottom: 1.5rem;
}

.hero-desc {
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
    max-width: 600px;
}

.hero-stats {
    display: flex;
    gap: 3rem;
    margin-top: 3rem;
    border-top: 1px solid var(--color-border);
    padding-top: 2rem;
}

.stat-item h4 {
    font-size: 2rem;
    color: white;
}

.stat-item p {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hero-visual {
    position: relative;
    height: 500px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.glow-circle {
    position: absolute;
    width: 400px;
    height: 400px;
    background: var(--gradient-primary);
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.2;
    animation: pulse 4s ease-in-out infinite alternate;
}

.visual-card {
    position: relative;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: var(--glass-backdrop);
    border-radius: var(--radius-lg);
    padding: 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-2xl);
    transform: perspective(1000px) rotateY(-10deg) rotateX(5deg);
    transition: transform 0.4s var(--ease-out);
}

.visual-card:hover {
    transform: perspective(1000px) rotateY(0) rotateX(0);
}

/* ===== TRUSTED BY SECTION - CAROUSEL ===== */
.trusted-by {
    padding: 4rem 0;
    border-bottom: 1px solid var(--color-border);
    background: rgba(15, 23, 42, 0.4);
    overflow: hidden;
    position: relative;
}

.trusted-label {
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--color-primary);
    margin-bottom: 3rem;
    opacity: 0.9;
}

.logo-slider {
    position: relative;
    width: 100%;
    overflow: hidden;
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.logo-track {
    display: flex;
    gap: 5rem;
    width: max-content;
    animation: scroll 30s linear infinite;
    padding: 1rem 0;
}

.logo-track:hover {
    animation-play-state: paused;
}

.logo-item {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 2.5rem;
    /* Increased size */
    color: var(--color-text-muted);
    white-space: nowrap;
    transition: all 0.3s;
    cursor: default;
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: -0.02em;
}

.logo-item:hover {
    color: var(--color-text-main);
    opacity: 1;
    text-shadow: 0 0 30px rgba(59, 130, 246, 0.5);
    transform: scale(1.1);
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(calc(-50% - 2.5rem));
        /* Move by half the width + half the gap */
    }
}

/* ===== SERVICES SECTION ===== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 4rem;
}

.service-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 2.5rem;
    transition: all 0.3s var(--ease-out);
    position: relative;
    overflow: hidden;
}

.service-card:hover {
    transform: translateY(-5px);
    border-color: var(--color-primary);
    box-shadow: var(--shadow-glow);
}

.service-icon {
    width: 60px;
    height: 60px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: var(--color-primary);
    margin-bottom: 1.5rem;
}

.service-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

/* ===== WORK / PROJECTS ===== */
.work-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2.5rem;
    margin-top: 4rem;
}

.project-card {
    group: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    aspect-ratio: 16/9;
}

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

.project-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(2, 6, 23, 0.9), transparent);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card:hover .project-overlay {
    opacity: 1;
}

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

.project-tags {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.tag {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    backdrop-filter: blur(4px);
}

/* ===== CONTACT SECTION ===== */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.contact-info {
    padding: 4rem;
    background: var(--gradient-primary);
    color: white;
}

.contact-info p {
    color: rgba(255, 255, 255, 0.8);
}

.contact-form-container {
    padding: 4rem;
}

.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: white;
    font-family: var(--font-body);
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    background: rgba(59, 130, 246, 0.05);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.form-label {
    position: absolute;
    left: 1rem;
    top: 1rem;
    color: var(--color-text-muted);
    pointer-events: none;
    transition: all 0.2s ease;
    background: transparent;
}

.form-input:focus~.form-label,
.form-input:not(:placeholder-shown)~.form-label,
.form-textarea:focus~.form-label,
.form-textarea:not(:placeholder-shown)~.form-label {
    top: -0.6rem;
    left: 0.8rem;
    font-size: 0.75rem;
    color: var(--color-primary);
    background: var(--color-bg-card);
    padding: 0 0.4rem;
}

/* ===== FOOTER ===== */
.footer {
    border-top: 1px solid var(--color-border);
    padding: 4rem 0 2rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-column h4 {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.footer-links a {
    display: block;
    margin-bottom: 0.8rem;
    color: var(--color-text-muted);
}

.footer-links a:hover {
    color: var(--color-primary);
}

.copyright {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-visual {
        display: none;
    }

    .hero-stats {
        justify-content: center;
    }

    .contact-wrapper {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 70px;
    }

    .nav-links {
        display: none;
        /* Mobile Menu Implementation needed for full functionality, sticking to simple hidden for now or stacked */
    }

    .mobile-menu-btn {
        display: block;
    }

    .section {
        padding: 4rem 0;
    }

    .contact-info,
    .contact-form-container {
        padding: 2rem;
    }
}

/* Animations */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        opacity: 0.2;
        transform: scale(1);
    }

    100% {
        opacity: 0.4;
        transform: scale(1.1);
    }
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s var(--ease-out);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* ===== WHATSAPP WIDGET & CHAT ===== */
.whatsapp-widget {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
}

.whatsapp-btn {
    width: 60px;
    height: 60px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s;
    animation: pulse-green 2s infinite;
}

.whatsapp-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 20px rgba(37, 211, 102, 0.4);
}

.whatsapp-icon {
    width: 32px;
    height: 32px;
    fill: white;
}

@keyframes pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

/* Chat Window */
.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px) scale(0.9);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1), width 0.3s, height 0.3s;
    transform-origin: bottom right;
}

.chat-window.active {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: all;
}

.chat-window.expanded {
    width: 600px;
    height: 80vh;
    max-height: 800px;
    bottom: 2rem;
    right: 2rem;
    /* Optional adjustment if you want it centered or offset differently */
    position: fixed;
    /* Fix to viewport when expanded to avoid being cut off */
    z-index: 10000;
}

/* Mobile override for expanded state */
@media (max-width: 640px) {
    .chat-window.expanded {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
}

.chat-header {
    background: var(--color-primary-dark);
    padding: 1rem;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-avatar {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    position: relative;
}

.chat-status {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    background: #22c55e;
    border-radius: 50%;
    border: 2px solid var(--color-primary-dark);
}

.chat-info h4 {
    font-size: 1rem;
    margin-bottom: 0.1rem;
    font-weight: 600;
}

.chat-info p {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
}

.chat-controls {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chat-control-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.1rem;
    opacity: 0.7;
    transition: opacity 0.2s, background 0.2s;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.chat-control-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

.chat-close {
    font-size: 1.25rem;
}

.chat-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: rgba(0, 0, 0, 0.2);
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.message {
    max-width: 85%;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    font-size: 0.9rem;
    line-height: 1.4;
    position: relative;
    animation: fadeUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    word-wrap: break-word;
}

.message p {
    color: inherit;
    font-size: inherit;
    margin: 0;
}

.message.bot {
    align-self: flex-start;
    background: #1e293b;
    color: white;
    border-bottom-left-radius: 0.25rem;
}

.message.user {
    align-self: flex-end;
    background: var(--color-primary);
    color: white;
    border-bottom-right-radius: 0.25rem;
}

.message-time {
    font-size: 0.65rem;
    opacity: 0.5;
    margin-top: 4px;
    text-align: right;
    display: block;
}

.chat-input-area {
    padding: 1rem;
    border-top: 1px solid var(--color-border);
    display: flex;
    gap: 0.5rem;
    background: var(--color-bg-card);
}

.chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--color-border);
    padding: 0.75rem 1rem;
    border-radius: 2rem;
    color: white;
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

.chat-input:focus {
    outline: none;
    border-color: var(--color-primary);
    background: rgba(59, 130, 246, 0.05);
}

.chat-send {
    width: 42px;
    height: 42px;
    background: var(--color-primary);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chat-send:hover:not(:disabled) {
    transform: scale(1.1);
    background: var(--color-primary-dark);
}

/* Typing Indicator */
.typing-container {
    padding: 0.5rem 1rem;
    background: #1e293b;
    border-radius: 1rem;
    border-bottom-left-radius: 0.25rem;
    align-self: flex-start;
    display: none;
    /* Hidden by default */
    margin-bottom: 0.5rem;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.dot {
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.dot:nth-child(1) {
    animation-delay: -0.32s;
}

.dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

@media (max-width: 480px) {
    .chat-window {
        position: fixed;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100vh;
        border-radius: 0;
        transform: translateY(100%);
        z-index: 10000;
    }

    .whatsapp-widget {
        bottom: 1.5rem;
        right: 1.5rem;
    }
}