/* --- CORE RESET & VARIABLES --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

:root {
    --bg-dark: #0a0a0f;
    --neon-cyan: #00f0ff;
    --neon-purple: #b800ff;
    --neon-magenta: #ff006e;
    --neon-gold: #ffd000;
    --text-main: #ffffff;
    --text-muted: #b4b4b4;
    --font-heading: 'Orbitron', 'Montserrat', sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
    /* CRITICAL: Prevent horizontal scroll */
}

/* 🚨 CRITICAL MOBILE FIXES - PREVENT LAYOUT BREAKS */
* {
    box-sizing: border-box;
    /* Essential for width calculations */
}

img {
    max-width: 100% !important;
    /* NEVER overflow */
    height: auto !important;
    /* Maintain aspect ratio */
    display: block;
}

.container,
.section,
.glass-card,
.chat-interface {
    max-width: 100% !important;
    /* Never exceed screen width */
}

/* --- TYPOGRAPHY --- */
h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
}

h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
}

p {
    font-size: 1.1rem;
    color: var(--text-muted);
}

.gradient-text {
    background: linear-gradient(45deg, var(--neon-cyan), var(--neon-purple), var(--neon-magenta));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 8s ease infinite;
}

/* --- UTILITIES & EFFECTS --- */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: 6rem 0;
    position: relative;
    z-index: 1;
}

.glass-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 10px 30px rgba(0, 240, 255, 0.1);
    border-color: var(--neon-cyan);
}

.btn-neon {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple));
    color: #fff;
    font-family: var(--font-heading);
    font-weight: 700;
    text-decoration: none;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.4);
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.btn-neon:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(184, 0, 255, 0.6);
}

/* --- ANIMATIONS --- */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes kenBurns {
    0% {
        transform: scale(1);
        background-position: center;
    }

    100% {
        transform: scale(1.1);
        background-position: center top;
    }
}

/* Reveal Animation Class */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* --- HERO SECTION --- */
.hero-section {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: radial-gradient(circle at 70% 30%, #1a0b2e 0%, var(--bg-dark) 60%);
    overflow: hidden;
    margin-top: 0;
    padding-top: 0;
    /* CRITICAL */
}

.hero-bg-anim {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.6;
}

#neural-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 0.8fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 2;
}

.hero-visual {
    position: relative;
}

.hero-visual img {
    width: 100%;
    max-width: 500px;
    filter: drop-shadow(0 0 40px rgba(0, 240, 255, 0.2));
    animation: float 6s infinite ease-in-out;
}

/* --- CHAT TABS --- */
.btn-tab {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-body);
    font-weight: 600;
}

.btn-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.btn-tab.active {
    background: var(--neon-purple);
    /* Or gradient */
    border-color: var(--neon-purple);
    color: #fff;
    box-shadow: 0 0 15px rgba(184, 0, 255, 0.4);
}

