/* ============================================
   ATHON - Transformation Physique
   Mode Sombre & Clair avec toggle
   ============================================ */

/* DARK MODE (default) */
:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #121212;
    --bg-card: #1a1a1a;
    --bg-input: #252525;
    
    --accent-primary: #00d4aa;
    --accent-secondary: #00b4d8;
    --accent-danger: #ff4757;
    --accent-warning: #ffa502;
    
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;
    
    --border-color: #2a2a2a;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* LIGHT MODE */
[data-theme="light"] {
    --bg-primary: #f5f5f7;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-input: #f0f0f0;
    
    --accent-primary: #00b894;
    --accent-secondary: #0984e3;
    --accent-danger: #d63031;
    --accent-warning: #fdcb6e;
    
    --text-primary: #1a1a1a;
    --text-secondary: #636e72;
    --text-muted: #b2bec3;
    
    --border-color: #dfe6e9;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

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

html {
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: 70px;
}

/* ============================================
   HEADER
   ============================================ */
.app-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 2px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.user-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.theme-toggle {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--text-primary);
    transition: all 0.2s;
}

.theme-toggle:active {
    transform: scale(0.9);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.app-main {
    flex: 1;
    padding: 20px;
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
}

/* ============================================
   BOTTOM NAVIGATION
   ============================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    padding: 8px 0 12px;
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-muted);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

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

.nav-icon {
    font-size: 1.25rem;
    margin-bottom: 2px;
}

.nav-label {
    font-size: 0.65rem;
    font-weight: 500;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
}

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

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ============================================
   STATS GRID
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--accent-primary);
    line-height: 1;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 6px;
}

.stat-change {
    font-size: 0.7rem;
    margin-top: 4px;
}

.stat-change.positive {
    color: var(--accent-primary);
}

.stat-change.negative {
    color: var(--accent-danger);
}

/* ============================================
   FORMS & INPUTS
   ============================================ */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: var(--bg-primary);
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-danger {
    background: var(--accent-danger);
    color: white;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.8rem;
}

.btn-full {
    width: 100%;
}

/* ============================================
   LISTS & ITEMS
   ============================================ */
.item-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.list-item {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px;
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.list-item-content h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.list-item-content p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.list-item-meta {
    text-align: right;
}

.list-item-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.list-item-date {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ============================================
   WORKOUT CARDS
   ============================================ */
.workout-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 20px;
    border: 1px solid var(--border-color);
    margin-bottom: 12px;
}

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

.workout-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.workout-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.workout-muscles {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.muscle-tag {
    background: rgba(0, 212, 170, 0.15);
    color: var(--accent-primary);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 500;
}

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

.exercise-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
}

.exercise-name {
    font-size: 0.9rem;
    font-weight: 500;
}

.exercise-sets {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ============================================
   EXERCISE FORM (Training)
   ============================================ */
.exercise-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.exercise-row {
    display: grid;
    grid-template-columns: 1fr auto 70px;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
}

.exercise-row.no-weight {
    grid-template-columns: 1fr auto 70px;
}

.ex-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
}

.ex-reps {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.ex-weight {
    width: 100%;
    padding: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.9rem;
    text-align: center;
}

.ex-weight:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* ============================================
   MEAL CARDS
   ============================================ */
.meal-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px;
    border: 1px solid var(--border-color);
    margin-bottom: 12px;
}

.meal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.meal-type {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-secondary);
}

.meal-calories {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.meal-items {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.meal-macros {
    display: flex;
    gap: 16px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.macro {
    font-size: 0.75rem;
}

.macro-label {
    color: var(--text-muted);
}

.macro-value {
    color: var(--text-primary);
    font-weight: 600;
}

/* ============================================
   PROGRESS SECTION
   ============================================ */
.progress-ring {
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
}

.progress-ring-bg {
    fill: none;
    stroke: var(--bg-input);
    stroke-width: 8;
}

.progress-ring-fill {
    fill: none;
    stroke: url(#gradient);
    stroke-width: 8;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
    transition: stroke-dashoffset 1s ease;
}

.goal-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px;
    border: 1px solid var(--border-color);
    margin-bottom: 12px;
}

.goal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.goal-title {
    font-weight: 600;
}

.goal-status {
    font-size: 0.7rem;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 500;
}

.goal-status.active {
    background: rgba(0, 212, 170, 0.15);
    color: var(--accent-primary);
}

.goal-status.completed {
    background: rgba(0, 180, 216, 0.15);
    color: var(--accent-secondary);
}

.progress-bar {
    height: 6px;
    background: var(--bg-input);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* ============================================
   PHOTO GRID
   ============================================ */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.photo-card {
    aspect-ratio: 3/4;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    border: 2px dashed var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.photo-card.has-image {
    border-style: solid;
    border-color: var(--accent-primary);
}

.photo-placeholder {
    color: var(--text-muted);
    font-size: 2rem;
}

.photo-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    padding: 20px 12px 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* ============================================
   WORKOUT CHOICES (Dashboard)
   ============================================ */
.workout-choices {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.workout-choice {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    border-radius: var(--radius-md);
    text-decoration: none;
    text-align: center;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.workout-choice.muscu {
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.15), rgba(0, 180, 216, 0.1));
    border-color: var(--accent-primary);
}

.workout-choice.cardio {
    background: linear-gradient(135deg, rgba(255, 71, 87, 0.15), rgba(255, 165, 2, 0.1));
    border-color: var(--accent-danger);
}

.workout-choice:active {
    transform: scale(0.97);
}

.workout-choice-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.workout-choice-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.workout-choice-sub {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* ============================================
   QUICK ACTIONS
   ============================================ */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.quick-action {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px 8px;
    text-align: center;
    text-decoration: none;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.quick-action:active {
    transform: scale(0.95);
    border-color: var(--accent-primary);
}

.quick-action-icon {
    font-size: 1.5rem;
    margin-bottom: 6px;
}

.quick-action-label {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* ============================================
   SECTION TITLE
   ============================================ */
.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 20px;
    background: linear-gradient(180deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 2px;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-text {
    font-size: 0.9rem;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card,
.list-item,
.workout-card,
.meal-card {
    animation: fadeIn 0.3s ease;
}

/* ============================================
   UTILITIES
   ============================================ */
.text-center {
    text-align: center;
}

.mb-0 {
    margin-bottom: 0;
}

.mt-20 {
    margin-top: 20px;
}

.hidden {
    display: none !important;
}

/* ============================================
   FLOATING ACTION BUTTON
   ============================================ */
.fab-container {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 1000;
}

.fab-main {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    color: var(--bg-primary);
    font-size: 1.8rem;
    font-weight: 300;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 212, 170, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fab-main:active {
    transform: scale(0.9);
}

.fab-menu {
    position: absolute;
    bottom: 65px;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.fab-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.fab-item {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    text-decoration: none;
    box-shadow: var(--shadow);
    transition: all 0.2s;
}

.fab-item:active {
    transform: scale(0.9);
}

/* Date display */
.date-display {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
}

.badge-green {
    background: rgba(0, 212, 170, 0.15);
    color: var(--accent-primary);
}
