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

/* Track Workouts Dashboard */
.track-dashboard {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.track-hero-card {
    position: relative;
    background: linear-gradient(135deg, #E8F4FA 0%, #D6E9F5 100%);
    color: var(--dark);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 4px 16px rgba(75,156,211,0.12);
    overflow: hidden;
    border: 1px solid rgba(75,156,211,0.1);
}

.track-hero-card::after {
    content: '';
    position: absolute;
    top: -40%;
    right: -35%;
    width: 70%;
    height: 140%;
    background: radial-gradient(circle at center, rgba(75,156,211,0.08) 0%, transparent 70%);
    opacity: 0.5;
}

.track-hero-header {
    position: relative;
    z-index: 1;
}

.track-hero-header h3 {
    margin: 6px 0 6px;
    font-size: 22px;
    font-weight: 700;
    color: var(--dark);
}

.track-hero-header p {
    margin: 0;
    font-size: 14px;
    color: var(--primary-dark);
    line-height: 1.5;
}

.track-hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    background: rgba(75,156,211,0.15);
    color: var(--primary-dark);
    padding: 6px 13px;
    border-radius: 999px;
    border: 1px solid rgba(75,156,211,0.25);
}

.track-hero-highlight {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.track-hero-tile {
    background: rgba(255,255,255,0.7);
    border-radius: 14px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border: 1px solid rgba(75,156,211,0.15);
    backdrop-filter: blur(6px);
}

.track-hero-caption {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #6b7280;
    font-weight: 600;
}

.track-hero-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--dark);
}

.track-hero-subvalue {
    font-size: 12px;
    color: var(--primary-dark);
}

.track-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.track-action-btn {
    border-radius: 16px;
    padding: 18px 16px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(75,156,211,0.08);
    transition: all 0.2s ease;
    border: 1px solid rgba(75,156,211,0.12);
}

.track-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(75,156,211,0.15);
}

.track-action-primary {
    background: linear-gradient(135deg, rgba(75,156,211,0.12), rgba(93,173,226,0.18));
    color: var(--dark);
    border-color: rgba(75,156,211,0.2);
}

.track-action-secondary {
    background: linear-gradient(135deg, rgba(255,179,71,0.12), rgba(255,140,90,0.18));
    color: var(--dark);
    border-color: rgba(255,140,90,0.2);
}

.track-action-outline {
    background: #fff;
    color: var(--dark);
    border: 1px solid rgba(75,156,211,0.15);
}

.track-action-icon {
    font-size: 26px;
}

.track-action-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--dark);
}

.track-action-sub {
    font-size: 12px;
    color: var(--primary-dark);
    opacity: 0.9;
}

.track-sync-status {
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 600;
    background: rgba(75,156,211,0.08);
    color: var(--primary-dark);
    border: 1px solid rgba(75,156,211,0.15);
    box-shadow: 0 2px 8px rgba(75,156,211,0.06);
}

.track-sync-status[data-variant="success"] {
    background: rgba(46,204,113,0.1);
    border-color: rgba(46,204,113,0.2);
    color: #15803d;
}

.track-sync-status[data-variant="error"] {
    background: rgba(239,68,68,0.1);
    border-color: rgba(239,68,68,0.2);
    color: #991b1b;
}

.track-sync-status[data-variant="muted"] {
    background: rgba(107,114,128,0.08);
    border-color: rgba(107,114,128,0.15);
    color: #4b5563;
}

.track-celebration {
    background: rgba(251,191,36,0.12);
    border: 1px solid rgba(251,191,36,0.25);
    border-radius: 16px;
    padding: 16px 18px;
    color: #78350f;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 3px 12px rgba(251,191,36,0.12);
}

.track-celebration strong {
    font-size: 15px;
    font-weight: 700;
}

.track-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.track-stat-card {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 3px 10px rgba(75,156,211,0.08);
    border: 1px solid rgba(75,156,211,0.1);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.track-stat-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #6b7280;
    font-weight: 600;
}

.track-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark);
}

.track-stat-meta {
    font-size: 12px;
    color: var(--primary-dark);
}