/* --- FORMS --- */
input:focus {
    outline: none;
    border-color: var(--neon-cyan) !important;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

/* --- SECTIONS --- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.chat-interface {
    background: rgba(10, 10, 20, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    overflow: hidden;
    height: 500px;
    display: flex;
    flex-direction: column;
}

.chat-body {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.msg {
    padding: 10px 15px;
    border-radius: 12px;
    max-width: 80%;
    font-size: 0.95rem;
}

.msg.bot {
    background: rgba(0, 240, 255, 0.15);
    border: 1px solid rgba(0, 240, 255, 0.3);
    align-self: flex-start;
    color: #fff;
    border-bottom-left-radius: 2px;
}

.msg.user {
    background: rgba(255, 255, 255, 0.1);
    align-self: flex-end;
    color: #fff;
    border-bottom-right-radius: 2px;
}

/* Stats */
.stats-number {
    font-size: 4rem;
    font-weight: 900;
    line-height: 1;
    display: block;
}


/* ═══════════════════════════════════════════════════════════ */
/* 📱 MOBILE-FIRST RESPONSIVE OPTIMIZATION */
/* ═══════════════════════════════════════════════════════════ */

/* Mobile Base (320px - 767px) */
@media (max-width: 767px) {

    /* 🚨 CRITICAL: Prevent horizontal overflow */
    html,
    body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
        width: 100% !important;
    }

    /* 🚨 CRITICAL: All containers constrained */
    .container,
    .section,
    .hero-section,
    .glass-card,
    .chat-interface,
    .features-grid,
    .comparison-grid,
    .industry-tabs,
    .social-links {
        max-width: 100% !important;
        width: 100% !important;
        overflow-x: hidden !important;
    }

    /* Typography Scaling & Centering */
    h1 {
        font-size: 2rem !important;
        line-height: 1.2;
        text-align: center !important;
        word-wrap: break-word;
    }

    h2 {
        font-size: 1.5rem !important;
        text-align: center !important;
        word-wrap: break-word;
    }

    h3 {
        font-size: 1.2rem !important;
        text-align: center !important;
        word-wrap: break-word;
    }

    h4 {
        font-size: 1.05rem !important;
        text-align: center !important;
        word-wrap: break-word;
    }

    p {
        font-size: 0.95rem;
        text-align: center !important;
        word-wrap: break-word;
        line-height: 1.6;
    }

    /* Container & Spacing */
    .container {
        padding: 0 1.5rem !important;
        margin: 0 auto;
        max-width: 100%;
    }

    .section {
        padding: 3rem 0;
        margin: 0;
        max-width: 100%;
    }

    /* Hero Section - Stack Vertically & Center */
    .hero-section {
        min-height: auto;
        padding: 2rem 0;
        overflow: hidden;
    }

    .hero-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem;
        text-align: center !important;
        padding: 0 !important;
        max-width: 100%;
    }

    .hero-text {
        text-align: center !important;
        width: 100%;
        max-width: 100%;
    }

    .hero-text * {
        text-align: center !important;
    }

    .hero-visual {
        order: 2;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        margin-top: 2rem;
        gap: 1rem;
    }

    .hero-visual img {
        max-width: 90% !important;
        margin: 0 auto !important;
        display: block;
    }

    /* Logo Sizing & Centering */
    .hero-text img[alt="Assistora Logo"] {
        width: 180px !important;
        max-width: 180px !important;
        margin: 0 auto 1.5rem auto !important;
        display: block !important;
    }

    /* Buttons - Full Width & Touch Friendly & Centered */
    .btn-neon {
        width: 100% !important;
        max-width: 100% !important;
        padding: 1rem 2rem;
        font-size: 1rem;
        min-height: 48px;
        display: block;
        margin: 0 auto 1rem auto !important;
        text-align: center;
    }

    .btn-tab {
        padding: 0.7rem 1.2rem;
        font-size: 0.85rem;
        min-height: 44px;
    }

    /* Grids - Stack to Single Column */
    .features-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
        width: 100%;
        padding: 0;
    }

    .comparison-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem;
        width: 100%;
    }

    /* Glass Cards - Centered & Constrained */
    .glass-card {
        padding: 1.5rem;
        margin: 0 auto 1rem auto;
        max-width: 100%;
        width: 100%;
        text-align: center;
        margin-bottom: 1rem;
    }

    /* Chat Interface */
    .chat-interface {
        max-width: 100% !important;
        min-height: 400px !important;
    }

    .chat-body {
        padding: 1rem;
        height: 300px !important;
    }

    .msg {
        font-size: 0.875rem;
        max-width: 85%;
    }

    /* Stats - Smaller */
    .stats-number {
        font-size: 2.5rem !important;
    }

    /* Form Inputs - Full Width & Touch Friendly */
    input,
    button[type="submit"] {
        font-size: 16px !important;
        /* Prevent zoom on iOS */
        min-height: 48px;
        padding: 1rem !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }

    /* Industry Tabs - Wrap Better */
    .industry-tabs {
        gap: 0.5rem !important;
        justify-content: center !important;
        flex-wrap: wrap;
        width: 100%;
    }

    /* Footer Social Links - Stack */
    .social-links {
        flex-direction: column;
        gap: 1rem !important;
        align-items: center !important;
        width: 100%;
    }

    .social-links a {
        min-height: 48px;
        padding: 0.5rem;
        text-align: center;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Reduce Neon Effects for Performance */
    .glass-card:hover {
        transform: translateY(-5px) scale(1.01);
        box-shadow: 0 5px 15px rgba(0, 240, 255, 0.1);
    }

    /* Hide or Reduce Particles */
    #neural-canvas {
        opacity: 0.3;
    }

    /* Comparison Section - Clear Stacking */
    .comparison-grid>div {
        margin-bottom: 2rem;
        width: 100%;
        max-width: 100%;
    }

    /* Ensure flex containers don't overflow */
    div[style*="display: flex"],
    div[style*="display:flex"] {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Small Mobile (320px - 374px) */
@media (max-width: 374px) {
    h1 {
        font-size: 1.75rem !important;
    }

    .hero-text img[alt="Assistora Logo"] {
        width: 150px !important;
        max-width: 150px !important;
    }

    .container {
        padding: 0 1rem !important;
    }

    .btn-neon {
        font-size: 0.9rem;
        padding: 0.9rem 1.5rem;
    }

    .stats-number {
        font-size: 2rem !important;
    }
}

/* Tablet (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    h1 {
        font-size: 3rem !important;
    }

    h2 {
        font-size: 2rem !important;
    }

    .hero-grid {
        grid-template-columns: 1fr !important;
        text-align: center;
    }

    .hero-text {
        text-align: center !important;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .comparison-grid {
        grid-template-columns: 1fr !important;
    }

    .container {
        padding: 0 2rem;
    }

    .section {
        padding: 4rem 0;
    }
}

/* Desktop Preserve (1024px+) */
@media (min-width: 1024px) {
    .hero-grid {
        padding-top: 0;
    }

    /* Keep hero text centered on desktop too */
    .hero-text {
        text-align: center;
    }

    /* Make ONLY hero images same wide format (not other sections) */
    .hero-section .hero-visual img {
        height: 200px !important;
        object-fit: cover !important;
    }
}