/* assets/css/style.css - Modern Mobile-First Design */

:root {
    /* Brand Colors - Premium & Vibrant */
    --primary: #00f2ff;
    --primary-hover: #00c8d4;
    --primary-glow: rgba(0, 242, 255, 0.3);
    --accent: #ff0055;
    --accent-glow: rgba(255, 0, 85, 0.3);

    /* Surfaces */
    --bg-dark: #0a0a0a;
    --bg-elevated: #111111;
    --card-bg: rgba(25, 25, 25, 0.8);
    --card-bg-hover: rgba(35, 35, 35, 0.9);

    /* Text */
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;

    /* Borders & Effects */
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px var(--primary-glow);

    /* Layout */
    --container-max: 1200px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base - Mobile First */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    min-height: 100vh;
    background-image:
        radial-gradient(ellipse at 20% 0%, rgba(0, 242, 255, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(255, 0, 85, 0.06) 0%, transparent 50%);
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

ul,
ol {
    list-style: none;
}

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

button {
    font-family: inherit;
    cursor: pointer;
}

/* Typography - Fluid Scaling */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
}

h1 {
    font-size: clamp(2rem, 6vw, 3.5rem);
}

h2 {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
}

h3 {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
}

h4 {
    font-size: clamp(1.1rem, 2.5vw, 1.25rem);
}

p {
    color: var(--text-secondary);
}

.section-title {
    text-align: center;
    margin-bottom: 2.5rem;
}

.section-title span {
    color: var(--primary);
    position: relative;
}

.section-title span::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
    box-shadow: var(--shadow-glow);
}

/* Layout */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 16px;
}

/* Responsive Grid System */
.grid {
    display: grid;
    gap: 20px;
}

.grid-cols-2,
.grid-cols-3,
.grid-cols-4 {
    grid-template-columns: 1fr;
}

/* Buttons - Touch Friendly */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    min-height: 48px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
    border: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    white-space: nowrap;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.btn-primary {
    background: var(--primary);
    color: #000;
    box-shadow: 0 4px 20px var(--primary-glow);
}

.btn-primary:hover {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(255, 255, 255, 0.2);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border-hover);
    color: var(--text-primary);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(0, 242, 255, 0.1);
}

.btn-accent {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 4px 20px var(--accent-glow);
}

/* Glass Panel */
.glass-panel {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 12px 0;
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.03em;
}

.logo span {
    color: var(--primary);
}

.logo i {
    color: var(--primary);
    font-size: 1.3rem;
}

/* Mobile Nav Action (Login/Dashboard) */
.mobile-nav-action {
    display: block;
}

.mobile-nav-action .btn-sm {
    padding: 8px 16px;
    min-height: 36px;
    font-size: 0.85rem;
    gap: 6px;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all var(--transition-fast);
}

/* Nav Links */
.nav-links {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 10, 0.98);
    backdrop-filter: blur(20px);
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 40px 20px;
    gap: 0;
    z-index: 999;
    overflow-y: auto;
}

.nav-links.active {
    display: flex;
}

.nav-links a {
    display: block;
    width: 100%;
    text-align: center;
    padding: 18px 20px;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-subtle);
    transition: all var(--transition-fast);
}

.nav-links a:hover,
.nav-links a:focus {
    color: var(--primary);
    background: rgba(0, 242, 255, 0.05);
}

.nav-links .btn {
    margin-top: 20px;
    width: 100%;
    max-width: 300px;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 100px 20px 60px;
    position: relative;
    overflow: hidden;
    /* Ensure video doesn't overflow */
    background: var(--bg-dark);
    /* Fallback */
}

/* Remove old pseudo-element background if it exists, or just don't include it. 
   We are replacing lines 364-371 which was .hero::before 
*/

.video-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.video-background video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
    /* vital for mobile responsiveness */
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    /* Black mask for readability */
    z-index: 1;
}

.hero h1 {
    margin-bottom: 1rem;
}

.hero h1 span {
    background: linear-gradient(135deg, var(--primary) 0%, #00a8ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    max-width: 600px;
    margin: 0 auto 2rem;
    color: var(--text-secondary);
}

/* Filter Bar */
.filter-bar {
    background: var(--card-bg);
    padding: 20px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    margin: 30px auto;
    max-width: 900px;
}

.filter-bar form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Form Controls */
.form-control {
    width: 100%;
    padding: 14px 18px;
    min-height: 50px;
    font-size: 1rem;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    -webkit-appearance: none;
    appearance: none;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(0, 242, 255, 0.05);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-control::placeholder {
    color: var(--text-muted);
}

select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23a1a1aa' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

/* Trainer Cards */
.trainer-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    transition: all var(--transition-slow);
}

.trainer-card:hover {
    transform: translateY(-6px);
    border-color: var(--primary);
    box-shadow: 0 20px 50px rgba(0, 242, 255, 0.15);
}

.trainer-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

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

.trainer-info {
    padding: 20px;
}

.trainer-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.rating {
    color: #fbbf24;
    display: flex;
    align-items: center;
    gap: 4px;
}

.trainer-name {
    font-size: 1.25rem;
    margin-bottom: 8px;
}

/* Steps / How It Works */
.steps-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    margin-top: 40px;
}

