/* ============================================================
   GYMBEEM ONE - Design Language System
   Minimal • Emotional • Premium • Motivating
   ============================================================ */

/* ============================================================
   CSS VARIABLES - Default (Titanium)
   ============================================================ */
:root {
    --bg-primary: #f5f2ed;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-input: #efebe8;
    --text-primary: #1a1a1a;
    --text-secondary: #6b6b6b;
    --text-muted: #9a9a9a;
    --border-color: #e8e4df;
    --shadow: 0 2px 20px rgba(0,0,0,0.04);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.06);
    
    --color-primary: #8a8a8a;
    --color-primary-light: #b0b0b0;
    --color-primary-dark: #5a5a5a;
    --color-success: #4a7c59;
    --color-danger: #b05a5a;
    --color-warning: #b08a4a;
    --color-ring: var(--color-primary);
    
    --radius: 16px;
    --radius-sm: 10px;
    --radius-lg: 24px;
    --transition: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', sans-serif;
}

html.dark {
    --bg-primary: #0a0a0f;
    --bg-secondary: #14141a;
    --bg-card: #1a1a22;
    --bg-input: #22222a;
    --text-primary: #f0f0f0;
    --text-secondary: #9a9aa0;
    --text-muted: #6a6a70;
    --border-color: #2a2a32;
    --shadow: 0 2px 20px rgba(0,0,0,0.2);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.3);
}

/* ============================================================
   THEMES
   ============================================================ */
