/* 
    HIKARI GYM - Premium Design System
    Aesthetics: Aura Light Glassmorphism, Energetic Accents.
*/

:root {
    --gym-primary: #0284C7; /* Ocean blue for clear contrast in light mode */
    --gym-secondary: #0EA5E9; /* Energetic Cyan */
    --gym-accent: #F59E0B; /* Amber Orange */
    --gym-bg: #F0F9FF; /* Soft sky blue/white background - soothing and alive */
    --gym-card-bg: rgba(255, 255, 255, 0.85); /* Fresh light glass */
    --gym-text: #0F172A; /* Slate 900 for premium readability */
    --gym-text-muted: #475569; /* Slate 600 */
    --gym-border: rgba(2, 132, 199, 0.12); /* Soft sky blue accent border */
    --glass: rgba(255, 255, 255, 0.7); /* Transparent white */
    --font-main: 'Inter', sans-serif;
    --font-heading: 'Outfit', sans-serif;
}

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

body {
    background-color: var(--gym-bg);
    color: var(--gym-text);
    font-family: var(--font-main);
    overflow-x: hidden;
    line-height: 1.6;
    background: linear-gradient(135deg, #F0F9FF 0%, #E2E8F0 100%);
}

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

@keyframes glow {
    0% { box-shadow: 0 0 5px rgba(2, 132, 199, 0.1); }
    50% { box-shadow: 0 0 20px rgba(2, 132, 199, 0.2); }
    100% { box-shadow: 0 0 5px rgba(2, 132, 199, 0.1); }
}

/* Glassmorphism Classes */
.glass {
    background: var(--gym-card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 24px;
    box-shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.06),
                0 1px 3px rgba(15, 23, 42, 0.02);
}

/* Auth Pages Styling */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gym-bg);
    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 450px;
    padding: 40px;
    animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-header {
    text-align: center;
    margin-bottom: 40px;
}

.auth-header h1 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 10px;
}

.auth-header h1 span {
    color: var(--gym-primary);
}

.auth-header p {
    color: var(--gym-text-muted);
}

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

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

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper i {
    position: absolute;
    left: 15px;
    color: var(--gym-text-muted);
    transition: 0.3s;
}

.input-wrapper input {
    width: 100%;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 12px;
    padding: 14px 14px 14px 45px;
    color: var(--gym-text);
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}

.input-wrapper input:focus {
    border-color: var(--gym-primary);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.15);
}

.input-wrapper input:focus + i {
    color: var(--gym-primary);
}

/* Select and inputs fallback in light mode */
select {
    background: rgba(255, 255, 255, 0.8);
    color: var(--gym-text);
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 12px;
    padding: 12px;
    outline: none;
}
select option {
    background-color: #ffffff;
    color: var(--gym-text);
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--gym-primary), var(--gym-secondary));
    color: white;
    border: none;
    border-radius: 12px;
    padding: 15px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    margin-top: 10px;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.15);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(2, 132, 199, 0.25);
}

