/* Neurovex Frontend Styles - Mobile First & Responsive Refactor */

/* Base imports from design system */

/* ==================================================== */
/* 1. VISUAL POLISH & CORE VARIABLES                    */
/* ==================================================== */
:root {
    /* Fluid spacing and sizing */
    --space-2xs: clamp(0.25rem, 0.2rem + 0.25vw, 0.5rem);
    --space-xs: clamp(0.5rem, 0.4rem + 0.5vw, 0.75rem);
    --space-sm: clamp(0.75rem, 0.6rem + 0.75vw, 1rem);
    --space-md: clamp(1rem, 0.8rem + 1vw, 1.5rem);
    --space-lg: clamp(1.5rem, 1.2rem + 1.5vw, 2rem);
    --space-xl: clamp(2rem, 1.6rem + 2vw, 3rem);
    --space-2xl: clamp(3rem, 2.4rem + 3vw, 4rem);

    /* Fluid Typography */
    --text-sm: clamp(0.875rem, 0.8rem + 0.2vw, 1rem);
    --text-base: clamp(1rem, 0.9rem + 0.4vw, 1.125rem);
    --text-lg: clamp(1.125rem, 1rem + 0.5vw, 1.25rem);
    --text-xl: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
    --text-2xl: clamp(1.5rem, 1.3rem + 1vw, 2rem);
    --text-3xl: clamp(1.875rem, 1.5rem + 1.5vw, 2.5rem);
    --text-4xl: clamp(2.25rem, 1.8rem + 2vw, 3rem);

    /* Visual Polish */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.05);
    --shadow-float: 0 10px 30px rgba(0, 0, 0, 0.08);
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 5rem;
    overflow-x: hidden;
}

body {
    background-color: var(--color-background-light);
    color: var(--color-text-main);
    overflow-x: hidden;
    width: 100%;
    -webkit-font-smoothing: antialiased;
}

/* ==================================================== */
/* 2. RESPONSIVE LAYOUT SYSTEM (MOBILE FIRST)           */
/* ==================================================== */

/* Container constraints */
.container-fluid {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

/* Base grid layout stacking */
.grid-responsive {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    width: 100%;
}

/* Forms & Inputs Mobile First */
.form-input,
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
    width: 100%;
    min-height: 2.75rem;
    /* 44px min tap target */
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-size: var(--text-base);
    border: 1px solid var(--color-border-light, #e5e7eb);
    transition: all var(--transition-fast);
}

.form-input:focus,
input:not([type="checkbox"]):not([type="radio"]):focus {
    outline: none;
    border-color: var(--color-primary, #2563eb);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

button,
.btn {
    min-height: 2.75rem;
    font-size: var(--text-base);
}

/* Avoid iOS zoom on focus */
@media screen and (max-width: 768px) {

    input,
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* ==================================================== */
/* 3. NAVBAR & NAVIGATION                               */
/* ==================================================== */

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-md);
    min-height: 4.5rem;
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
}

.nav-left {
    display: flex;
    align-items: center;
}

.nav-left .logo-link img {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--radius-sm);
    object-fit: contain;
    box-shadow: var(--shadow-soft);
    will-change: transform;
    transition: transform var(--transition-fast);
}

.nav-left .logo-link:hover img {
    transform: scale(1.05);
}

.nav-link {
    white-space: nowrap;
    flex-shrink: 0;
}

/* Hidden on mobile, Flex on tablet+ */
.nav-links,
.nav-right {
    display: none;
}

.mobile-menu-overlay {
    transition: transform var(--transition-normal);
    will-change: transform;
}

.mobile-menu-overlay.translate-x-full {
    transform: translateX(100%);
}

#mobile-menu-btn {
    min-height: 2.75rem;
    min-width: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==================================================== */
/* 4. COMPONENTS & POLISH                               */
/* ==================================================== */

.page-logo {
    width: clamp(3rem, 5vw, 4rem);
    height: auto;
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    object-fit: contain;
    box-shadow: var(--shadow-float);
    background: white;
    padding: var(--space-xs);
    transition: transform var(--transition-fast);
    will-change: transform;
}

.page-logo:hover {
    transform: scale(1.05);
}

.get-started-btn {
    background: var(--color-primary, #2563eb);
    color: white;
    padding: 0.625rem 1.125rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
    will-change: transform, box-shadow;
    white-space: nowrap;
    flex-shrink: 0;
}

.get-started-btn:hover {
    transform: translateY(-0.125rem);
    box-shadow: var(--shadow-float);
    filter: brightness(1.1);
}

.btn-primary {
    background-color: var(--color-primary);
    color: white;
    transition: all var(--transition-fast);
    will-change: transform, box-shadow;
}

.btn-primary:hover,
.btn-primary:active {
    transform: translateY(-0.125rem);
    box-shadow: var(--shadow-float);
    filter: brightness(1.1);
}

/* Cards & Interactions */
.card-hover,
.control-card,
.feature-card {
    background: var(--color-surface-light, #ffffff);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-soft);
    transition: all var(--transition-normal);
    border: 1px solid var(--color-border-light);
    will-change: transform, box-shadow;
}

.card-hover:hover,
.control-card:hover,
.feature-card:hover {
    transform: translateY(-0.25rem);
    box-shadow: var(--shadow-float);
}

.feature-icon {
    width: 3rem;
    height: 3rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-md);
}

/* ==================================================== */
/* 5. SECTIONS & DASHBOARD                              */
/* ==================================================== */

.live-eeg-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 50vh;
    padding: var(--space-2xl) var(--space-md);
}

.monitor-btn,
.hardware-btn {
    width: 100%;
    margin-bottom: var(--space-sm);
}

/* Chart and Dashboard Containers */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
}

