/* Design System & Variables */
:root {
    /* Colors - Sunset Theme */
    --bg-dark: #040F0F;
    --bg-card: #0F1F1E;
    --bg-card-glass: rgba(15, 31, 30, 0.6);
    --bg-card-glass-strong: rgba(15, 31, 30, 0.85);

    /* Brand Colors */
    --primary: #F97316;
    /* Sunset Orange */
    --secondary: #EAB308;
    /* Sun Gold */
    --accent: #14B8A6;
    /* Teal Arc */
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;

    /* Text */
    --text-main: #FFFFFF;
    --text-muted: #94A3B8;
    --text-dim: #64748B;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #F97316 0%, #EAB308 100%);
    --gradient-secondary: linear-gradient(135deg, #14B8A6 0%, #F97316 100%);
    --gradient-glow: radial-gradient(circle at top right, rgba(249, 115, 22, 0.15), transparent 40%),
        radial-gradient(circle at bottom left, rgba(20, 184, 166, 0.1), transparent 40%);
    --gradient-card-border: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02));

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 0.75rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2.5rem;

    /* Radius */
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 32px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(249, 115, 22, 0.4);
    --shadow-glow-secondary: 0 0 20px rgba(20, 184, 166, 0.3);

    /* Transitions */
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    background-image: var(--gradient-glow);
    background-attachment: fixed;
}

/* App Container */
#app {
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    max-width: 480px;
    margin: 0 auto;
    background: transparent;
    overflow: hidden;
}

#main-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-md);
    padding-bottom: 120px;
    /* Space for nav */
    scroll-behavior: smooth;
    /* Hide scrollbar */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#main-content::-webkit-scrollbar {
    display: none;
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-main);
}

h1 {
    font-size: 2.25rem;
    line-height: 1.1;
    margin-bottom: var(--space-sm);
}

h2 {
    font-size: 1.75rem;
    margin-bottom: var(--space-xs);
}

h3 {
    font-size: 1.25rem;
    margin-bottom: var(--space-xs);
}

p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.text-muted {
    color: var(--text-muted);
}

.text-dim {
    color: var(--text-dim);
}

/* Utilities */
.glass-card {
    background: var(--bg-card-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s var(--ease-smooth), box-shadow 0.2s var(--ease-smooth);
}

.glass-card:active {
    transform: scale(0.98);
}

/* Subtle gradient border effect */
.glass-card::before {
    background: var(--gradient-secondary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md) var(--space-xl);
    border-radius: var(--radius-full);
    border: none;
    font-family: inherit;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s var(--ease-spring);
    gap: 8px;
}

.btn:active {
    transform: scale(0.95);
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-glow);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
    box-shadow: 0 0 30px rgba(255, 0, 128, 0.6);
}

.btn-check {
    width: 100%;
    margin-top: var(--space-md);
    width: 0%;
    transition: width 1s cubic-bezier(0.4, 0.0, 0.2, 1);
    box-shadow: var(--shadow-glow-secondary);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#main-content>* {
    animation: fadeIn 0.4s ease-out forwards;
}

/* Navigation */
.glass-nav {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    background: rgba(20, 20, 20, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: var(--radius-full);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    z-index: 100;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    padding: 16px 0;
    height: 80px;
}

.nav-item {
    background: none;
    border: none;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.3s var(--ease-spring);
    position: relative;
    width: 60px;
}

.nav-item i {
    font-size: 1.5rem;
    transition: all 0.3s var(--ease-spring);
}

.nav-item span {
    font-size: 0.7rem;
    font-weight: 500;
    opacity: 0;
    transform: translateY(5px);
    transition: all 0.3s var(--ease-spring);
    position: absolute;
    bottom: -18px;
}

.nav-item.active {
    color: var(--text-main);
}

.nav-item.active i {
    transform: translateY(-8px);
    color: var(--accent);
    filter: drop-shadow(0 0 10px var(--shadow-glow-secondary));
}

.nav-item.active span {
    opacity: 1;
    transform: translateY(0);
    color: var(--accent);
}

.activity-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--primary);
}

.activity-info {
    flex: 1;
}

.activity-info h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
}

.activity-info p {
    margin: 2px 0 0 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.activity-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
    padding-top: var(--space-sm);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.metric-item {
    display: flex;
    flex-direction: column;
}

.metric-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-top: 2px;
}

.metric-unit {
    font-size: 0.8rem;
    font-weight: normal;
    color: var(--text-muted);
    margin-left: 2px;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.week-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: var(--space-lg) 0 var(--space-sm) 0;
}

.week-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-main);
}

.phase-badge {
    font-size: 0.75rem;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* FAB */
.fab {
    position: fixed;
    bottom: 100px;
    right: var(--space-lg);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    border: none;
    box-shadow: var(--shadow-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    cursor: pointer;
    z-index: 90;
    transition: transform 0.2s var(--ease-spring);
}

.fab:active {
    transform: scale(0.9);
}

/* Strava-like Activity Cards */
.activity-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.run-grid .activity-card {
    height: 100%;
}

.run-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

@media (max-width: 480px) {
    .run-grid {
        grid-template-columns: 1fr;
    }
}

.card-subtitle {
    font-size: 0.85rem;
    color: var(--accent);
    margin-bottom: 4px;
    font-weight: 500;
}

.card-description {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 8px;
}

.activity-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--primary);
}

.activity-info {
    flex: 1;
}

.activity-info h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
}

.activity-info p {
    margin: 2px 0 0 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.activity-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
    padding-top: var(--space-sm);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.metric-item {
    display: flex;
    flex-direction: column;
}

.metric-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-top: 2px;
}

.metric-unit {
    font-size: 0.8rem;
    font-weight: normal;
    color: var(--text-muted);
    margin-left: 2px;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.week-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: var(--space-lg) 0 var(--space-sm) 0;
}

.week-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-main);
}

.phase-badge {
    font-size: 0.75rem;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* FAB */
.fab {
    position: fixed;
    bottom: 100px;
    right: var(--space-lg);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    border: none;
    box-shadow: var(--shadow-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    cursor: pointer;
    z-index: 90;
    transition: transform 0.2s var(--ease-spring);
}

.fab:active {
    transform: scale(0.9);
}

/* Strava-like Activity Cards */
.activity-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.run-grid .activity-card {
    height: 100%;
}

.run-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

@media (max-width: 480px) {
    .run-grid {
        grid-template-columns: 1fr;
    }
}

.card-subtitle {
    font-size: 0.85rem;
    color: var(--accent);
    margin-bottom: 4px;
    font-weight: 500;
}

.card-description {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 8px;
}

.intensity-badge {
    display: inline-block;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    text-transform: uppercase;
    margin-top: 8px;
}

/* Modal & Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 2000;
}

.overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--bg-card);
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 400px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-md);
    transform: translateY(20px);
    transition: transform 0.3s var(--ease-spring);
    position: relative;
}

.overlay.active .modal {
    transform: translateY(0);
}

/* Form Elements */
.form-group {
    margin-bottom: var(--space-md);
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.1);
}