.step-card {
    text-align: center;
    padding: 32px 20px;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    transition: all var(--transition-normal);
}

.step-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
}

.step-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--primary);
    background: rgba(0, 242, 255, 0.1);
    border-radius: 50%;
}

/* Auth Forms */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 20px 40px;
}

.auth-form {
    width: 100%;
    max-width: 420px;
    padding: 32px 24px;
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-subtle);
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Dashboard */
.dashboard-section {
    padding: 100px 16px 40px;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    padding: 24px;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
}

.stat-card h4 {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.stat-card .value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

/* Profile Header */
.profile-header {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 24px;
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-subtle);
    margin-bottom: 40px;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto;
    border: 3px solid var(--border-subtle);
}

.profile-info {
    text-align: center;
}

.profile-info h1 {
    font-size: 1.75rem;
    margin-bottom: 8px;
}

.profile-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

/* Certification Badges */
.cert-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    justify-content: center;
}

.cert-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.cert-badge i {
    color: var(--accent);
}

/* Footer */
.footer {
    padding: 40px 20px;
    background: var(--bg-elevated);
    border-top: 1px solid var(--border-subtle);
    text-align: center;
}

.footer p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-primary {
    color: var(--primary) !important;
}

.mt-4 {
    margin-top: 1rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

/* Alerts / Messages */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

/* Tables - Responsive */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -16px;
    padding: 0 16px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

table th,
table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
}

table th {
    background: rgba(255, 255, 255, 0.03);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 2000;
    padding: 20px;
    overflow-y: auto;
}

.modal-overlay.active {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 80px;
}

.modal-content {
    width: 100%;
    max-width: 500px;
    background: var(--bg-elevated);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-subtle);
    padding: 28px 24px;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* ========================================
   TABLET BREAKPOINT (768px+)
   ======================================== */
@media (min-width: 768px) {
    .container {
        padding: 0 24px;
    }

    /* Grid */
    .grid-cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }

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

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

    /* Navbar */
    .menu-toggle {
        display: none;
    }

    .mobile-nav-action {
        display: none;
    }

    .nav-links {
        display: flex !important;
        position: static;
        background: none;
        backdrop-filter: none;
        flex-direction: row;
        padding: 0;
        gap: 32px;
        overflow: visible;
    }

    .nav-links a {
        width: auto;
        padding: 8px 0;
        font-size: 0.95rem;
        border: none;
    }

    .nav-links .btn {
        margin: 0;
        width: auto;
        padding: 10px 24px;
        min-height: auto;
    }

    /* Hero */
    .hero {
        padding: 120px 24px 80px;
    }

    /* Filter Bar */
    .filter-bar form {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
    }

    .filter-bar .form-control {
        flex: 1;
        min-width: 150px;
    }

    .filter-bar .btn {
        flex-shrink: 0;
    }

    /* Trainer Cards */
    .trainer-img {
        height: 260px;
    }

    /* Steps */
    .steps-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Stats */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Profile */
    .profile-header {
        flex-direction: row;
        align-items: flex-start;
        padding: 32px;
        gap: 32px;
    }

    .profile-avatar {
        width: 160px;
        height: 160px;
        margin: 0;
    }

    .profile-info {
        text-align: left;
        flex: 1;
    }

    .profile-actions {
        flex-direction: row;
    }

    .cert-badges {
        justify-content: flex-start;
    }

    /* Auth */
    .auth-form {
        padding: 40px 32px;
    }
}

/* ========================================
   DESKTOP BREAKPOINT (1024px+)
   ======================================== */
@media (min-width: 1024px) {
    .container {
        padding: 0 32px;
    }

    /* Grid */
    .grid-cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }

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

    .grid {
        gap: 30px;
    }

    /* Stats */
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    /* Profile */
    .profile-avatar {
        width: 200px;
        height: 200px;
    }

    .profile-info h1 {
        font-size: 2.25rem;
    }
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* Smooth scroll fix for fixed header */
html {
    scroll-padding-top: 80px;
}

/* Focus visible for accessibility */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Hide scrollbar but allow scrolling */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}