/* ============================================
   VARIABLES CSS - Thème Clair/Sombre
   ============================================ */
:root {
    --primary: #667eea;
    --primary-dark: #5568d3;
    --secondary: #764ba2;
    --accent: #f093fb;

    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;

    --text-primary: #2d3748;
    --text-secondary: #718096;
    --text-inverse: #ffffff;

    --border-color: #e2e8f0;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 15px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);

    --success: #48bb78;
    --danger: #f56565;
    --warning: #ed8936;
    --info: #4299e1;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-primary: #1a202c;
    --bg-secondary: #2d3748;
    --bg-tertiary: #4a5568;

    --text-primary: #f7fafc;
    --text-secondary: #cbd5e0;

    --border-color: #4a5568;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 15px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* ============================================
   RESET & BASE
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    min-height: 100vh;
    padding-bottom: 80px;
    transition: var(--transition);
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ============================================
   THEME TOGGLE
   ============================================ */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: var(--bg-primary);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    transition: var(--transition);
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(20deg);
    box-shadow: var(--shadow-lg);
}

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

/* ============================================
   HEADER
   ============================================ */
.app-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    padding: 25px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    margin: 20px 0;
    color: var(--text-inverse);
    animation: slideDown 0.5s ease-out;
}

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

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

.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    font-size: 2.5em;
    animation: pulse 2s ease-in-out infinite;
}

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

.app-header h1 {
    font-size: 1.8em;
    font-weight: 700;
    margin-bottom: 5px;
}

.subtitle {
    font-size: 0.9em;
    opacity: 0.9;
}

.header-stats {
    display: flex;
    gap: 20px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.8em;
    font-weight: 700;
}

.stat-label {
    display: block;
    font-size: 0.8em;
    opacity: 0.9;
}

.current-day {
    text-align: center;
    font-size: 1.1em;
    font-weight: 600;
    padding: 10px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    backdrop-filter: blur(10px);
}

/* ============================================
   NAVIGATION JOURS
   ============================================ */
.day-selector {
    display: flex;
    gap: 8px;
    margin: 20px 0;
    overflow-x: auto;
    padding: 10px 0;
    scrollbar-width: none;
}

.day-selector::-webkit-scrollbar {
    display: none;
}

.day-btn {
    flex: 1;
    min-width: 70px;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    padding: 12px 8px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
}

.day-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.day-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--text-inverse);
    border-color: transparent;
    transform: translateY(-3px);
}

.day-name {
    display: block;
}

.day-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 18px;
    height: 18px;
    background: var(--success);
    border-radius: 50%;
    font-size: 0.7em;
    display: none;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(72, 187, 120, 0.4);
}

.day-badge.completed {
    display: flex;
}

.day-badge::after {
    content: '✓';
}

.day-btn-rest {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border-color: transparent;
}

.day-btn-rest:hover {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
}

.day-btn-rest .rest-label {
    display: block;
    font-size: 0.75em;
    opacity: 0.9;
    margin-top: 2px;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
main {
    animation: fadeIn 0.5s ease-out;
}

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

.workout-display {
    margin-bottom: 20px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.empty-icon {
    font-size: 4em;
    display: block;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--text-primary);
    margin-bottom: 10px;
}

.empty-state p {
    color: var(--text-secondary);
}

/* ============================================
   WORKOUT CATEGORIES
   ============================================ */
.workout-category {
    background: var(--bg-primary);
    padding: 25px;
    margin-bottom: 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    animation: slideUp 0.5s ease-out backwards;
}

.workout-category:nth-child(1) { animation-delay: 0.1s; }
.workout-category:nth-child(2) { animation-delay: 0.2s; }
.workout-category:nth-child(3) { animation-delay: 0.3s; }
.workout-category:nth-child(4) { animation-delay: 0.4s; }

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

.workout-category h2 {
    color: var(--primary);
    font-size: 1.6em;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.exercise-list {
    list-style: none;
}

.exercise-item {
    background: var(--bg-secondary);
    padding: 18px 20px;
    margin-bottom: 12px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: var(--transition);
    cursor: grab;
    border: 2px solid transparent;
    position: relative;
}

.exercise-item:active {
    cursor: grabbing;
}

.exercise-item.dragging {
    opacity: 0.8;
    transform: scale(1.05) rotate(3deg);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.5);
    animation: dragPulse 0.6s ease-in-out infinite;
    cursor: grabbing;
    z-index: 1000;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--primary) 100%);
    border: 2px solid var(--primary);
}

.exercise-item.drag-over {
    border-top: 3px solid var(--primary);
    margin-top: 10px;
}