.track-chart-card {
    background: #fff;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 3px 10px rgba(75,156,211,0.08);
    border: 1px solid rgba(75,156,211,0.1);
}

.track-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.track-chart-header h4 {
    margin: 0 0 6px 0;
    font-size: 17px;
    font-weight: 700;
    color: var(--dark);
}

.track-chart-header p {
    margin: 0;
    font-size: 13px;
    color: var(--primary-dark);
}

.track-chart-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.track-chart-nav {
    border: 1px solid rgba(75,156,211,0.12);
    border-radius: 999px;
    padding: 7px 13px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    background: rgba(75,156,211,0.05);
    color: var(--primary-dark);
    cursor: pointer;
    transition: all 0.2s ease;
}

.track-chart-nav:hover:not([disabled]) {
    background: rgba(75,156,211,0.1);
    border-color: rgba(75,156,211,0.2);
}

.track-chart-nav[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
}

.track-chart-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-dark);
}

.track-calorie-bars {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12px, 1fr));
    align-items: end;
    gap: 6px;
    min-height: 150px;
}

.track-calorie-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.track-calorie-bar-fill {
    width: 100%;
    border-radius: 10px 10px 4px 4px;
    background: linear-gradient(180deg, rgba(75,156,211,0.85), rgba(58,124,165,0.7));
    min-height: 4px;
    transition: height 0.25s ease;
}

.track-calorie-bar-day {
    font-size: 10px;
    font-weight: 600;
    color: #6b7280;
}

.track-empty-state {
    background: rgba(75,156,211,0.04);
    border-radius: 12px;
    padding: 14px 16px;
    text-align: center;
    font-size: 13px;
    color: var(--primary-dark);
    margin-top: 12px;
    border: 1px dashed rgba(75,156,211,0.15);
}

.track-card {
    background: #fff;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 3px 10px rgba(75,156,211,0.08);
    border: 1px solid rgba(75,156,211,0.1);
}

.track-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.track-card-header h4 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: var(--dark);
}

.track-card-link {
    background: none;
    border: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    transition: color 0.2s ease;
}

.track-card-link:hover {
    color: var(--primary-dark);
}

.track-card-sub {
    font-size: 13px;
    color: var(--primary-dark);
    margin-bottom: 2px;
}

.track-timeline-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.track-timeline-item {
    background: var(--card-bg);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: 1px solid rgba(75,156,211,0.1);
    box-shadow: 0 2px 8px rgba(75,156,211,0.06);
    transition: all 0.2s ease;
}

.track-timeline-item:hover {
    box-shadow: 0 4px 12px rgba(75,156,211,0.1);
    transform: translateY(-1px);
}

.track-timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.track-timeline-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.track-timeline-icon {
    font-size: 20px;
}

.track-timeline-meta {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-align: right;
}

.track-timeline-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.track-timeline-tag {
    font-size: 11px;
    background: rgba(75,156,211,0.12);
    color: var(--primary-dark);
    border-radius: 999px;
    padding: 5px 10px;
    font-weight: 600;
    border: 1px solid rgba(75,156,211,0.15);
}

.track-timeline-tag[data-variant="neutral"] {
    background: rgba(107,114,128,0.1);
    color: #4b5563;
    border-color: rgba(107,114,128,0.15);
}

.track-timeline-notes {
    font-size: 13px;
    color: var(--primary-dark);
    font-style: italic;
}

.track-machine-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.track-machine-panel {
    background: var(--card-bg);
    border-radius: 14px;
    padding: 14px;
    display: flex;
    gap: 12px;
    align-items: center;
    border: 1px solid rgba(75,156,211,0.1);
    box-shadow: 0 2px 8px rgba(75,156,211,0.06);
    transition: all 0.2s ease;
}

.track-machine-panel:hover {
    box-shadow: 0 4px 12px rgba(75,156,211,0.1);
    transform: translateY(-1px);
}

.track-machine-icon {
    font-size: 26px;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: rgba(75,156,211,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.track-machine-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.track-machine-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--dark);
}

