/* GetFIT-Connect Styles */

:root,
[data-theme="dark"] {
    /* Brand */
    --brand: #ff8a3d;
    --brand-rgb: 255, 138, 61;
    --brand-dark: #f2661a;
    --accent: #8b5cf6;
    --accent-rgb: 139, 92, 246;
    --accent-dark: #7c3aed;

    /* Legacy aliases (kept so any old var() references still resolve) */
    --primary: var(--brand);
    --primary-dark: var(--brand-dark);
    --secondary: var(--accent);
    --secondary-dark: #6a1b9a;
    --white: #ffffff;

    /* Surfaces */
    --bg-rgb: 8, 9, 14;
    --bg: rgb(8, 9, 14);
    --bg-elevated: #15121c;
    --bg-gradient: linear-gradient(135deg, #08090e 0%, #17111f 100%);
    --panel-rgb: 10, 8, 14;
    --card: rgba(255, 255, 255, 0.05);
    --card-hover: rgba(255, 255, 255, 0.08);
    --border: rgba(var(--brand-rgb), 0.25);

    /* Text */
    --text: #f4f1ea;
    --text-muted: #b9bdc9;
    --text-faint: #8b8fa3;
    --muted-foreground: rgba(255, 255, 255, 0.65);

    /* Status */
    --success: #22c55e;
    --success-rgb: 34, 197, 94;
    --danger: #ef4444;
    --danger-rgb: 239, 68, 68;
    --warning: #f59e0b;

    --shadow-color: 0, 0, 0;
}

[data-theme="light"] {
    --brand: #e05e0f;
    --brand-rgb: 224, 94, 15;
    --brand-dark: #c44f0b;
    --accent: #7c3aed;
    --accent-rgb: 124, 58, 237;
    --accent-dark: #6425c9;

    --primary: var(--brand);
    --primary-dark: var(--brand-dark);
    --secondary: var(--accent);
    --secondary-dark: #6a1b9a;
    --white: #ffffff;

    --bg-rgb: 246, 247, 251;
    --bg: #f6f7fb;
    --bg-elevated: #ffffff;
    --bg-gradient: linear-gradient(135deg, #f6f7fb 0%, #eef0f8 100%);
    --panel-rgb: 255, 255, 255;
    --card: rgba(20, 15, 40, 0.035);
    --card-hover: rgba(20, 15, 40, 0.065);
    --border: rgba(20, 15, 40, 0.12);

    --text: #1a1d29;
    --text-muted: #565c6e;
    --text-faint: #767c8d;
    --muted-foreground: rgba(26, 29, 41, 0.65);

    --success: #16a34a;
    --success-rgb: 22, 163, 74;
    --danger: #dc2626;
    --danger-rgb: 220, 38, 38;
    --warning: #d97706;

    --shadow-color: 20, 15, 40;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background: var(--bg-gradient);
    color: var(--text);
    min-height: 100vh;
    transition: background 0.25s ease, color 0.25s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: rgba(var(--panel-rgb), 0.95);
    border-bottom: 2px solid var(--brand);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

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

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--brand);
    text-decoration: none;
    text-shadow: 0 0 20px rgba(var(--brand-rgb), 0.5);
}

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

.nav a {
    color: var(--brand);
    text-decoration: none;
    transition: all 0.3s;
    font-weight: 500;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-outline {
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
    font-weight: 600;
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: #000;
    box-shadow: 0 0 20px rgba(var(--brand-rgb), 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(var(--brand-rgb), 0.6);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: #fff;
    box-shadow: 0 0 20px rgba(var(--accent-rgb), 0.4);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(var(--accent-rgb), 0.6);
}

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

.btn-outline:hover {
    background: var(--brand);
    color: #000;
}

/* Hero Section */
.hero {
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('images/hero-gym.jpg') center/cover;
    padding: 6rem 0;
    text-align: center;
    min-height: 70vh;
    display: flex;
    align-items: center;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    color: var(--brand);
    text-shadow: 0 0 30px rgba(var(--brand-rgb), 0.6);
}

.hero p {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    color: var(--text-muted);
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Sections */
.features, .pricing {
    padding: 5rem 0;
}

.features h2, .pricing h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--brand);
    text-shadow: 0 0 20px rgba(var(--brand-rgb), 0.3);
}

.feature-grid, .pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card, .pricing-card {
    background: rgba(var(--panel-rgb), 0.8);
    padding: 2rem;
    border-radius: 12px;
    border: 2px solid var(--brand);
    transition: all 0.3s;
    box-shadow: 0 0 20px rgba(var(--brand-rgb), 0.2);
}

.feature-card:hover, .pricing-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 0 40px rgba(var(--brand-rgb), 0.4);
    border-color: var(--accent);
}

.feature-card h3, .pricing-card h3 {
    color: var(--brand);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.pricing-card .price {
    font-size: 2rem;
    color: var(--accent);
    margin: 1rem 0;
    font-weight: bold;
}

.pricing-card ul {
    list-style: none;
    margin: 1.5rem 0;
}

.pricing-card ul li {
    padding: 0.5rem 0;
    color: var(--text-muted);
}

.pricing-card ul li:before {
    content: "✓ ";
    color: var(--success);
    font-weight: bold;
}

/* Footer */
.footer {
    background: var(--secondary);
    color: var(--white);
    padding: 3rem 0 1rem;
}

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

.footer-section h4 {
    margin-bottom: 1rem;
    color: var(--primary);
}

.footer-section a {
    display: block;
    color: var(--white);
    text-decoration: none;
    margin: 0.5rem 0;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.footer-section a:hover {
    opacity: 1;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-bottom a {
    color: var(--white);
    text-decoration: none;
    opacity: 0.8;
}

/* Forms */
.form-container {
    max-width: 500px;
    margin: 3rem auto;
    padding: 2.5rem;
    background: rgba(var(--panel-rgb), 0.9);
    border-radius: 12px;
    border: 2px solid var(--brand);
    box-shadow: 0 0 40px rgba(var(--brand-rgb), 0.3);
}

.form-container h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--brand);
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--brand);
    font-weight: 600;
}

.form-group input, .form-group select, .form-group textarea, .form-control {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid var(--border);
    border-radius: 6px;
    background: var(--bg-elevated);
    color: var(--text);
    font-size: 1rem;
    transition: background 0.25s ease, color 0.25s ease, border-color 0.2s ease;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus, .form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.3);
}

