/* ==================== CORE DESIGN SYSTEM & HSL PALETTE ==================== */

:root {
    /* Sophisticated Dark Theme Base */
    --color-bg: hsl(222, 47%, 4%);             /* Midnight Slate */
    --color-surface: hsl(223, 25%, 8%);        /* Obsidian Slate */
    --color-surface-card: hsl(223, 20%, 12%);  /* Elevated Card Surface */
    --color-border: rgba(255, 255, 255, 0.04);
    --color-border-hover: rgba(255, 255, 255, 0.1);
    
    /* Curated Soft Neon Accents */
    --color-primary: hsl(84, 89%, 68%);        /* Aurora Lime */
    --color-primary-rgb: 217, 249, 157;
    --color-primary-dark: hsl(84, 80%, 55%);
    
    --color-blue: hsl(200, 100%, 60%);         /* Ocean Blue */
    --color-blue-rgb: 0, 162, 255;
    
    --color-orange: hsl(25, 100%, 60%);        /* Sunset Orange */
    --color-orange-rgb: 255, 149, 0;
    
    --color-red: hsl(0, 84%, 60%);             /* Critical Coral */
    --color-red-rgb: 255, 59, 48;
    
    /* Elegant Typography Hierarchy */
    --text-primary: hsl(0, 0%, 98%);
    --text-secondary: hsl(215, 15%, 70%);
    --text-muted: hsl(215, 12%, 45%);
    
    /* Consistent Spacing & Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
}

/* ==================== BASE STYLES & RESET ==================== */

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--color-bg);
    color: var(--text-primary);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', system-ui, -apple-system, sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--color-bg);
}
::-webkit-scrollbar-thumb {
    background: var(--color-border-hover);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ==================== LAYOUT FRAMEWORK ==================== */

.app-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

/* Sidebar Navigation Layout */
.sidebar {
    background-color: var(--color-surface);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    padding: 36px 24px;
    z-index: 100;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
    padding-left: 8px;
}

.brand-logo {
    font-size: 26px;
}

.brand-name {
    font-family: 'Outfit', sans-serif;
    font-weight: 900;
    font-size: 20px;
    letter-spacing: 0.05em;
    background: linear-gradient(135deg, #ffffff 0%, var(--color-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-grow: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 14px;
    transition: var(--transition-fast);
}

.nav-item i {
    width: 18px;
    height: 18px;
    transition: var(--transition-fast);
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.02);
    color: var(--text-primary);
}

.nav-item.active {
    background-color: rgba(var(--color-primary-rgb), 0.08);
    border: 1px solid rgba(var(--color-primary-rgb), 0.15);
    color: var(--color-primary);
    font-weight: 700;
}

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

/* Main Content Area */
.main-content {
    padding: 40px 60px;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 36px;
}

.header-left h1 {
    font-size: 34px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.01em;
}

.header-left p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
}

.streak-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: rgba(255, 149, 0, 0.05);
    border: 1px solid rgba(255, 149, 0, 0.15);
    color: var(--color-orange);
    padding: 10px 18px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 13px;
    font-family: 'Outfit', sans-serif;
}

.streak-badge i {
    width: 16px;
    height: 16px;
    fill: var(--color-orange);
}

/* ==================== CARD LAYOUTS & MODULES ==================== */

.card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 28px;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.card:hover {
    border-color: var(--color-border-hover);
    transform: translateY(-2px);
    box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.3);
}

.card.glass {
    background: linear-gradient(135deg, rgba(18, 22, 33, 0.8) 0%, rgba(12, 15, 23, 0.9) 100%);
    backdrop-filter: blur(12px);
}

/* Thin Top Color Accents on Hover */
.border-green:hover { border-color: rgba(var(--color-primary-rgb), 0.3) !important; }
.border-orange:hover { border-color: rgba(255, 149, 0, 0.3) !important; }
.border-blue:hover { border-color: rgba(0, 162, 255, 0.3) !important; }

/* Card Elements */
.card-tag {
    font-size: 10px;
    font-weight: 800;
    color: var(--color-primary);
    letter-spacing: 0.1em;
    margin-bottom: 12px;
    text-transform: uppercase;
}

.card h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
}

.section-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* ==================== VIEW STATES ==================== */

.view-container {
    display: none;
    animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.view-container.active {
    display: block;
}

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

/* ==================== DATE SELECTOR COMPONENT (FIXED!) ==================== */

.date-selector-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 10px 18px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.date-display-box {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.05em;
    color: var(--color-primary);
}

.date-arrow-btn {
    background: none;
    border: 1px solid var(--color-border);
    color: var(--text-secondary);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.date-arrow-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background-color: rgba(var(--color-primary-rgb), 0.05);
}

/* ==================== VIEW: DASHBOARD ELEMENTS ==================== */

.dashboard-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 28px;
    margin-bottom: 28px;
}

