:root {
    --bg-color: #0b0c10;
    --panel-bg: rgba(26, 28, 35, 0.4);
    --panel-border: rgba(255, 255, 255, 0.08);
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --neon-cyan: #00f0ff;
    --neon-cyan-dim: rgba(0, 240, 255, 0.2);
    --neon-purple: #8b5cf6;
    --neon-danger: #ff2a5f;
    --neon-danger-dim: rgba(255, 42, 95, 0.2);
    --font-family: 'Inter', sans-serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-family);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
}

/* Background Animated Blobs */
.blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    animation: float 20s infinite ease-in-out alternate;
}
.blob-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(0,240,255,0.15) 0%, rgba(0,0,0,0) 70%);
    top: -10%;
    right: -10%;
}
.blob-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(139,92,246,0.1) 0%, rgba(0,0,0,0) 70%);
    bottom: -20%;
    left: -10%;
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-50px, 50px) scale(1.2); }
}

/* Layout */
.app-container {
    width: 100%;
    max-width: 480px; /* Mobile app feel */
    padding: 24px;
    padding-bottom: 90px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    z-index: 1;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}
.logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
    border-radius: 8px;
    box-shadow: 0 0 15px var(--neon-cyan-dim);
}
.logo h1 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 1px;
}
.logo span {
    color: var(--neon-cyan);
}
.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    background-image: url('https://images.unsplash.com/photo-1518310383802-640c2de311b2?auto=format&fit=crop&q=80&w=200&h=200');
    background-size: cover;
    background-position: center top;
}

/* Glass Panels */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--panel-border);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    display: none;
}
.glass-panel.active {
    display: block;
    animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.panel-header {
    margin-bottom: 32px;
}
.panel-header h2 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 8px;
}
.panel-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}
.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

/* Forms & Selection Grids */
.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 12px;
}
.mt-4 { margin-top: 24px; }
.mt-5 { margin-top: 32px; }
.mt-6 { margin-top: 40px; }
.w-100 { width: 100%; }

.selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}
#missed-selection {
    grid-template-columns: 1fr 1fr;
}
.grid-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.grid-item.active {
    background: var(--neon-cyan-dim);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.1);
}
.grid-item:hover:not(.active) {
    background: rgba(255, 255, 255, 0.08);
}
.grid-item span:last-child {
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
}
.grid-item .icon {
    font-size: 1.5rem;
}

/* Colors Utilities */
.text-neon { color: var(--neon-cyan); }
.text-neon-danger { color: var(--neon-danger); }
.text-highlight { color: #fff; font-weight: 600; }

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 16px;
    border-radius: 16px;
    border: none;
    background: linear-gradient(135deg, var(--neon-cyan), #0077ff);
    color: #000;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease;
}
.btn-primary:active {
    transform: scale(0.98);
}
.btn-primary .glow-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.4) 0%, transparent 60%);
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    transition: transform 0.5s, opacity 0.5s;
}
.btn-primary:hover .glow-effect {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.btn-secondary {
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--neon-cyan);
    background: transparent;
    color: var(--neon-cyan);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}
.btn-secondary:hover {
    background: var(--neon-cyan-dim);
}

.btn-icon {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--panel-border);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}
.btn-icon:hover {
    background: rgba(255,255,255,0.1);
}

/* Loading State */
#loading-state {
    text-align: center;
    padding: 64px 32px;
}
.loader-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.spinner {
    width: 64px;
    height: 64px;
    border: 4px solid var(--panel-border);
    border-top-color: var(--neon-cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 24px;
}
.pulse-ring {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--neon-cyan);
    opacity: 0;
    animation: pulse 2s ease-out infinite;
}
.loading-text {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 8px;
    background: linear-gradient(90deg, #fff, var(--neon-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.loading-sub {
    color: var(--text-muted);
    font-size: 0.9rem;
}

@keyframes spin { 100% { transform: rotate(360deg); } }
@keyframes pulse {
    0% { transform: translateX(-50%) scale(1); opacity: 0.5; }
    100% { transform: translateX(-50%) scale(2.5); opacity: 0; }
}

/* Results State */
.stat-card {
    background: rgba(255, 255, 255, 0.03);
    padding: 16px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid var(--panel-border);
}

.action-card {
    background: var(--panel-bg);
    padding: 20px;
    border-radius: 16px;
    border: 1px solid var(--panel-border);
}

/* RESULTS & EXERCISES */
.workout-day {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    padding: 24px;
    margin-top: 24px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.day-header h4 {
    font-size: 1.2rem;
    font-weight: 600;
}
.badge {
    background: var(--neon-danger-dim);
    border: 1px solid var(--neon-danger);
    color: var(--neon-danger);
    font-size: 0.7rem;
    padding: 4px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    font-weight: 800;
}

.exercise-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.exercise-card {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    padding: 16px;
    border-radius: 12px;
    transition: background 0.3s;
    cursor: pointer;
    gap: 16px;
}
.exercise-card:hover {
    background: rgba(255, 255, 255, 0.06);
}
.exercise-image {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
}
.exercise-content {
    flex-grow: 1;
}
.exercise-content h5 {
    font-size: 1rem;
    margin-bottom: 4px;
}
.exercise-content span {
    font-size: 0.85rem;
    color: var(--text-muted);
}
.exercise-content p {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 4px;
}
.exercise-action {
    color: var(--neon-cyan);
    font-size: 1.2rem;
    padding-left: 8px;
}

.ai-insight {
    display: flex;
    gap: 16px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), transparent);
    border-left: 3px solid var(--neon-purple);
    padding: 16px;
    border-radius: 0 12px 12px 0;
}
.insight-icon {
    font-size: 1.5rem;
}
.ai-insight p {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #cbd5e1;
}