.location-status {
    text-align: center;
    padding: 1rem;
    margin: 1rem 0;
    background: rgba(var(--brand-rgb), 0.1);
    border-radius: 6px;
    border: 1px solid var(--brand);
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.alert-error {
    background: rgba(var(--danger-rgb), 0.2);
    border: 1px solid var(--danger);
    color: var(--danger);
}

.alert-success {
    background: rgba(var(--success-rgb), 0.2);
    border: 1px solid var(--success);
    color: var(--success);
}

/* Footer */
.footer {
    background: rgba(var(--panel-rgb), 0.95);
    border-top: 2px solid var(--brand);
    padding: 3rem 0;
    margin-top: 5rem;
}

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

.footer h4 {
    color: var(--brand);
    margin-bottom: 1rem;
}

.footer a {
    color: var(--text-muted);
    text-decoration: none;
    display: block;
    margin: 0.5rem 0;
    transition: color 0.3s;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .feature-grid, .pricing-grid {
        grid-template-columns: 1fr;
    }
    
    .form-container {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .dashboard-nav {
        gap: 0.5rem;
    }
    
    .dashboard-nav a {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
    
    .trainers-grid {
        grid-template-columns: 1fr;
    }
    
    .nav {
        gap: 1rem;
    }
    
    .header .container {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    table {
        font-size: 0.85rem;
    }
    
    table th, table td {
        padding: 0.5rem;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.4rem;
    }
    
    .btn-primary, .btn-secondary, .btn-outline {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    .card h3 {
        font-size: 1.4rem;
    }
}

/* Dashboard Styles */
.dashboard {
    min-height: 100vh;
    background: var(--bg-gradient);
}

.dashboard-header {
    background: linear-gradient(180deg, rgba(var(--panel-rgb), 0.98) 0%, rgba(var(--panel-rgb), 0.95) 100%);
    border-bottom: 3px solid var(--brand);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 30px rgba(var(--brand-rgb), 0.2);
}

.dashboard-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand-logo {
    text-decoration: none;
}

.brand-logo h1 {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 50%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    text-shadow: none;
    letter-spacing: -1px;
}

.brand-logo .tagline {
    font-size: 0.7rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: -2px;
    opacity: 0.9;
}

.user-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-section .user-name {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.user-section .user-id {
    color: var(--brand);
    font-weight: 600;
    font-size: 0.85rem;
}

/* Burger Menu */
.burger-menu {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

.burger-menu span {
    width: 25px;
    height: 3px;
    background: var(--brand);
    margin: 3px 0;
    border-radius: 2px;
    transition: all 0.3s;
}

.burger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.burger-menu.active span:nth-child(2) {
    opacity: 0;
}

.burger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

.dashboard-nav {
    display: flex;
    gap: 0.7rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 0.6rem 0.1rem 0.85rem;
    border-top: 1px solid rgba(var(--accent-rgb), 0.2);
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    mask-image: linear-gradient(to right, transparent 0, black 12px, black calc(100% - 12px), transparent 100%);
}

.dashboard-nav::-webkit-scrollbar {
    display: none;
}

.dashboard-nav a {
    position: relative;
    flex-shrink: 0;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 78px;
    color: var(--text);
    text-decoration: none;
    padding: 0.85rem 0.5rem 0.7rem;
    border-radius: 18px;
    background: var(--card);
    border: 1px solid var(--border);
    box-shadow: 0 3px 10px rgba(var(--shadow-color), 0.3);
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    font-weight: 600;
    font-size: 0.68rem;
    line-height: 1.1;
    white-space: nowrap;
    text-align: center;
}

.nav-card-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(var(--brand-rgb), 0.12);
    font-size: 1.25rem;
    transition: background 0.2s ease, transform 0.2s ease;
}

.dashboard-nav a:hover {
    background: var(--card-hover);
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 8px 18px rgba(var(--accent-rgb), 0.25);
}

.dashboard-nav a:hover .nav-card-icon {
    transform: scale(1.08);
}

.dashboard-nav a:active {
    transform: translateY(-1px) scale(0.97);
}

.dashboard-nav a.active {
    background: linear-gradient(160deg, rgba(var(--brand-rgb), 0.22) 0%, rgba(var(--accent-rgb), 0.22) 100%);
    color: #fff;
    box-shadow: 0 6px 20px rgba(var(--brand-rgb), 0.3);
    border-color: var(--brand);
    transform: translateY(-2px);
}

.dashboard-nav a.active .nav-card-icon {
    background: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%);
    box-shadow: 0 0 14px rgba(var(--brand-rgb), 0.5);
}

.nav-badge {
    position: absolute;
    top: 4px;
    right: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 0 0 2px rgba(var(--shadow-color), 0.5);
}

.nav-card-label {
    opacity: 0.95;
}

.dashboard-content {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

/* Mobile Navigation */
@media (max-width: 768px) {
    .burger-menu {
        display: none;
    }

    .dashboard-nav a {
        width: 68px;
        padding: 0.7rem 0.4rem 0.55rem;
        font-size: 0.62rem;
    }

    .nav-card-icon {
        width: 34px;
        height: 34px;
        font-size: 1.1rem;
    }

    .brand-logo h1 {
        font-size: 1.5rem;
    }
    
    .brand-logo .tagline {
        font-size: 0.6rem;
        letter-spacing: 1px;
    }
    
    .user-section .user-name {
        display: none;
    }
    
    .dashboard-header {
        position: relative;
    }
}

.card {
    background: rgba(var(--panel-rgb), 0.8);
    padding: 2rem;
    border-radius: 12px;
    border: 2px solid var(--brand);
    margin-bottom: 2rem;
    box-shadow: 0 0 20px rgba(var(--brand-rgb), 0.2);
}

.card h3, .card h4 {
    color: var(--brand);
    margin-bottom: 1rem;
}

.card p {
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

/* Table Styles */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.table thead {
    background: rgba(var(--accent-rgb), 0.2);
}

.table th {
    padding: 1rem;
    text-align: left;
    color: var(--brand);
    font-weight: 600;
    border-bottom: 2px solid var(--accent);
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(var(--brand-rgb), 0.2);
    color: var(--text-muted);
}

.table tr:hover {
    background: rgba(var(--accent-rgb), 0.1);
}

/* Badge Styles */
.badge {
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
}

.badge-success {
    background: rgba(var(--success-rgb), 0.2);
    color: var(--success);
    border: 1px solid var(--success);
}

.badge-warning {
    background: rgba(var(--brand-rgb), 0.2);
    color: var(--brand);
    border: 1px solid var(--brand);
}

/* Trainer Card Styles */
.trainers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
}

.trainer-card {
    background: rgba(var(--panel-rgb), 0.9);
    border: 2px solid var(--brand);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
    box-shadow: 0 0 20px rgba(var(--brand-rgb), 0.2);
}

.trainer-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 40px rgba(var(--accent-rgb), 0.4);
    border-color: var(--accent);
}

.trainer-photo, .trainer-photo-placeholder {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.trainer-photo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
}

.trainer-info {
    padding: 1.5rem;
}

.trainer-info h4 {
    color: var(--brand);
    margin-bottom: 0.5rem;
    font-size: 1.4rem;
}

.trainer-info .gym-name,
.trainer-info .specialization,
.trainer-info .distance {
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.trainer-info .distance {
    color: var(--accent);
    font-weight: 600;
}

.trainer-info .bio {
    color: var(--text-faint);
    margin: 1rem 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* =====================================================================
   Theme toggle (floating button, injected by theme-toggle.js on every page)
   ===================================================================== */
.gf-theme-toggle {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    z-index: 2000;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(var(--shadow-color), 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.25s ease;
}

.gf-theme-toggle:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 10px 28px rgba(var(--shadow-color), 0.45);
}

.gf-theme-toggle svg {
    width: 24px;
    height: 24px;
}

/* =====================================================================
   PWA install banner (injected by theme-toggle.js after `beforeinstallprompt`)
   ===================================================================== */
.gf-install-banner {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1.25rem;
    z-index: 2100;
    max-width: 420px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 0.9rem 1rem;
    box-shadow: 0 12px 32px rgba(var(--shadow-color), 0.4);
    animation: gf-banner-in 0.35s ease;
}

@keyframes gf-banner-in {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.gf-install-banner img {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    flex-shrink: 0;
}

.gf-install-banner .gf-install-text {
    flex: 1;
    min-width: 0;
}

.gf-install-banner .gf-install-title {
    font-weight: 700;
    color: var(--text);
    font-size: 0.9rem;
    margin-bottom: 0.15rem;
}

.gf-install-banner .gf-install-sub {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.gf-install-banner button {
    border: none;
    border-radius: 8px;
    padding: 0.5rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}

.gf-install-banner .gf-install-btn {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: #000;
}

.gf-install-banner .gf-install-dismiss {
    background: transparent;
    color: var(--text-faint);
    padding: 0.5rem;
}

@media (max-width: 480px) {
    .gf-theme-toggle {
        width: 46px;
        height: 46px;
        bottom: 1rem;
        right: 1rem;
    }
    .gf-install-banner {
        left: 0.6rem;
        right: 0.6rem;
        bottom: 1rem;
        padding: 0.75rem 0.85rem;
    }
}