.track-machine-metrics {
    font-size: 11px;
    color: var(--primary-dark);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.track-machine-empty {
    font-size: 13px;
    color: var(--primary-dark);
    background: rgba(75,156,211,0.04);
    border-radius: 12px;
    padding: 14px 16px;
    text-align: center;
    border: 1px dashed rgba(75,156,211,0.15);
}
:root {
    --carolina-blue: #4B9CD3;
    --carolina-dark: #13294B;
    --carolina-light: #7BAFD4;
    --primary: #4B9CD3;
    --primary-dark: #3A7CA5;
    --primary-light: #7BAFD4;
    --secondary: #5DADE2;
    --accent: #85C1E9;
    --dark: #13294B;
    --light-bg: #F0F7FC;
    --lighter-bg: #E8F4FA;
    --card-bg: #F5FAFD;
    --gradient-1: linear-gradient(135deg, #4B9CD3 0%, #3A7CA5 100%);
    --gradient-2: linear-gradient(135deg, #5DADE2 0%, #4B9CD3 100%);
    --gradient-3: linear-gradient(135deg, #7BAFD4 0%, #5DADE2 100%);
    --gradient-light: linear-gradient(135deg, #E8F4FA 0%, #D6E9F5 100%);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #4B9CD3 0%, #13294B 100%);
    min-height: 100vh;
    margin: 0;
}

.phone-container {
    width: 100%;
    min-height: 100vh;
    background: var(--light-bg);
    border-radius: 0;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    box-shadow: none;
    position: relative;
    z-index: 1;
}

.screen {
    width: 100%;
    min-height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    background: var(--light-bg);
    border-radius: 0;
    overflow: hidden;
    position: relative;
}

.status-bar {
    height: 44px;
    background: rgba(75, 156, 211, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    color: var(--dark);
    font-size: 14px;
    font-weight: 600;
}

.header {
    height: 60px;
    background: var(--gradient-1);
    display: flex;
    align-items: center;
    padding: 0 20px;
    color: white;
    position: relative;
    box-shadow: 0 4px 20px rgba(75, 156, 211, 0.3);
}

.hamburger {
    font-size: 24px;
    cursor: pointer;
    z-index: 1000;
}

.header-title {
    flex: 1;
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    margin-left: -24px;
    letter-spacing: 0.5px;
}

.content {
    padding: 20px;
    padding-bottom: 100px; /* Space for bottom nav */
    height: calc(100% - 104px);
    overflow-y: auto;
    background: var(--light-bg);
}

.content::-webkit-scrollbar {
    width: 6px;
}

.content::-webkit-scrollbar-track {
    background: rgba(75, 156, 211, 0.1);
    border-radius: 3px;
}

.content::-webkit-scrollbar-thumb {
    background: var(--carolina-blue);
    border-radius: 3px;
}

.screen-content {
    display: none;
}

.screen-content.active {
    display: block;
}

/* HOME SCREEN */
.home-content {
    text-align: center;
}

.brand-logo {
    font-size: 52px;
    font-weight: bold;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

.brand-tagline {
    color: var(--dark);
    font-size: 16px;
    margin-bottom: 40px;
}

.hero-section {
    background: var(--gradient-light);
    border-radius: 25px;
    padding: 35px 25px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(75, 156, 211, 0.2);
}

.hero-title {
    font-size: 26px;
    font-weight: bold;
    color: var(--dark);
    margin-bottom: 15px;
}

.hero-subtitle {
    color: var(--primary-dark);
    font-size: 16px;
    margin-bottom: 25px;
    line-height: 1.6;
}

.fitness-icons {
    display: flex;
    justify-content: space-around;
    margin: 30px 0;
}

.fitness-icon {
    width: 65px;
    height: 65px;
    background: rgba(255,255,255,0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--carolina-blue);
    font-size: 28px;
    box-shadow: 0 5px 15px rgba(75, 156, 211, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
}

.fitness-icon:hover {
    transform: translateY(-5px);
    background: white;
}

.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 30px;
}

.action-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 25px 20px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(75, 156, 211, 0.1);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(75, 156, 211, 0.2);
    border-color: var(--carolina-blue);
}

.action-icon {
    font-size: 36px;
    margin-bottom: 12px;
}

.action-title {
    font-weight: bold;
    color: var(--dark);
    margin-bottom: 5px;
}

.action-desc {
    color: var(--primary-dark);
    font-size: 12px;
}

.motivation-quote {
    background: var(--gradient-1);
    color: white;
    padding: 30px;
    border-radius: 20px;
    font-style: italic;
    font-size: 17px;
    line-height: 1.6;
    box-shadow: 0 10px 30px rgba(75, 156, 211, 0.3);
}

/* SIDEBAR */
.sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    width: 280px;
    height: 100%;
    background: var(--gradient-1);
    transition: left 0.4s ease;
    z-index: 999;
    color: white;
    padding: 20px 0;
    box-shadow: 5px 0 25px rgba(0,0,0,0.3);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.sidebar.open {
    left: 0;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    text-align: center;
}

.sidebar-brand {
    font-size: 28px;
    font-weight: bold;
    color: #fff;
}

.sidebar-menu {
    padding: 20px 0;
}

.menu-item {
    display: block;
    width: 100%;
    padding: 15px 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 0;
    border-left: 4px solid transparent;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
}

.menu-item:hover {
    background: rgba(255,255,255,0.1);
    border-left: 4px solid #fff;
    padding-left: 35px;
}

.menu-item.active {
    background: rgba(255,255,255,0.2);
    border-left: 4px solid #fff;
    font-weight: bold;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 998;
}

.overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Other styles */
.filter-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    overflow-x: auto;
}

.filter-tab {
    background: var(--lighter-bg);
    color: var(--carolina-blue);
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    border: 2px solid transparent;
    font-weight: 600;
    transition: all 0.3s ease;
}

.filter-tab.active {
    background: var(--gradient-1);
    color: white;
    transform: scale(1.05);
}

.workout-card {
    background: var(--card-bg);
    border-radius: 25px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 8px 30px rgba(75, 156, 211, 0.1);
    border-left: 5px solid var(--carolina-blue);
    cursor: pointer;
    transition: all 0.3s ease;
}

.workout-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(75, 156, 211, 0.2);
}

.quick-action-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.quick-action-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(75, 156, 211, 0.2);
    border-color: var(--carolina-blue);
}

/* Notification */
.notification {
    position: fixed;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 20px 25px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    max-width: 350px;
    width: 90%;
    z-index: 1100;
    transition: top 0.5s ease;
}

.notification.show {
    top: 30px;
}

.notification-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    color: var(--carolina-blue);
    font-weight: bold;
}

.notification-content {
    color: var(--dark);
    font-style: italic;
    line-height: 1.5;
}

.notification-close {
    position: absolute;
    top: 10px;
    right: 15px;
    cursor: pointer;
    color: #999;
    font-size: 20px;
}
.quiz-select-btn.selected {
    background: var(--gradient-1) !important;
    color: white !important;
    border-color: var(--carolina-blue) !important;
    transform: scale(1.02);
}

.quiz-select-btn.selected div {
    color: white !important;
}

.quiz-question-section {
    animation: fadeIn 0.5s ease;
}

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

@keyframes loadingBar {
    to { width: 100%; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ==================== BOTTOM NAVIGATION BAR ==================== */
.bottom-nav {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    width: 100% !important;
    height: auto;
    min-height: 70px;
    background: linear-gradient(135deg, rgba(58, 124, 165, 0.98) 0%, rgba(75, 156, 211, 0.95) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-around !important;
    align-items: flex-start;
    padding: 6px 8px;
    padding-bottom: max(12px, calc(env(safe-area-inset-bottom) + 6px));
    padding-left: max(8px, env(safe-area-inset-left));
    padding-right: max(8px, env(safe-area-inset-right));
    box-shadow: 0 -10px 40px rgba(75, 156, 211, 0.4), 0 -2px 10px rgba(75, 156, 211, 0.6);
    border-top: 2px solid rgba(255, 255, 255, 0.3);
    z-index: 9000 !important;
    transform: none !important;
}

.nav-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 8px 6px;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    flex: 1;
    max-width: 80px;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
}

.menu-item:focus-visible,
.nav-item:focus-visible {
    outline: 3px solid #fff;
    outline-offset: -3px;
}

.nav-item:active {
    transform: scale(0.92);
}

.nav-icon {
    font-size: 26px;
    margin-bottom: 3px;
    filter: drop-shadow(0 2px 8px rgba(255, 255, 255, 0.4));
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.nav-label {
    font-size: 9px;
    font-weight: 700;
    color: rgba(255,255,255,0.9);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.nav-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    opacity: 0;
    transition: all 0.4s ease;
    z-index: 1;
    pointer-events: none;
}

.nav-item:hover .nav-glow {
    opacity: 1;
    width: 90px;
    height: 90px;
}

.nav-item:hover .nav-icon {
    transform: translateY(-3px) scale(1.15);
    filter: drop-shadow(0 4px 12px rgba(255, 255, 255, 0.8));
}

.nav-item:hover .nav-label {
    color: #fff;
    transform: translateY(-2px);
    text-shadow: 0 2px 8px rgba(255, 255, 255, 0.5);
}

/* Animated gradient background on hover */
.nav-item:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Pulsing animation for the first item to draw attention */
.nav-item:first-child .nav-icon {
    animation: gentlePulse 3s ease-in-out infinite;
}

@keyframes gentlePulse {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 2px 8px rgba(255, 255, 255, 0.5));
    }
    50% {
        transform: scale(1.05);
        filter: drop-shadow(0 3px 12px rgba(255, 255, 255, 0.8));
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    body {
        padding: 10px;
        align-items: flex-start;
        padding-top: 10px;
    }
    
    .phone-container {
        width: 100%;
        max-width: 420px;
        height: 100vh;
        max-height: none;
        min-height: 100vh;
        border-radius: 0;
        padding: 0;
        box-shadow: none;
    }
    
    .screen {
        border-radius: 0;
        overflow-x: hidden;
    }
    
    .header {
        padding: 15px 20px;
    }
    
    .content {
        padding: 20px;
    }
    
    /* Make buttons more touch-friendly */
    .action-btn, .quiz-btn, .create-plan-btn {
        min-height: 44px;
        padding: 12px 20px;
        font-size: 16px;
    }
    
    /* Adjust grid layouts for mobile */
    .features-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .macro-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    /* Fix text sizes */
    .header-title {
        font-size: 22px;
    }
    
    h1 { font-size: 28px; }
    h2 { font-size: 24px; }
    h3 { font-size: 20px; }
    
    /* Sidebar adjustments */
    .sidebar {
        width: 280px;
    }
    
    /* Form inputs */
    input, select, textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px;
    }
    
    /* Progress cards */
    .goal-cards {
        grid-template-columns: 1fr;
    }
    
    /* Meal plan cards */
    .meal-card {
        margin-bottom: 15px;
    }
}

@media (max-width: 480px) {
    .status-bar {
        height: 20px;
        padding: 0 16px;
    }
    
    .content {
        padding: 16px;
        min-height: calc(100vh - 96px);
    }

    .header {
        padding: 12px 16px;
        border-radius: 0;
    }
    
    .header-title {
        font-size: 20px;
    }
    
    .action-btn, .quiz-btn, .create-plan-btn {
        font-size: 14px;
        padding: 10px 16px;
    }
    
    .macro-grid {
        grid-template-columns: 1fr;
    }
    
    /* Stack macro items vertically on very small screens */
    .nutrition-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .bottom-nav {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        top: auto !important;
        width: 100% !important;
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-around !important;
        border-radius: 0;
        max-width: none;
        margin: 0;
        z-index: 9000 !important;
        padding-bottom: max(12px, calc(env(safe-area-inset-bottom) + 6px));
    }
}

/* Landscape orientation adjustments */
@media (max-height: 500px) and (orientation: landscape) {
    .phone-container {
        height: 100vh;
        max-height: none;
    }
    
    .content {
        padding: 10px 20px;
    }
    
    .header {
        padding: 8px 20px;
    }
}

/* Large screens - maintain phone-like experience */
@media (min-width: 1024px) {
    body {
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 40px;
    }

    .phone-container {
        width: 375px;
        height: 812px;
        min-height: 812px;
        margin: 0 auto;
        background: #000;
        border-radius: 40px;
        padding: 8px;
        box-shadow: 0 25px 50px rgba(0,0,0,0.3);
    }
    
    .screen {
        border-radius: 32px;
        height: 100%;
        min-height: 100%;
        background: var(--light-bg);
    }
}

/*
 * Keep the iPhone safe area and top navigation anchored on every standard app
 * page. Long page content owns the scrolling viewport instead of the document.
 */
html:has(body > .phone-container > .screen > .status-bar),
body:has(> .phone-container > .screen > .status-bar) {
    height: 100%;
}

body:has(> .phone-container > .screen > .status-bar) {
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
}

body:has(> .phone-container > .screen > .status-bar) > .phone-container {
    display: flex;
    flex-direction: column;
}

body:has(> .phone-container > .screen > .status-bar) > .phone-container > .screen {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

body:has(> .phone-container > .screen > .status-bar) > .phone-container > .screen > .status-bar,
body:has(> .phone-container > .screen > .status-bar) > .phone-container > .screen > .header {
    flex: 0 0 auto;
}

body:has(> .phone-container > .screen > .status-bar) > .phone-container > .screen > .content {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    padding-bottom: max(100px, calc(84px + env(safe-area-inset-bottom)));
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scroll-padding-top: 16px;
    scroll-padding-bottom: max(100px, calc(84px + env(safe-area-inset-bottom)));
}

body:has(> .phone-container > .screen > .status-bar) > .phone-container > .screen > .content:focus-visible {
    outline: 3px solid var(--carolina-dark);
    outline-offset: -3px;
}

.header > button.hamburger {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 24px;
    line-height: 1;
}

.header > button.hamburger:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
}

/* Class-based fallback for embedded webviews that do not support :has(). */
html.fixed-app-shell-root,
body.fixed-app-shell {
    height: 100%;
}

body.fixed-app-shell {
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
}

body.fixed-app-shell > .phone-container {
    display: flex;
    flex-direction: column;
}

body.fixed-app-shell > .phone-container > .screen {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

body.fixed-app-shell > .phone-container > .screen > .status-bar,
body.fixed-app-shell > .phone-container > .screen > .header {
    flex: 0 0 auto;
}

body.fixed-app-shell > .phone-container > .screen > .content {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    padding-bottom: max(100px, calc(84px + env(safe-area-inset-bottom)));
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scroll-padding-top: 16px;
    scroll-padding-bottom: max(100px, calc(84px + env(safe-area-inset-bottom)));
}

body.fixed-app-shell > .phone-container > .screen > .content:focus-visible {
    outline: 3px solid var(--carolina-dark);
    outline-offset: -3px;
}

/* This menu is opened by showLogFoodMenu(); keep its initially unstyled
 * placeholder from becoming a stray document-level tab stop/scroll extent. */
body.home-app-shell #logFoodModal {
    display: none;
}

@media (max-width: 768px) {
    body:has(> .phone-container > .screen > .status-bar) > .phone-container {
        height: 100%;
        min-height: 0;
    }

    body.fixed-app-shell > .phone-container {
        height: 100%;
        min-height: 0;
    }
}

@media (min-width: 769px) and (max-width: 1023px) {
    body:has(> .phone-container > .screen > .status-bar) > .phone-container {
        height: 100vh;
        height: 100dvh;
        min-height: 0;
    }

    body.fixed-app-shell > .phone-container {
        height: 100vh;
        height: 100dvh;
        min-height: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sidebar,
    .overlay,
    .menu-item,
    .nav-item,
    .nav-icon,
    .nav-label,
    .nav-glow {
        animation: none !important;
        transition: none !important;
    }
}
