/* Base Styles using Variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-stack);
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow-x: hidden;
    height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
}

#app {
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    max-width: 100%;
    margin: 0 auto;
}

#view-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    padding-bottom: 80px;
    /* Mobile safe area */
    width: 100%;
}

/* Utilities */
.hidden {
    display: none !important;
}

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

.text-white {
    color: #FFFFFF;
}

.text-green {
    color: var(--brand-green);
}

.view {
    min-height: 100%;
    width: 100%;
    padding: 24px;
    /* Increased Padding */
    animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 600px;
    /* Mobile constraint default */
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

/* Typography */
h1 {
    font-size: 40px;
    font-weight: 700;
    letter-spacing: -1px;
}

h2 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--text-primary);
}

h3 {
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 12px;
}

p {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Button Refinements - Crisp & Futuristic */
.btn {
    padding: 16px 32px;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: scale(0.98);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.btn-primary {
    background: linear-gradient(135deg, #E53E2A 0%, #d63626 100%);
    color: #FFFFFF;
    border: 1px solid rgba(229, 62, 42, 0.3);
    box-shadow: 0 4px 16px rgba(229, 62, 42, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(229, 62, 42, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-green {
    background: linear-gradient(135deg, #00AEB3 0%, #009499 100%);
    color: #FFFFFF;
    border: 1px solid rgba(0, 174, 179, 0.3);
    box-shadow: 0 4px 16px rgba(0, 174, 179, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-green:hover {
    box-shadow: 0 6px 20px rgba(0, 174, 179, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.05);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn.small {
    padding: 10px 20px;
    width: auto;
    font-size: 13px;
    border-radius: 10px;
    text-transform: none;
    letter-spacing: 0.5px;
}

/* Inputs - Enhanced Visibility */
.input-group {
    margin-bottom: 24px;
}

.input-group label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.input-group input {
    width: 100%;
    padding: 16px 18px;
    background-color: var(--surface-color);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-m);
    color: var(--text-primary);
    font-size: 15px;
    transition: all 0.2s ease;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.input-group input:focus {
    outline: none;
    border-color: var(--brand-green);
    box-shadow: 0 0 0 3px rgba(0, 174, 179, 0.15),
        inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* LANDING VIEW RE-DESIGN */
.landing-view {
    padding: 0;
    width: 100vw;
    height: 100vh;
    position: fixed;
    /* Ensures no scroll and full coverage */
    top: 0;
    left: 0;
    overflow: hidden;
    max-width: 100%;
}

.landing-bg {
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(10, 10, 10, 0.1) 0%, rgba(10, 10, 10, 0.8) 100%),
        url('../assets/landing_background_futuristic_gym.png') no-repeat center center / cover;
    display: flex;
    flex-direction: column;
}

.landing-content-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    /* Push to bottom */
    padding: 40px 24px;
    z-index: 2;
}

.logo-area {
    margin-bottom: auto;
    /* Pushes everything else down */
    margin-top: 5vh;
    /* Moved Up Significantly */
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.brand-title {
    display: inline-flex;
    gap: 8px;
    font-size: 48px;
    /* Bigger Font (Was 36px) */
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    position: relative;
    padding-bottom: 20px;
    /* Space for zigzag */
}

/* Zigzag Removed per feedback */
/*
.brand-title::after {
    content: '';
    position: absolute;
    bottom: 0px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 15px;
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='12' viewBox='0 0 40 12' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 12 L10 2 L20 12 L30 2 L40 12' fill='none' stroke='%2300AEB3' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: repeat-x;
    background-size: 40px 12px;
    filter: drop-shadow(0 0 10px rgba(0, 174, 179, 1));
}
*/

.spacer {
    flex: 0.5;
}

/* Adjusts vertical positioning */

.auth-buttons {
    display: flex;
    flex-direction: column;
    /* Stack vertically on mobile */
    gap: 16px;
    width: 100%;
    margin-bottom: 40px;
    /* Space from bottom edge */
}

.btn-secondary-glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    /* Stronger border */
    color: #FFFFFF;
}

.btn-secondary-glass:active {
    background: rgba(255, 255, 255, 0.2);
}

/* Hide old Landing content wrappers */
.landing-content {
    display: none;
}

/* LOGIN VIEW */
.login-view {
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Center vertically */
    padding: 40px 32px;
    height: 100%;
}

.view-header {
    width: 100%;
    margin-bottom: 40px;
}

.login-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 30px;
    text-align: center;
    width: 100%;
}

.form-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 24px;
    /* Space between input and button */
}

#login-btn {
    margin-top: 10px;
    max-width: 200px;
    /* "Normal size" - not full width */
    align-self: center;
    /* Center the button */
}

/* HOME VIEW */
.home-view {
    padding-top: 60px;
    /* Bring everything down */
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.header-section {
    margin-bottom: 20px;
}

.greeting-label {
    font-size: 16px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.greeting-name {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
    display: block;
}


/* DESKTOP LANDING OVERRIDES */
@media (min-width: 1024px) {
    .landing-view {
        border-radius: var(--radius-l);
        border: 1px solid var(--border-color);
    }

    .landing-content-wrapper {
        align-items: center;
        justify-content: center;
        padding-bottom: 80px;
    }

    .auth-buttons {
        width: auto;
        gap: 20px;
    }

    .btn-secondary-glass,
    .btn-green {
        width: 200px;
        /* Fixed width for consistency */
        flex: none;
    }

    /* Login Page Desktop Center */
    .login-view {
        margin: auto;
        height: auto;
        min-height: 600px;
    }
}

/* LOGIN VIEW - Specifics handled in main block above, removing redundant */
.back-btn-styled {
    position: absolute;
    top: 40px;
    left: 24px;
    background: none;
    border: none;
    color: var(--text-secondary);
    display: flex;
    flex-direction: row;
    /* Horizontal */
    align-items: center;
    gap: 8px;
    cursor: pointer;
    opacity: 0.8;
}

.back-btn-styled:hover {
    opacity: 1;
    transform: translateY(-2px);
}

.back-btn-styled .arrow {
    font-size: 20px;
}

.back-btn-styled .text {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
}

/* HOME VIEW */
.dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 30px;
    flex: 1;
}

.greeting .highlight {
    color: var(--primary-color);
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.stats-card {
    background: linear-gradient(135deg, var(--surface-color) 0%, var(--surface-light) 100%);
    border: 1px solid var(--border-color);
    padding: 30px;
    border-radius: var(--radius-l);
    margin-top: 10px;
    /* Push down slightly */
}

.stats-card .count {
    font-size: 56px;
    color: var(--brand-green);
    font-weight: 700;
    display: block;
    margin-bottom: 8px;
}

/* BOOK VIEW */
.calendar-strip {
    display: flex;
    gap: 12px;
    margin-bottom: 40px;
    padding: 10px 0;
    overflow-x: auto;
}

.calendar-strip::-webkit-scrollbar {
    display: none;
}

.day {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 18px;
    border-radius: 16px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    cursor: pointer;
    min-width: 60px;
    transition: all 0.2s;
}

.day:hover {
    border-color: var(--primary-color);
}

.day.active {
    background: var(--brand-green);
    border-color: var(--brand-green);
    color: #FFFFFF;
    box-shadow: 0 4px 15px rgba(0, 174, 179, 0.4);
}

.class-card {
    background: var(--surface-color);
    padding: 24px;
    border-radius: var(--radius-m);
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid var(--brand-green);
    /* Green Accent */
}

.btn-add {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--surface-light);
    color: var(--primary-color);
    border: 1px solid var(--border-color);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-add:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* CLASSES VIEW */
.tabs {
    background: var(--surface-color);
    padding: 8px;
    border-radius: 12px;
    gap: 8px;
    margin-bottom: 30px;
}

.tab {
    padding: 12px;
    border-radius: 8px;
    flex: 1;
    text-align: center;
    color: var(--text-secondary);
    transition: 0.2s;
    cursor: pointer;
    font-weight: 600;
}

.tab.active {
    background: var(--surface-light);
    color: var(--brand-green);
}

.tab-past {
    color: var(--text-secondary);
    opacity: 0.7;
}

/* ACCOUNT VIEW */
.profile-header {
    background: var(--surface-color);
    padding: 30px;
    border-radius: var(--radius-l);
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: 1px solid var(--border-color);
}

.avatar-large {
    width: 80px;
    height: 80px;
    background: var(--surface-light);
    border-radius: 50%;
    border: 2px solid var(--brand-green);
    color: var(--brand-green);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 16px;
}

.member-status {
    color: var(--brand-green);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 8px;
}

.btn-edit {
    background: none;
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 20px;
    color: var(--text-secondary);
    margin-top: 16px;
    cursor: pointer;
}

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

.setting-card {
    background: var(--surface-color);
    padding: 24px;
    border-radius: var(--radius-m);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: 0.2s;
    border: 1px solid transparent;
}

.setting-card:hover {
    border-color: var(--brand-green);
    transform: translateY(-2px);
}

.icon-box {
    font-size: 24px;
}

.logout-btn {
    color: #E53E2A;
    border-color: rgba(229, 62, 42, 0.3);
}

/* NAVIGATION - Futuristic & Crisp Design */
#bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 85px;
    background: linear-gradient(180deg, rgba(10, 10, 10, 0.95) 0%, rgba(10, 10, 10, 0.98) 100%);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-top: 1px solid rgba(0, 174, 179, 0.15);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
    padding: 8px 16px 20px 16px;
}

.nav-item {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    padding: 10px 14px;
    border-radius: 16px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.8);
}

/* Active State - Futuristic Pill Design */
.nav-item.active {
    background: linear-gradient(135deg, rgba(0, 174, 179, 0.2) 0%, rgba(0, 174, 179, 0.1) 100%);
    color: var(--brand-green);
    border: 1px solid rgba(0, 174, 179, 0.4);
    box-shadow: 0 0 20px rgba(0, 174, 179, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.nav-item.active svg {
    filter: drop-shadow(0 0 8px rgba(0, 174, 179, 0.8));
    fill: var(--brand-green);
    stroke: var(--brand-green);
}

.nav-item svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
    stroke: currentColor;
    stroke-width: 0.5;
    transition: all 0.3s ease;
}

/* Bigger Icons */

/* -------------------------------------------------------------------------- */
/* DESKTOP / TABLET RESPONSIVE OVERRIDES                                      */
/* -------------------------------------------------------------------------- */
@media (min-width: 1024px) {
    body {
        flex-direction: row;
    }

    #app {
        flex-direction: row;
        max-width: 1400px;
        padding: 20px;
        gap: 20px;
    }

    /* DESKTOP NAV OVERRIDES */
    #bottom-nav {
        position: relative;
        width: 260px;
        height: auto;
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        background: var(--surface-color);
        border: 1px solid var(--border-color);
        padding: 40px 30px;
        bottom: auto;
        left: auto;
        gap: 16px;
        order: -1;
        /* MOVES NAV TO THE LEFT on visual display */
    }

    #bottom-nav::before {
        content: inherit;
        display: none;
        /* Remove pseudo, we'll use HTML logo */
    }

    .nav-item {
        flex-direction: row;
        width: 100%;
        padding: 14px 20px;
        justify-content: flex-start;
        border-radius: 12px;
        gap: 12px;
    }

    .nav-item:hover {
        background: rgba(255, 255, 255, 0.05);
    }

    .nav-item.active {
        background: linear-gradient(135deg, rgba(0, 174, 179, 0.2) 0%, rgba(0, 174, 179, 0.1) 100%);
        color: var(--brand-green);
        border: 1px solid rgba(0, 174, 179, 0.4);
        box-shadow: 0 0 20px rgba(0, 174, 179, 0.2),
            inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }

    /* DESKTOP BUTTONS */
    .auth-buttons {
        flex-direction: row;
        /* Side by side on desktop */
        width: auto;
    }

    .btn-secondary-glass,
    .btn-green {
        width: 180px;
        /* Fixed width */
    }

    #view-container {
        flex: 1;
        background: var(--surface-color);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-l);
        padding: 0;
        display: flex;
        overflow-y: auto;
        overflow-x: hidden;
        position: relative;
        width: 100%;
    }

    .view {
        max-width: 100%;
        padding: 40px;
        animation: none;
    }

    /* Home Desktop */
    .home-view {
        display: grid;
        grid-template-columns: 350px 1fr;
        grid-template-rows: auto 1fr;
        gap: 40px;
    }

    .header-section {
        grid-column: 1 / -1;
        margin-top: 0;
    }

    .dashboard-grid {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: 350px 1fr;
        gap: 40px;
    }

    .stats-card {
        height: 100%;
    }

    /* Account Desktop */
    .account-view {
        display: grid;
        grid-template-columns: 350px 1fr;
        gap: 40px;
        align-items: start;
    }

    .profile-header {
        height: 100%;
        margin: 0;
        justify-content: center;
    }

    .settings-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}