html.ocean {
    --color-primary: #4a8a9a;
    --color-primary-light: #7ab0c0;
    --color-primary-dark: #2a5a6a;
    --color-ring: var(--color-primary);
}
html.ocean .card-primary { background: linear-gradient(145deg, #2a5a6a, #4a8a9a); }
html.ocean .ring .progress { stroke: #4a8a9a; }
html.ocean .btn-primary { background: #4a8a9a; }
html.ocean .btn-primary:active { background: #2a5a6a; }

html.emerald {
    --color-primary: #4a9a6a;
    --color-primary-light: #7ac09a;
    --color-primary-dark: #2a6a4a;
    --color-ring: var(--color-primary);
}
html.emerald .card-primary { background: linear-gradient(145deg, #2a6a4a, #4a9a6a); }
html.emerald .ring .progress { stroke: #4a9a6a; }
html.emerald .btn-primary { background: #4a9a6a; }
html.emerald .btn-primary:active { background: #2a6a4a; }

html.titanium .card-primary { background: linear-gradient(145deg, #5a5a5a, #8a8a8a); }
html.titanium .ring .progress { stroke: #8a8a8a; }
html.titanium .btn-primary { background: #8a8a8a; }
html.titanium .btn-primary:active { background: #5a5a5a; }

/* ============================================================
   RESET
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background var(--transition), color var(--transition);
}
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: 16px; }

/* ============================================================
   APP CONTAINER
   ============================================================ */
.app-container {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 20px 100px 20px;
    min-height: 100vh;
    min-height: 100dvh;
}
@media (min-width: 768px) { .app-container { max-width: 640px; padding: 0 32px 100px 32px; } }
@media (min-width: 1024px) { .app-container { max-width: 800px; padding: 0 40px 100px 40px; } }

/* ============================================================
   HEADER
   ============================================================ */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0 24px 0;
}
.app-brand {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 2px;
    color: var(--text-secondary);
    text-transform: uppercase;
}
.header-right { display: flex; gap: 8px; align-items: center; }
.header-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--text-secondary);
    transition: all var(--transition);
}
.header-btn:active { transform: scale(0.92); }
.back-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 16px;
    padding: 4px 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}
.back-btn:hover { color: var(--text-primary); }

/* ============================================================
   BOTTOM NAVIGATION
   ============================================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 480px;
    margin: 0 auto;
    height: 72px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 20px 8px 20px;
    z-index: 1000;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}
@media (min-width: 480px) { .bottom-nav { left: 50%; transform: translateX(-50%); } }
.bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 12px;
    transition: all var(--transition);
}
.bottom-nav a i { font-size: 20px; transition: all var(--transition); }
.bottom-nav a.active { color: var(--color-primary); }
.bottom-nav a.active i { transform: scale(1.05); }

/* ============================================================
   MORE OVERLAY
   ============================================================ */
.more-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
}
.more-overlay.open { opacity: 1; visibility: visible; }
.more-menu {
    position: absolute;
    bottom: 80px;
    left: 20px;
    right: 20px;
    max-width: 400px;
    margin: 0 auto;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 8px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    transform: translateY(20px);
    transition: all var(--transition);
}
.more-overlay.open .more-menu { transform: translateY(0); }
.more-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}
.more-close { font-size: 18px; color: var(--text-muted); padding: 4px; }
.more-items { display: flex; flex-direction: column; padding: 8px 0; }
.more-items a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    transition: background var(--transition);
}
.more-items a:active { background: var(--bg-input); }
.more-items a i { width: 20px; font-size: 16px; color: var(--color-primary); }

/* ============================================================
   HERO
   ============================================================ */
.hero { padding: 8px 0 24px 0; }
.hero-greeting {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}
.hero-name {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 2px 0 4px 0;
    letter-spacing: -0.5px;
}
.hero-sub {
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 400;
    letter-spacing: 0.2px;
}

/* ============================================================
   SECTION
   ============================================================ */
.section { margin-bottom: 28px; }
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}
.section-action {
    font-size: 13px;
    color: var(--color-primary);
    font-weight: 500;
}

/* ============================================================
   CARD
   ============================================================ */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    transition: all var(--transition);
}
.card:active { transform: scale(0.98); }
.card-primary {
    background: linear-gradient(145deg, var(--color-primary-dark), var(--color-primary));
    color: #fff;
    border: none;
}
.card-primary .section-title { color: #fff; }
.card-primary .section-action { color: rgba(255,255,255,0.7); }

/* ============================================================
   LIST
   ============================================================ */
.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}
.list-item:last-child { border-bottom: none; }
.list-item .left { display: flex; flex-direction: column; gap: 2px; }
.list-item .title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
}
.list-item .sub {
    font-size: 13px;
    color: var(--text-secondary);
}
.list-item .right {
    font-size: 14px;
    color: var(--color-primary);
    font-weight: 500;
}

/* ============================================================
   RINGS
   ============================================================ */
.ring-container {
    display: flex;
    gap: 24px;
    justify-content: center;
    padding: 8px 0;
}
.ring-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.ring {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.ring svg { transform: rotate(-90deg); }
.ring .bg { fill: none; stroke: var(--bg-input); stroke-width: 4; }
.ring .progress {
    fill: none;
    stroke-width: 4;
    stroke-linecap: round;
    stroke: var(--color-ring, var(--color-primary));
    transition: stroke-dashoffset 1s ease;
}
.ring .label {
    position: absolute;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}
.ring-label {
    font-size: 11px;
    color: var(--text-secondary);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    transition: all var(--transition);
    letter-spacing: -0.2px;
}
.btn:active { transform: scale(0.96); }
.btn-primary {
    background: var(--color-primary);
    color: #fff;
}
.btn-primary:active { background: var(--color-primary-dark); }
.btn-block { width: 100%; justify-content: center; }
.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}
.btn-outline:hover { border-color: var(--color-primary); }
.btn-small { padding: 8px 16px; font-size: 13px; }

/* ============================================================
   FORMS
   ============================================================ */
.form-control {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 15px;
    color: var(--text-primary);
    transition: all var(--transition);
}
.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    background: var(--bg-card);
}
.form-control::placeholder { color: var(--text-muted); }

/* ============================================================
   GRID
   ============================================================ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* ============================================================
   UTILITY
   ============================================================ */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-primary-color { color: var(--color-primary); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; justify-content: center; }

/* ============================================================
   ANIMATIONS
   ============================================================ */
.page-transition {
    animation: fadeSlide 0.4s ease;
}
@keyframes fadeSlide {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-primary); border-radius: 10px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 480px) {
    .grid-2 { grid-template-columns: 1fr 1fr; gap: 8px; }
    .grid-3 { grid-template-columns: 1fr 1fr; gap: 8px; }
    .hero-name { font-size: 24px; }
}
@media (max-width: 360px) {
    .ring-container { gap: 12px; }
    .ring { width: 48px; height: 48px; }
    .ring .label { font-size: 12px; }
    .bottom-nav a { padding: 4px 8px; }
    .bottom-nav a i { font-size: 18px; }
}