.exercise-item.drag-forbidden {
    border: 2px dashed var(--danger);
    background: rgba(245, 101, 101, 0.1);
    opacity: 0.6;
    cursor: not-allowed;
}

.drag-handle {
    color: var(--text-secondary);
    font-size: 1.2em;
    cursor: grab;
    padding: 5px;
    margin-right: 5px;
    transition: all 0.3s ease;
    display: inline-block;
}

.drag-handle:hover {
    color: var(--primary);
    transform: scale(1.2);
    filter: drop-shadow(0 0 8px rgba(102, 126, 234, 0.6));
    animation: wiggle 0.5s ease-in-out;
}

.drag-handle:active {
    cursor: grabbing;
    transform: scale(0.9);
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg) scale(1.2); }
    25% { transform: rotate(-5deg) scale(1.2); }
    75% { transform: rotate(5deg) scale(1.2); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

.exercise-item:hover {
    background: var(--bg-tertiary);
    transform: translateX(8px);
    border-color: var(--primary);
}

.exercise-item.completed {
    opacity: 0.6;
    background: var(--success);
    color: white;
}

.exercise-item::before {
    content: '';
    min-width: 30px;
    height: 30px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
    background-size: 18px;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0;
    transition: var(--transition);
}

.exercise-item.completed::before {
    opacity: 1;
    background-color: white;
}

.exercise-name {
    font-size: 1.1em;
    color: var(--text-primary);
    font-weight: 600;
    flex: 1;
}

.exercise-item.completed .exercise-name {
    color: white;
}

.exercise-details {
    color: var(--text-secondary);
    font-size: 0.95em;
    font-weight: 500;
    padding: 5px 12px;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
}

.exercise-item.completed .exercise-details {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* ============================================
   TIMER SECTION
   ============================================ */
.timer-section {
    background: var(--bg-primary);
    padding: 30px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    text-align: center;
    margin-bottom: 20px;
}

.timer-header {
    margin-bottom: 25px;
}

.timer-header h3 {
    color: var(--primary);
    font-size: 1.5em;
    margin-bottom: 15px;
}

.timer-presets {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.preset-btn {
    padding: 8px 16px;
    border: 2px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    color: var(--text-primary);
    transition: var(--transition);
}

.preset-btn:hover {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.preset-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.timer-circle {
    position: relative;
    width: 250px;
    height: 250px;
    margin: 20px auto;
}

.timer-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.timer-bg {
    fill: none;
    stroke: var(--bg-tertiary);
    stroke-width: 8;
}

.timer-progress {
    fill: none;
    stroke: url(#gradient);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 565.48;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear;
}

.timer-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3.5em;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
}

.timer-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    border: none;
    padding: 14px 28px;
    border-radius: var(--radius-md);
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

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

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--border-color);
    transform: translateY(-2px);
}

.btn-large {
    padding: 18px 40px;
    font-size: 1.1em;
}

.btn-icon {
    width: 50px;
    height: 50px;
    padding: 0;
    border-radius: 50%;
}

.btn-icon span {
    font-size: 1.5em;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9em;
}

.btn-full {
    width: 100%;
    margin-bottom: 10px;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    border-color: var(--danger);
    color: var(--danger);
}

/* ============================================
   NOTES SECTION
   ============================================ */
.notes-section {
    background: var(--bg-primary);
    padding: 25px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 20px;
}

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

.notes-header h3 {
    color: var(--primary);
    font-size: 1.3em;
}

.notes-textarea {
    width: 100%;
    min-height: 120px;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1em;
    resize: vertical;
    transition: var(--transition);
}

.notes-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.notes-saved {
    margin-top: 10px;
    color: var(--success);
    font-weight: 600;
    text-align: center;
    padding: 8px;
    background: rgba(72, 187, 120, 0.1);
    border-radius: var(--radius-sm);
}

/* ============================================
   FAB (Floating Action Button)
   ============================================ */
.fab {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--success) 0%, #38a169 100%);
    color: white;
    border: none;
    font-size: 2em;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(72, 187, 120, 0.4);
    transition: var(--transition);
    z-index: 999;
}

.fab:hover {
    transform: scale(1.1) rotate(360deg);
    box-shadow: 0 6px 25px rgba(72, 187, 120, 0.6);
}

.fab:active {
    transform: scale(0.95);
}

/* ============================================
   FOOTER NAVIGATION
   ============================================ */
.app-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    z-index: 900;
}

.footer-nav {
    display: flex;
    max-width: 900px;
    margin: 0 auto;
}

.footer-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 12px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    color: var(--text-secondary);
    font-size: 0.85em;
    transition: var(--transition);
}