/* Carousel Steps */
.step {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}
.step.active {
    display: block;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Progress Bar */
.progress-bar-container {
    width: 100%;
    height: 6px;
    background: var(--panel-border);
    border-radius: 4px;
    margin-bottom: 8px;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    background: var(--neon-cyan);
    width: 14%;
    transition: width 0.4s ease;
    box-shadow: 0 0 10px var(--neon-cyan);
}
.step-counter {
    margin-bottom: 24px;
    font-size: 0.85rem;
    font-family: monospace;
}
.selection-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
button:disabled .glow-effect {
    display: none;
}
.mb-4 { margin-bottom: 24px; }

/* Screens */
.screen {
    display: none;
}
.screen.active {
    display: block;
    animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Dashboard Stats */
.dashboard-stats {
    display: flex;
    gap: 12px;
}
.stat-card {
    flex: 1;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}
.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--neon-cyan);
}
.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}
.action-card {
    background: linear-gradient(135deg, rgba(8, 14, 25, 0.6), rgba(0, 240, 255, 0.05));
    border: 1px solid var(--neon-cyan-dim);
    border-radius: 16px;
    padding: 24px;
}

/* Bottom Nav */
.bottom-nav {
    display: flex;
    justify-content: space-around;
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--panel-border);
    padding: 16px 0;
    border-radius: 20px 20px 0 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 480px;
    margin: 0 auto;
    z-index: 1000;
}
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.3s;
}
.nav-item.active {
    color: var(--neon-cyan);
}
.nav-icon {
    font-size: 1.2rem;
}
.nav-label {
    font-size: 0.75rem;
    font-weight: 600;
}

/* 3D Styles & UI Enhancements */
.perspective-wrapper {
    perspective: 1200px;
    width: 100%;
    display: flex;
    justify-content: center;
}
.3d-tilt {
    transition: transform 0.1s ease-out;
    transform-style: preserve-3d;
}
.3d-element {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform: translateZ(0);
}
.3d-element:hover {
    transform: translateZ(10px);
}
.hover-glow:hover {
    box-shadow: 0 0 30px var(--neon-cyan-dim);
}
.hover-glow-soft:hover {
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
.3d-float {
    animation: floating 3s ease-in-out infinite;
}
@keyframes floating {
    0% { transform: translateY(0px) translateZ(0); }
    50% { transform: translateY(-5px) translateZ(10px); }
    100% { transform: translateY(0px) translateZ(0); }
}

/* Flex Utilities */
.flex-column { display: flex; flex-direction: column; }
.gap-2 { gap: 12px; }
.text-left { text-align: left; }
.text-center { text-align: center; }
.align-center { align-items: center; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255,42,95,0.2);
    border: 1px solid var(--neon-danger);
    transition: .4s;
    border-radius: 24px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 3px;
    background-color: var(--neon-danger);
    transition: .4s;
    border-radius: 50%;
}
input:checked + .slider {
    background-color: var(--neon-danger);
}
input:checked + .slider:before {
    transform: translateX(22px);
    background-color: #fff;
    box-shadow: 0 0 10px #fff;
}

/* Toast */
#toast-wrapper {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    pointer-events: none;
    transform: translateY(-50px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
#toast-wrapper.show {
    transform: translateY(0);
    opacity: 1;
}
#toast {
    background: rgba(10, 15, 25, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid var(--panel-border);
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.user-avatar.large {
    width: 80px; height: 80px;
}
.missed-day-simulation {
    background: rgba(255, 42, 95, 0.05);
    border: 1px solid var(--neon-danger-dim);
    padding: 16px;
    border-radius: 12px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.modal:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}
.modal-content {
    background: var(--bg-color);
    border: 1px solid var(--neon-cyan-dim);
    padding: 24px;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 0 40px rgba(0,240,255,0.1);
}
.close-btn {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}
.close-btn:hover { color: #fff; }

/* Timeline */
.timeline {
    border-left: 2px solid rgba(255,255,255,0.1);
    margin-left: 12px;
    padding-left: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.timeline-item {
    position: relative;
}
.timeline-dot {
    position: absolute;
    left: -22px;
    top: 4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-muted);
}
.timeline-dot.success { background: var(--neon-cyan); box-shadow: 0 0 10px var(--neon-cyan); }
.timeline-dot.danger { background: var(--neon-danger); box-shadow: 0 0 10px var(--neon-danger); }
.timeline-dot.warning { background: #facc15; box-shadow: 0 0 10px #facc15; }

.timeline-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.timeline-content strong {
    font-size: 0.9rem;
}
.timeline-content span {
    font-size: 0.8rem;
    color: var(--text-muted);
}