.btn-secondary {
    width: 100%;
    background: var(--glass);
    color: var(--gym-text);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    padding: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #ffffff;
    border-color: var(--gym-primary);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.btn-rent:hover {
    text-shadow: 0 0 10px rgba(2, 132, 199, 0.2);
}

/* Dashboard Styling */
.gym-layout {
    display: flex;
    min-height: 100vh;
    background: var(--gym-bg);
}

.gym-sidebar {
    width: 290px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(15, 23, 42, 0.08);
    padding: 35px 20px;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.gym-sidebar h1 {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--gym-text) 30%, var(--gym-primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gym-sidebar h1 span {
    background: linear-gradient(135deg, var(--gym-primary), var(--gym-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 900;
}

.gym-main {
    flex: 1;
    padding: 40px;
    background: transparent;
    overflow-y: auto;
    max-height: 100vh;
}

.gym-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.gym-card {
    padding: 30px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    /* overflow: hidden; removed to prevent dropdown clipping */
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(240, 249, 255, 0.85)) !important;
    border: 1px solid rgba(2, 132, 199, 0.1) !important;
    box-shadow: 0 15px 35px rgba(15, 23, 42, 0.04) !important;
    border-radius: 24px !important;
}

.gym-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0), rgba(2, 132, 199, 0.05), rgba(255,255,255,0));
    opacity: 0;
    transition: 0.6s ease;
    pointer-events: none;
    border-radius: inherit;
}

.gym-card:hover::before {
    opacity: 1;
}

.gym-card:hover {
    transform: translateY(-6px) !important;
    border-color: var(--gym-primary) !important;
    box-shadow: 0 25px 50px -12px rgba(2, 132, 199, 0.15) !important;
}

.gym-card h3 {
    font-family: var(--font-heading);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.1rem;
    color: var(--gym-text);
}

.gym-card h3 i {
    color: var(--gym-primary);
    background: rgba(2, 132, 199, 0.08);
    padding: 10px;
    border-radius: 12px;
    font-size: 1.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.gym-card:hover h3 i {
    transform: scale(1.1) rotate(6deg);
    background: rgba(2, 132, 199, 0.15);
    color: var(--gym-primary);
}

.gym-card .stat {
    font-family: var(--font-heading);
    font-size: 3.2rem !important;
    font-weight: 800;
    background: linear-gradient(135deg, var(--gym-text), var(--gym-text-muted));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 15px 0 5px 0;
    line-height: 1;
}

/* Responsiveness */
.mobile-toggle, .sidebar-close {
    display: none !important;
}

@media (max-width: 1024px) {
    .mobile-toggle {
        display: flex !important;
    }

    .sidebar-close {
        display: flex !important;
    }

    .gym-sidebar {
        position: fixed !important;
        top: 0 !important;
        left: -290px !important;
        height: 100vh !important;
        width: 290px !important;
        transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
        box-shadow: 25px 0 50px rgba(15, 23, 42, 0.15) !important;
        border-right: 1px solid rgba(15, 23, 42, 0.08) !important;
        border-bottom: none !important;
        padding-top: 80px !important; /* spacing for top close button */
        z-index: 1000 !important;
        background: #ffffff !important;
    }

    .gym-sidebar.mobile-open {
        left: 0 !important;
    }

    .gym-main {
        padding: 25px !important;
        max-height: none !important;
        width: 100% !important;
    }
    
    .gym-main > header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 15px !important;
    }
    
    .gym-main > header > div {
        width: 100% !important;
    }
    
    .gym-main > header > div:last-child {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 12px !important;
        width: 100% !important;
    }
}

@media (max-width: 480px) {
    .gym-grid,
    .metrics-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Navigation Sidebar */
nav {
    flex: 1;
    margin: 20px 0;
    overflow-y: auto;
    padding-right: 5px;
}

/* Thin Scrollbar for Nav */
nav::-webkit-scrollbar {
    width: 4px;
}
nav::-webkit-scrollbar-track {
    background: transparent;
}
nav::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, 0.1);
    border-radius: 10px;
}
nav::-webkit-scrollbar-thumb:hover {
    background: var(--gym-primary);
}

.gym-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gym-nav-item {
    margin: 0;
}

.gym-nav-link {
    color: var(--gym-text-muted);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 18px;
    border-radius: 14px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    font-size: 0.95rem;
    font-weight: 500;
    position: relative;
    border-left: 3px solid transparent;
}

.gym-nav-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
    transition: color 0.3s ease;
}

.gym-nav-link:hover {
    background: rgba(2, 132, 199, 0.05);
    color: var(--gym-primary);
    transform: translateX(4px);
}

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

.gym-nav-link.active {
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.08), rgba(2, 132, 199, 0.03));
    color: var(--gym-primary);
    font-weight: 600;
    border-left: 3px solid var(--gym-primary);
    box-shadow: 0 4px 15px rgba(2, 132, 199, 0.08);
}

.gym-nav-link.active i {
    color: var(--gym-primary);
}

.sidebar-footer {
    padding-top: 25px;
    border-top: 1px solid rgba(15, 23, 42, 0.05);
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(15, 23, 42, 0.02);
    border: 1px solid rgba(15, 23, 42, 0.05);
    padding: 12px;
    border-radius: 16px;
    transition: 0.3s;
}

.user-profile:hover {
    background: rgba(15, 23, 42, 0.05);
}

.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--gym-primary), var(--gym-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
}