.footer-btn:hover {
    background: var(--bg-secondary);
}

.footer-btn.active {
    color: var(--primary);
}

.footer-icon {
    font-size: 1.5em;
}

/* ============================================
   MODALS
   ============================================ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease-out;
}

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

.modal-header h2 {
    color: var(--text-primary);
    font-size: 1.5em;
}

.modal-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1.5em;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--danger);
    color: white;
    transform: rotate(90deg);
}

.modal-body {
    padding: 25px;
    overflow-y: auto;
}

/* ============================================
   STATISTICS
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    font-size: 2.5em;
}

.stat-number {
    font-size: 2em;
    font-weight: 700;
    color: var(--primary);
}

.stat-text {
    font-size: 0.85em;
    color: var(--text-secondary);
}

.progress-calendar {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: var(--radius-lg);
}

/* ============================================
   SETTINGS
   ============================================ */
.settings-group {
    margin-bottom: 30px;
}

.settings-group h3 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 1.2em;
}

.switch-label {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    cursor: pointer;
    transition: var(--transition);
}

.switch-label:hover {
    background: var(--bg-tertiary);
}

.switch-label input {
    display: none;
}

.switch {
    width: 50px;
    height: 28px;
    background: var(--border-color);
    border-radius: 14px;
    position: relative;
    transition: var(--transition);
}

.switch::before {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: var(--transition);
}

.switch-label input:checked + .switch {
    background: var(--primary);
}

.switch-label input:checked + .switch::before {
    left: 24px;
}

.about-text {
    color: var(--text-secondary);
    padding: 5px 0;
}

.about-text.small {
    font-size: 0.9em;
}

/* ============================================
   TOAST NOTIFICATION
   ============================================ */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-primary);
    color: var(--text-inverse);
    padding: 15px 25px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    font-weight: 600;
    z-index: 10000;
    opacity: 0;
    transition: var(--transition);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ============================================
   REST INFO
   ============================================ */
.rest-info {
    background: #fff3cd;
    padding: 15px 20px;
    border-radius: var(--radius-md);
    margin-top: 20px;
    border-left: 4px solid #ffc107;
}

[data-theme="dark"] .rest-info {
    background: rgba(255, 193, 7, 0.1);
    border-left-color: #ffc107;
}

.rest-info p {
    color: #856404;
    font-weight: 600;
    font-size: 1em;
}

[data-theme="dark"] .rest-info p {
    color: #ffc107;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .app-header h1 {
        font-size: 1.5em;
    }

    .logo {
        font-size: 2em;
    }

    .header-stats {
        gap: 10px;
    }

    .stat-value {
        font-size: 1.4em;
    }

    .day-selector {
        gap: 6px;
    }

    .day-btn {
        min-width: 60px;
        padding: 10px 6px;
        font-size: 0.85em;
    }

    .timer-circle {
        width: 200px;
        height: 200px;
    }

    .timer-display {
        font-size: 2.5em;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .theme-toggle {
        top: 10px;
        right: 10px;
        width: 45px;
        height: 45px;
    }

    .modal-content {
        max-height: 90vh;
    }
}

/* ============================================
   ANIMATIONS & UTILITIES
   ============================================ */