.chart-container {
    width: 100%;
    height: 100%;
    min-height: 15rem;
}

/* Reveal Animations */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(1.5rem);
    transition: opacity var(--transition-slow), transform var(--transition-slow);
    will-change: opacity, transform;
}

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

/* ==================================================== */
/* 6. BREAKPOINTS & RESPONSIVENESS                      */
/* ==================================================== */

/* 320px Small Mobile handled by base styles */

/* 480px Large Mobile */
@media screen and (min-width: 480px) {

    .monitor-btn,
    .hardware-btn {
        width: auto;
        margin-bottom: 0;
    }

    .btn-group {
        display: flex;
        gap: var(--space-sm);
        flex-direction: row;
    }
}

/* 768px Tablet Base */
@media screen and (min-width: 768px) {
    .nav-link {
        font-size: var(--text-sm);
        font-weight: 500;
        color: var(--color-text-sub);
        text-decoration: none;
        transition: color var(--transition-fast);
        white-space: nowrap;
        flex-shrink: 0;
    }

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

    .grid-responsive {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .live-eeg-section {
        min-height: 60vh;
    }

    input,
    select,
    textarea,
    button {
        width: auto;
    }

    /* Revert width for forms within containers */
    form input,
    form select,
    form textarea,
    form button {
        width: 100%;
    }
}

/* 1024px Small Laptop */
@media screen and (min-width: 1024px) {
    .nav-links {
        display: flex;
        gap: var(--space-md);
        align-items: center;
    }

    .nav-right {
        display: flex;
        align-items: center;
        gap: var(--space-sm);
    }

    .grid-responsive {
        grid-template-columns: repeat(3, 1fr);
    }

    .dashboard-grid {
        grid-template-columns: repeat(12, 1fr);
    }

    .dashboard-grid>*:nth-child(1) {
        grid-column: span 8;
    }

    .dashboard-grid>*:nth-child(2) {
        grid-column: span 4;
    }

    .navbar {
        padding: 0 var(--space-xl);
    }

    .hero-section {
        min-height: 100vh;
    }
}

/* 1440px Large Screen */
@media screen and (min-width: 1440px) {
    .container-fluid {
        padding: 0;
    }

    .grid-responsive.grid-cols-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ==================================================== */
/* 7. UTILITIES & FIXES                                 */
/* ==================================================== */

.text-gradient-medical {
    background: linear-gradient(135deg, var(--color-primary, #2563eb), var(--color-secondary, #0d9488));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.divider {
    width: 1px;
    height: 1.25rem;
    background: var(--color-border-light, #e5e7eb);
}

.profile-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--color-primary, #2563eb);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all var(--transition-fast);
    will-change: transform;
}

.profile-avatar:hover {
    transform: translateY(-0.0625rem);
    filter: brightness(1.1);
}

/* Status dots */
.status-connected {
    background-color: #10b981;
    animation: pulse 2s infinite;
}

.status-disconnected {
    background-color: #6b7280;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}