/* ==========================================================================
   MEDTRAINER PRO — WARM GOLD & HIGH CONTRAST DESIGN SYSTEM
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-dark: #070b11;
    --bg-navy: #0d1520;
    --bg-card: #131c28;
    --bg-card-hover: #1b2636;
    
    --brand-gold: #f59e0b;
    --brand-gold-hover: #d97706;
    --brand-gold-glow: rgba(245, 158, 11, 0.25);
    
    --emerald-green: #10b981;
    --amber-gold: #f59e0b;
    --crimson-red: #ef4444;
    
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-dark: #1f2937;
    
    --border-color: rgba(255, 255, 255, 0.08);
    --border-brand: rgba(245, 158, 11, 0.3);
    
    --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
    --radius-lg: 16px;
    --radius-md: 12px;
}

code {
    word-break: break-all !important;
    white-space: normal !important;
}

body {
    font-family: 'Outfit', 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Background Gradients & Colors */
.bg-dark-navy {
    background-color: var(--bg-navy) !important;
}
.bg-dark-card {
    background-color: var(--bg-card) !important;
}
.bg-brand {
    background-color: var(--brand-gold) !important;
}
.text-brand {
    color: var(--brand-gold) !important;
}
.border-brand {
    border-color: var(--brand-gold) !important;
}

/* KPI ICON BOX HIGH CONTRAST STYLING */
.kpi-icon-box {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 1.6rem;
    flex-shrink: 0;
}
.kpi-icon-box.gold {
    background-color: rgba(157, 248, 5, 0.15) !important;
    color: var(--brand-gold) !important;
    border: 1px solid var(--border-brand) !important;
}
.kpi-icon-box.green {
    background-color: rgba(16, 185, 129, 0.18) !important;
    color: #34d399 !important;
    border: 1px solid rgba(16, 185, 129, 0.4) !important;
}
.kpi-icon-box.amber {
    background-color: rgba(245, 158, 11, 0.18) !important;
    color: #f59e0b !important;
    border: 1px solid rgba(245, 158, 11, 0.4) !important;
}

/* HIGH CONTRAST ALERTS & BADGES FIX */
.alert-success {
    background-color: #065f46 !important;
    border-color: #059669 !important;
    color: #ffffff !important;
}
.alert-success i {
    color: #34d399 !important;
}

.alert-danger {
    background-color: #7f1d1d !important;
    border-color: #dc2626 !important;
    color: #ffffff !important;
}
.alert-danger i {
    color: #f87171 !important;
}

.alert-warning {
    background-color: #78350f !important;
    border-color: #d97706 !important;
    color: #ffffff !important;
}
.alert-warning i {
    color: #fbbf24 !important;
}

/* RPE BADGE HIGH CONTRAST FIX */
.badge-rpe {
    background-color: #0f172a !important;
    color: #ffffff !important;
    border: 1px solid #f59e0b !important;
    font-weight: 800 !important;
    padding: 5px 12px !important;
    border-radius: 6px !important;
    display: inline-block !important;
}

/* Glassmorphism Card */
.card-soft, .card-custom {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: all 0.3s var(--ease-smooth);
}
.card-soft:hover {
    border-color: var(--border-brand);
    box-shadow: 0 12px 35px var(--brand-gold-glow);
}

/* Buttons */
.btn-brand {
    background: linear-gradient(135deg, var(--brand-gold) 0%, #d97706 100%);
    color: #111827;
    border: none;
    font-weight: 700;
    padding: 10px 22px;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 15px var(--brand-gold-glow);
    transition: all 0.25s ease;
}
.btn-brand:hover {
    background: linear-gradient(135deg, #fbbf24 0%, #b45309 100%);
    color: #000000;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.4);
}

.btn-habit-check {
    border: 2px solid var(--border-color);
    background: var(--bg-navy);
    color: var(--text-main);
    font-weight: 600;
    padding: 12px 18px;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}
.btn-habit-check.active-yes {
    background-color: rgba(16, 185, 129, 0.2) !important;
    border-color: var(--emerald-green) !important;
    color: #34d399 !important;
}
.btn-habit-check.active-no {
    background-color: rgba(239, 68, 68, 0.2) !important;
    border-color: var(--crimson-red) !important;
    color: #f87171 !important;
}
.btn-habit-check.active-mid {
    background-color: rgba(245, 158, 11, 0.2) !important;
    border-color: var(--amber-gold) !important;
    color: #fbbf24 !important;
}

/* Brand Logo Styling */
.brand-logo {
    height: 42px;
    width: auto;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
    filter: drop-shadow(0 4px 10px rgba(245, 158, 11, 0.3));
}

/* ICON SHAPE FIX: Ensure FontAwesome 6 icons render with solid font weight */
.icon-shape {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}
.icon-shape i {
    font-size: 1.75rem !important;
    line-height: 1 !important;
    display: inline-block !important;
}

/* EPIC INTRO ANIMATION STYLING */
.epic-intro-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: radial-gradient(1200px 800px at 50% -10%, #382400 0%, #070b11 55%, #030508 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    overflow: hidden;
    animation: introFadeOut 0.8s ease 3.8s forwards;
}

.epic-pulse-ring {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: rgba(245, 158, 11, 0.15);
    border: 3px solid var(--brand-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 50px var(--brand-gold-glow);
    animation: pulseHeartbeat 1.5s ease-in-out infinite alternate;
}
.epic-pulse-ring i {
    font-size: 56px;
    color: var(--brand-gold);
    filter: drop-shadow(0 0 15px var(--brand-gold));
}

@keyframes pulseHeartbeat {
    0% { transform: scale(0.92); box-shadow: 0 0 20px rgba(245, 158, 11, 0.2); }
    100% { transform: scale(1.1); box-shadow: 0 0 60px rgba(245, 158, 11, 0.6); }
}

@keyframes introFadeOut {
    to { opacity: 0; visibility: hidden; pointer-events: none; }
}

/* Mobile App Bar */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(13, 21, 32, 0.95);
    backdrop-filter: blur(15px);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1040;
}
.mobile-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.2s ease;
    width: 20%;
}
.mobile-bottom-nav .nav-item i {
    font-size: 20px;
    margin-bottom: 3px;
}
.mobile-bottom-nav .nav-item.active {
    color: var(--brand-gold);
    font-weight: 700;
}

/* Module Tile Grid */
.module-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.module-tile {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 22px;
    display: flex;
    align-items: center;
    gap: 18px;
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.3s var(--ease-smooth);
    position: relative;
    overflow: hidden;
}
.module-tile:hover {
    background: var(--bg-card-hover);
    border-color: var(--brand-gold);
    transform: translateY(-4px);
    box-shadow: 0 12px 30px var(--brand-gold-glow);
    color: #ffffff;
}

.module-tile-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    background: rgba(245, 158, 11, 0.12);
    color: var(--brand-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

/* DASHBOARD WELCOME ACCESS OVERLAY */
.welcome-access-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: radial-gradient(1000px 600px at 50% 30%, #152233 0%, #070b11 70%, #030508 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    transition: opacity 0.5s ease;
}

.welcome-access-card {
    background: rgba(13, 21, 32, 0.85);
    border: 1px solid rgba(245, 158, 11, 0.4);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(245, 158, 11, 0.2);
    backdrop-filter: blur(20px);
    max-width: 480px;
    width: 90%;
}

.welcome-avatar-ring {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: rgba(245, 158, 11, 0.12);
    border: 2px solid var(--brand-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.35);
}

@keyframes welcomeProgress {
    from { width: 0%; }
    to { width: 100%; }
}