.fade-in {
    animation: fadeIn 0.3s ease-out;
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

.loading {
    pointer-events: none;
    opacity: 0.6;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection color */
::selection {
    background: var(--primary);
    color: white;
}

/* ============================================
   DRAG & DROP ANIMATIONS
   ============================================ */
@keyframes dragPulse {
    0%, 100% {
        box-shadow: 0 15px 40px rgba(102, 126, 234, 0.5);
    }
    50% {
        box-shadow: 0 20px 50px rgba(102, 126, 234, 0.8);
        transform: scale(1.08) rotate(3deg);
    }
}

@keyframes bounceIn {
    0% {
        transform: scale(0.9);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes confettiFloat {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--offset-x, 0), calc(var(--offset-y, 0) - 100px)) rotate(720deg) scale(0);
        opacity: 0;
    }
}

/* Confetti particles */
.confetti {
    position: fixed;
    font-size: 1.5em;
    pointer-events: none;
    z-index: 9999;
    animation: confettiFloat 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Animation de drop réussi */
.exercise-item.just-dropped {
    animation: bounceIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ============================================
   NOUVELLES FONCTIONNALITÉS V3.0
   ============================================ */

/* Footer avec 5 boutons */
.app-footer {
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.footer-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0;
}

.footer-btn {
    font-size: 0.75em;
    padding: 8px 4px;
}

.footer-icon {
    font-size: 1.3em;
}

/* Modal Large */
.modal-large {
    max-width: 95%;
    width: 800px;
}

/* Tabs Navigation */
.progress-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--primary);
    background: var(--bg-tertiary);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Weight History */
.weight-selector {
    margin-bottom: 20px;
}

.weight-selector label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.exercise-select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1em;
    cursor: pointer;
    transition: var(--transition);
}

.exercise-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.weight-history {
    max-height: 400px;
    overflow-y: auto;
}

.weight-record {
    background: var(--bg-secondary);
    padding: 15px;
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 2px solid var(--border-color);
    transition: var(--transition);
}

.weight-record:hover {
    border-color: var(--primary);
    transform: translateX(5px);
}

.weight-record-info {
    flex: 1;
}

.weight-record-value {
    font-size: 1.3em;
    font-weight: 700;
    color: var(--primary);
}

.weight-record-date {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-top: 4px;
}

.weight-record-delete {
    background: var(--danger);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.weight-record-delete:hover {
    background: #e53e3e;
    transform: scale(1.05);
}

.add-weight-section {
    margin-top: 20px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 2px dashed var(--border-color);
}

.add-weight-section h3 {
    margin-bottom: 15px;
    color: var(--text-primary);
}

.weight-input-group {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 10px;
}

.weight-input-group input {
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1em;
}

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

/* Charts */
.chart-container {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    min-height: 300px;
}

.stats-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.stat-card-mini {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    padding: 20px;
    border-radius: var(--radius-md);
    text-align: center;
    color: white;
}

.stat-label {
    font-size: 0.9em;
    opacity: 0.9;
    margin-bottom: 8px;
}

.stat-value-big {
    font-size: 2em;
    font-weight: 700;
}

/* Photo Gallery */
.photo-upload {
    margin-bottom: 20px;
}

.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.photo-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: var(--transition);
}

.photo-item:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-item-date {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    color: white;
    padding: 8px;
    font-size: 0.75em;
    text-align: center;
}

.photo-item-delete {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--danger);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    transition: var(--transition);
}

.photo-item:hover .photo-item-delete {
    opacity: 1;
}

/* Achievements */
.achievements-summary {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: var(--radius-lg);
    color: white;
}

.achievement-count {
    font-size: 1.2em;
    margin-bottom: 15px;
}

.count-number {
    font-size: 2.5em;
    font-weight: 700;
    display: block;
}

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

.achievement-progress-fill {
    height: 100%;
    background: white;
    border-radius: 10px;
    transition: width 0.5s ease;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.achievement-card {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: var(--radius-md);
    text-align: center;
    border: 2px solid var(--border-color);
    transition: var(--transition);
}

.achievement-card.unlocked {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.achievement-card.locked {
    opacity: 0.5;
    filter: grayscale(100%);
}

.achievement-icon {
    font-size: 3em;
    margin-bottom: 10px;
    display: block;
}

.achievement-card.unlocked .achievement-icon {
    animation: bounceIn 0.5s ease;
}

.achievement-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.achievement-description {
    font-size: 0.85em;
    color: var(--text-secondary);
}

.achievement-unlocked-date {
    font-size: 0.75em;
    color: var(--primary);
    margin-top: 8px;
    font-weight: 600;
}

/* Calculateur 1RM */
.calculator-description {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.calculator-inputs {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.input-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1.1em;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.calculator-result {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    padding: 30px;
    border-radius: var(--radius-lg);
    color: white;
}

.result-main {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
}

.result-label {
    font-size: 1em;
    opacity: 0.9;
    margin-bottom: 10px;
}

.result-value {
    font-size: 3em;
    font-weight: 700;
}

.percentage-table {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: var(--radius-md);
}

.percentage-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.percentage-row:last-child {
    border-bottom: none;
}

.percentage-row span:first-child {
    opacity: 0.9;
}

.percentage-row span:last-child {
    font-weight: 700;
    font-size: 1.1em;
}

/* Empty states */
.empty-state-small {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-state-small span {
    font-size: 3em;
    display: block;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* Quick add weight button on exercises */
.exercise-quick-add {
    background: var(--primary);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    margin-left: 8px;
}

.exercise-quick-add:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .footer-nav {
        grid-template-columns: repeat(5, 1fr);
    }

    .footer-btn {
        font-size: 0.7em;
        padding: 6px 2px;
    }

    .footer-icon {
        font-size: 1.1em;
    }

    .weight-input-group {
        grid-template-columns: 1fr;
    }

    .stats-summary {
        grid-template-columns: 1fr;
    }

    .achievements-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .photo-gallery {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .modal-large {
        max-width: 95%;
    }

    .result-value {
        font-size: 2em;
    }
}