/* Tip Card (Home/Dashboard) */
.tip-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 240px;
    background: linear-gradient(135deg, rgba(var(--color-primary-rgb), 0.03) 0%, rgba(12, 15, 23, 0.95) 100%) !important;
    border-color: rgba(var(--color-primary-rgb), 0.12) !important;
}

.tip-card h2 {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.5;
    color: #ffffff;
    margin-bottom: 24px;
}

/* KPI Widgets */
.kpi-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.kpi-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 22px 28px;
}

.kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kpi-icon i {
    width: 20px;
    height: 20px;
}

.icon-green {
    background-color: rgba(var(--color-primary-rgb), 0.06);
    color: var(--color-primary);
    border: 1px solid rgba(var(--color-primary-rgb), 0.12);
}

.icon-orange {
    background-color: rgba(255, 149, 0, 0.06);
    color: var(--color-orange);
    border: 1px solid rgba(255, 149, 0, 0.12);
}

.icon-blue {
    background-color: rgba(0, 162, 255, 0.06);
    color: var(--color-blue);
    border: 1px solid rgba(0, 162, 255, 0.12);
}

.kpi-info h3 {
    font-size: 10px;
    color: var(--text-secondary);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.kpi-value {
    font-size: 24px;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    color: #ffffff;
}

/* Activities Grid Layout */
.activities-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 28px;
}

/* Hydration Widgets */
.water-progress-container {
    margin: 28px 0;
}

.water-amount {
    font-size: 20px;
    font-weight: 800;
    color: #ffffff;
    font-family: 'Outfit', sans-serif;
    margin-bottom: 12px;
}

.progress-bar-bg {
    width: 100%;
    height: 6px;
    background-color: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width var(--transition-smooth);
}

.progress-bar-fill.blue {
    background: linear-gradient(90deg, hsl(200, 100%, 45%) 0%, var(--color-blue) 100%);
}

.progress-bar-fill.green {
    background: linear-gradient(90deg, hsl(84, 80%, 45%) 0%, var(--color-primary) 100%);
}

.water-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.add-water-btn {
    background-color: rgba(0, 162, 255, 0.04);
    border: 1px solid rgba(0, 162, 255, 0.15);
    color: var(--color-blue);
    border-radius: var(--radius-sm);
    padding: 12px 18px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
    flex-grow: 1;
    text-align: center;
}

.add-water-btn:hover {
    background-color: rgba(0, 162, 255, 0.08);
    border-color: var(--color-blue);
    box-shadow: 0 4px 15px rgba(0, 162, 255, 0.15);
    transform: translateY(-1px);
}

.add-water-btn:active {
    transform: translateY(0);
}

/* Timeline lists widgets */
.activities-list, .intake-diary-list, .exercise-timeline {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 4px;
}

.activity-item, .diary-item {
    background-color: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition-fast);
}

.activity-item:hover, .diary-item:hover {
    background-color: rgba(255, 255, 255, 0.03);
    border-color: var(--color-border-hover);
}

.activity-meta, .diary-meta {
    display: flex;
    align-items: center;
    gap: 14px;
}

.activity-badge-icon, .diary-badge-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

.badge-blue { background-color: rgba(0, 162, 255, 0.06); color: var(--color-blue); }
.badge-green { background-color: rgba(var(--color-primary-rgb), 0.06); color: var(--color-primary); }
.badge-orange { background-color: rgba(255, 149, 0, 0.06); color: var(--color-orange); }

.activity-details h4, .diary-details h4 {
    font-size: 14px;
    font-weight: 600;
}

.activity-details p, .diary-details p {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.activity-time, .diary-time {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.delete-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: var(--transition-fast);
}

.delete-btn:hover {
    color: var(--color-red);
    background-color: rgba(255, 59, 48, 0.08);
}

/* ==================== VIEW: WORKOUT PLAN ELEMENTS ==================== */

.workout-grid, .bmi-grid, .calories-grid, .progress-charts-grid, .profile-grid {
    display: grid;
    grid-template-columns: 1.60fr 1fr;
    gap: 28px;
}

.card-header-btn {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

/* Loading & Empty States */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 60px 0;
    color: var(--text-secondary);
}

.loading-state span {
    font-size: 13px;
}

.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

.empty-state i {
    color: var(--text-muted);
    margin-bottom: 12px;
    opacity: 0.4;
}

.icon-lg {
    width: 40px;
    height: 40px;
}

/* AI workout contents view */
.ai-plan-content {
    background-color: rgba(255, 255, 255, 0.005);
    border-radius: var(--radius-md);
    animation: fadeIn 0.4s ease-out;
}

.ai-intro-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
    border-left: 2px solid var(--color-primary);
    padding-left: 16px;
    margin-bottom: 24px;
}

.ai-day-card {
    background-color: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 22px;
    margin-bottom: 16px;
}

.ai-day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 12px;
    margin-bottom: 14px;
}

.ai-day-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-primary);
}

.ai-day-duration {
    font-size: 11px;
    background-color: rgba(255, 255, 255, 0.04);
    padding: 4px 10px;
    border-radius: 30px;
    color: #ffffff;
    font-weight: 600;
}

.ai-exercises-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ai-exercise-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.005);
    border: 1px solid rgba(255,255,255,0.02);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
}

.ai-ex-name {
    font-size: 13px;
    font-weight: 600;
}

.ai-ex-stats {
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    gap: 8px;
}

.ai-ex-stats span {
    background-color: rgba(255, 255, 255, 0.02);
    padding: 2px 8px;
    border-radius: 4px;
}

/* ==================== VIEW: BMI METER ELEMENTS ==================== */

.bmi-meter-card {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.bmi-gauge-container {
    width: 200px;
    height: 150px;
    position: relative;
    margin: 10px 0;
}

.bmi-gauge {
    width: 100%;
    height: 100%;
}

.gauge-track {
    stroke: rgba(255, 255, 255, 0.03);
    stroke-width: 10;
}

.gauge-indicator {
    stroke: var(--color-primary);
    stroke-width: 10;
    transition: stroke-dashoffset var(--transition-smooth), stroke var(--transition-smooth);
}

.gauge-readout {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#bmiValueDisplay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -40%);
    font-size: 38px;
    font-weight: 900;
    color: #ffffff;
    font-family: 'Outfit', sans-serif;
    line-height: 1;
}

.category-badge {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 30px;
    background-color: rgba(255, 255, 255, 0.03);
}

.advice-card {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.015);
    border-radius: var(--radius-md);
    padding: 18px;
    margin-top: 14px;
    border: 1px solid var(--color-border);
}

.advice-card h4 {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.advice-card p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.sliders-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-top: 14px;
}

.slider-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.slider-header span:first-child {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-secondary);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.slider-value {
    font-size: 16px;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    color: var(--color-primary);
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.slider-value .unit {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
}

/* Web Inputs sliders customization */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--color-primary);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(var(--color-primary-rgb), 0.35);
    transition: transform var(--transition-fast);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

/* ==================== VIEW: CALORIE METERS (FIXED!) ==================== */

.calories-budget-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.calories-split-container {
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 20px;
    margin-top: 14px;
}

.calories-ring-box {
    width: 120px;
    height: 120px;
    position: relative;
}

/* Rotates the entire ring so progress starts at 12 o'clock (top) and sweeps clockwise! */
.calories-ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    transform-origin: center;
}

.ring-track {
    stroke: rgba(255, 255, 255, 0.03);
    stroke-width: 10;
}

.ring-fill {
    stroke-width: 10;
    stroke-linecap: round;
    transition: stroke-dashoffset var(--transition-smooth);
}

.ring-fill.green { stroke: var(--color-primary); }

.ring-readout {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
}

#calRemainingValue {
    font-size: 22px;
    font-weight: 900;
    color: #ffffff;
    font-family: 'Outfit', sans-serif;
    line-height: 1;
}

.readout-label {
    font-size: 8px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-top: 2px;
}

.calories-breakdown {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.breakdown-item {
    display: flex;
    align-items: center;
    font-size: 13px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 10px;
    display: inline-block;
}

.dot.white { background-color: #ffffff; }
.dot.green { background-color: var(--color-primary); }
.dot.orange { background-color: var(--color-orange); }

.breakdown-item .label {
    color: var(--text-secondary);
    margin-right: 6px;
}

/* ==================== VIEW: PROGRESS CHARTS & STATS ==================== */

.stats-summary-box {
    display: flex;
    flex-direction: column;
}

.stats-cards-vertical {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px;
}

.stats-item {
    background-color: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 18px 22px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: var(--transition-fast);
}

.stats-item:hover {
    background-color: rgba(255, 255, 255, 0.03);
    border-color: var(--color-border-hover);
}

.stats-label {
    font-size: 9px;
    font-weight: 800;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.stats-val {
    font-size: 24px;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
}

/* ==================== FORMS AND CHIP BUTTONS ==================== */

.custom-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group {
    flex-grow: 1;
    width: 50%;
}

.custom-form label {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.custom-form input, .custom-form select, .dark-input {
    background-color: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--color-border);
    color: #ffffff;
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: var(--transition-fast);
    width: 100%;
}

.custom-form input:focus, .custom-form select:focus, .dark-input:focus {
    border-color: var(--color-primary);
    background-color: rgba(255, 255, 255, 0.025);
    box-shadow: 0 0 0 2px rgba(var(--color-primary-rgb), 0.08);
}

.options-selector {
    display: flex;
    gap: 8px;
    width: 100%;
}

.flex-row-layout { display: flex; flex-direction: row; }
.flex-column-layout { display: flex; flex-direction: column; }
.align-center { align-items: center; }
.gap-10 { gap: 10px; }
.margin-0 { margin: 0; }
.w-100 { width: 100% !important; }
.mt-10 { margin-top: 10px !important; }
.mt-20 { margin-top: 20px !important; }

/* Chip styling selectors */
.option-chip, .goal-chip, .meal-type-chip {
    background-color: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--color-border);
    color: #ffffff;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    flex-grow: 1;
    text-align: center;
}

.option-chip:hover, .goal-chip:hover, .meal-type-chip:hover {
    background-color: rgba(255, 255, 255, 0.03);
    border-color: var(--color-border-hover);
}

.option-chip.active, .goal-chip.active, .meal-type-chip.active {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: #000000;
    font-weight: 700;
}

.goal-chip {
    text-align: left;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ==================== BUTTON COMPONENTS ==================== */

.action-btn {
    border-radius: var(--radius-sm);
    padding: 12px 20px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-smooth);
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.action-btn.primary {
    background-color: var(--color-primary);
    color: #000000;
}

.action-btn.primary:hover {
    background-color: var(--color-primary-dark);
    box-shadow: 0 4px 20px rgba(var(--color-primary-rgb), 0.2);
    transform: translateY(-1px);
}

.action-btn.secondary {
    background-color: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--color-border);
    color: #ffffff;
}

.action-btn.secondary:hover {
    background-color: rgba(255, 255, 255, 0.03);
    border-color: var(--color-border-hover);
}

.action-btn.secondary.text-red {
    border-color: rgba(255, 59, 48, 0.15);
}

.action-btn.secondary.text-red:hover {
    background-color: rgba(255, 59, 48, 0.06);
    color: var(--color-red);
    border-color: var(--color-red);
}

/* Spinner Icon */
.spin-icon {
    animation: rotate 1.5s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

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

.text-green { color: var(--color-primary) !important; }
.text-orange { color: var(--color-orange) !important; }
.text-blue { color: var(--color-blue) !important; }
.text-red { color: var(--color-red) !important; }

/* ==================== DIALOG MODAL LAYOUTS ==================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeInModal 0.25s ease-out;
}

.modal-card {
    width: 100%;
    max-width: 480px;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    transform: scale(1);
    animation: scaleModal 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes fadeInModal {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleModal {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 16px;
    margin-bottom: 10px;
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 800;
}

.close-modal-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: var(--transition-fast);
}

.close-modal-btn:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.05);
}

.info-note {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 10px 0;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid var(--color-border);
    padding-top: 16px;
    margin-top: 16px;
}

/* ==================== RESPONSIVE LAYOUT MEDIA QUERIES ==================== */

.mobile-nav-bar {
    display: none;
}

@media (max-width: 992px) {
    .app-container {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        display: none;
    }
    
    .mobile-nav-bar {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100vw;
        height: 72px;
        background-color: rgba(12, 15, 23, 0.95);
        backdrop-filter: blur(10px);
        border-top: 1px solid var(--color-border);
        justify-content: space-around;
        align-items: center;
        z-index: 900;
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        text-decoration: none;
        color: var(--text-secondary);
        font-size: 9px;
        font-weight: 600;
        transition: var(--transition-fast);
        width: 16%;
    }
    
    .mobile-nav-item i {
        width: 20px;
        height: 20px;
    }
    
    .mobile-nav-item.active {
        color: var(--color-primary);
    }
    
    .main-content {
        padding: 30px 20px 100px 20px;
    }
    
    .workout-grid, .bmi-grid, .calories-grid, .progress-charts-grid, .profile-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .activities-grid {
        grid-template-columns: 1fr;
    }
    
    .app-header {
        flex-direction: column;
        gap: 14px;
        align-items: flex-start;
    }
    
    .streak-badge {
        align-self: flex-start;
    }
}

@media (max-width: 480px) {
    .form-row {
        flex-direction: column;
        gap: 16px;
    }
    
    .form-row .form-group {
        width: 100%;
    }
    
    .calories-split-container {
        flex-direction: column;
        gap: 30px;
    }
}
