/**
 * Styles - WorkOut Tracker
 * Application de suivi d'entraînements
 */

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

html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f2f5;
    color: #1a1a2e;
    line-height: 1.6;
    min-height: 100vh;
}

/* ============================================================
   HEADER & NAVIGATION
   ============================================================ */
.main-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4rem;
    font-weight: bold;
}

.logo i {
    color: #e94560;
    font-size: 1.6rem;
}

.main-nav {
    display: flex;
    gap: 5px;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 8px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-link.active {
    background: #e94560;
    color: white;
}

.nav-link.nav-admin {
    background: rgba(155, 89, 182, 0.3);
    border: 1px solid #9b59b6;
}

.nav-link.nav-admin:hover {
    background: #9b59b6;
}

.nav-link.nav-admin.active {
    background: #9b59b6;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.username {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.9);
}

.logout-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.logout-btn:hover {
    background: #e94560;
}

/* ============================================================
   MAIN CONTENT LAYOUT
   ============================================================ */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 400px;
    grid-template-areas: 
        "calendar panel"
        "bodymap panel";
    gap: 20px;
    align-items: start;
}

/* ============================================================
   CALENDAR
   ============================================================ */
.calendar-section {
    width: 100%;
    grid-area: calendar;
}

.bodymap-section {
    grid-area: bodymap;
}

.calendar-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.calendar-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    padding: 20px;
    text-align: center;
}

.calendar-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.calendar-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.calendar-header p {
    font-size: 0.9rem;
    opacity: 0.8;
    margin: 5px 0;
}

.calendar-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.nav-button {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-button:hover {
    background: #e94560;
    transform: translateY(-2px);
}

.today-button {
    background: #e94560;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.today-button:hover {
    background: #d63050;
    transform: scale(1.05);
}

.view-toggle-button {
    background: rgba(233, 69, 96, 0.2);
    color: white;
    border: 2px solid #e94560;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.view-toggle-button:hover {
    background: #e94560;
    transform: scale(1.05);
}

.view-toggle-button i {
    font-size: 1rem;
}

/* ============================================================
   VUE SEMAINE - Design moderne style iOS
   ============================================================ */
.calendar-grid.week-view {
    display: flex;
    gap: 6px;
    background: transparent;
    padding: 25px 5px;
    justify-content: space-between;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    touch-action: pan-x;
    overflow: hidden;
    will-change: transform, opacity;
    max-width: 100%;
    box-sizing: border-box;
}

.calendar-grid.week-view .day-name {
    display: none; /* On cache les noms des jours séparés */
}

.calendar-grid.week-view .day-cell {
    min-height: auto;
    min-width: 0;
    flex: 1 1 0;
    max-width: calc((100% - 36px) / 7);
    padding: 12px 6px;
    border-radius: 16px;
    background: #f5f5f5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    border: 2px solid #ccc;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}

.calendar-grid.week-view .day-cell.today {
    background: linear-gradient(135deg, #f8d7da 0%, #f1aeb5 100%);
    border-color: #dc3545;
    color: #721c24;
}

.calendar-grid.week-view .day-cell.selected {
    background: linear-gradient(135deg, #e94560 0%, #d63050 100%);
    border-color: #e94560;
    color: white;
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(233, 69, 96, 0.3);
}

.calendar-grid.week-view .day-cell.selected .day-number,
.calendar-grid.week-view .day-cell.selected .day-label {
    color: white;
}

.calendar-grid.week-view .day-number {
    order: 1;
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    line-height: 1;
}

.calendar-grid.week-view .day-cell.today .day-number {
    color: #721c24;
}

/* Label du jour (Lun, Mar, etc.) */
.calendar-grid.week-view .day-label {
    order: 2;
    font-size: 0.75rem;
    font-weight: 500;
    color: #888;
    text-transform: capitalize;
}

.calendar-grid.week-view .day-cell.today .day-label {
    color: #721c24;
}

/* Indicateur de séance (badge avec icône haltère) */
.calendar-grid.week-view .workout-badge {
    order: 3;
    position: static;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.7rem;
    padding: 3px 8px;
    background: #4ade80;
    color: white;
    border-radius: 12px;
    margin-top: 4px;
    font-weight: 600;
}

.calendar-grid.week-view .workout-badge i {
    font-size: 0.65rem;
}

.calendar-grid.week-view .day-cell.today .workout-badge {
    background: #22c55e;
}

.calendar-grid.week-view .day-cell.selected .workout-badge {
    background: rgba(74, 222, 128, 0.9);
    color: white;
}

/* Header semaine modernisé */
.week-view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    margin-bottom: 10px;
}

.week-view-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
}

.week-view-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.week-view-actions .today-link {
    color: #a855f7;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    font-size: 1rem;
}

.week-view-actions .today-link:hover {
    text-decoration: underline;
}

.week-view-actions .calendar-icon {
    width: 36px;
    height: 36px;
    background: #f5f5f5;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.week-view-actions .calendar-icon:hover {
    background: #e0e0e0;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e0e0e0;
    padding: 1px;
}

.day-name {
    background: #16213e;
    color: white;
    padding: 12px;
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
}

.day-cell {
    background: white;
    padding: 10px;
    min-height: 80px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
}

.day-cell:hover:not(.other-month) {
    background: #f8f9fa;
    transform: scale(1.02);
    z-index: 1;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.day-cell.today {
    background: linear-gradient(135deg, #e94560 0%, #d63050 100%);
    color: white;
}

.day-cell.today:hover {
    background: linear-gradient(135deg, #d63050 0%, #c02040 100%);
}

.day-cell.selected {
    outline: none;
    
}

.day-cell.other-month {
    background: #f5f5f5;
    color: #aaa;
    border: none;
    outline: none;
    box-shadow: none;
}

.day-cell.other-month:hover {
    background: #f5f5f5;
    transform: none;
    box-shadow: none;
    cursor: default;
}

.day-cell.other-month:focus {
    outline: none;
    border: none;
}

.day-cell.has-workout {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
}

.day-cell.has-workout.today {
    background: linear-gradient(135deg, #e94560 0%, #d63050 100%);
}

.day-number {
    font-size: 1.1rem;
    font-weight: 600;
}

.workout-badge {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: #4caf50;
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.day-cell.today .workout-badge {
    background: white;
    color: #e94560;
}

/* ============================================================
   WORKOUT PANEL
   ============================================================ */
.workout-panel {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    transform: translateX(20px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    grid-area: panel;
}

.workout-panel.open {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
}

.panel-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.panel-header h2 {
    font-size: 1.1rem;
    font-weight: 500;
}

.close-panel {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.2rem;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.close-panel:hover {
    opacity: 1;
}

.panel-content {
    padding: 20px;
}

.no-selection {
    text-align: center;
    color: #888;
    padding: 40px 20px;
}

.empty-workout {
    text-align: center;
    padding: 40px 20px;
}

.empty-workout i {
    font-size: 3rem;
    color: #ddd;
    margin-bottom: 15px;
}

.empty-workout p {
    color: #888;
    margin-bottom: 20px;
}

/* ============================================================
   WORKOUT STATS
   ============================================================ */
.workout-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.stat-item {
    background: #f8f9fa;
    padding: 15px 10px;
    border-radius: 10px;
    text-align: center;
}

.stat-item i {
    color: #e94560;
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
    color: #1a1a2e;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: #888;
    margin-top: 2px;
}

/* ============================================================
   WORKOUT ACTIONS
   ============================================================ */
.workout-actions {
    margin-bottom: 20px;
}

/* ============================================================
   EXERCISE CARDS
   ============================================================ */
.exercises-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.exercise-card {
    background: #f8f9fa;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s;
}

.exercise-card:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.exercise-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-left: 4px solid #3498db;
    background: white;
}

.exercise-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.muscle-group-icon {
    font-size: 1.5rem;
}

.exercise-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 2px;
}

.muscle-group-name {
    font-size: 0.75rem;
    color: #888;
}

.exercise-actions {
    display: flex;
    gap: 5px;
}

.exercise-sets-summary {
    padding: 10px 15px;
    font-size: 0.85rem;
    color: #555;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.sets-count {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #1a1a2e;
    font-weight: 500;
}

.sets-detail {
    color: #888;
    font-size: 0.8rem;
}

.exercise-volume {
    padding: 8px 15px;
    font-size: 0.8rem;
    color: #4caf50;
    font-weight: 500;
    border-top: 1px solid #eee;
}

.no-exercises {
    text-align: center;
    color: #888;
    padding: 20px;
    font-style: italic;
}

/* ============================================================
   WORKOUT NOTES
   ============================================================ */
.workout-notes {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.workout-notes label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    margin-bottom: 10px;
    color: #1a1a2e;
}

.workout-notes textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.3s;
}

.workout-notes textarea:focus {
    outline: none;
    border-color: #e94560;
}

/* ============================================================
   WORKOUT FOOTER ACTIONS
   ============================================================ */
.workout-footer-actions {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    gap: 10px;
}

.workout-footer-actions .btn {
    flex: 1;
    max-width: 48%;
    padding: 12px 15px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #e94560 0%, #d63050 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(233, 69, 96, 0.4);
}

.btn-secondary {
    background: #f0f2f5;
    color: #1a1a2e;
}

.btn-secondary:hover {
    background: #e0e2e5;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4);
}

.btn-small {
    padding: 8px 15px;
    font-size: 0.8rem;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: #e0e2e5;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: #d0d2d5;
}

.btn-icon.btn-danger {
    background: #ffebee;
    color: #e74c3c;
}

.btn-icon.btn-danger:hover {
    background: #e74c3c;
    color: white;
}

.btn-add-set {
    width: 100%;
    padding: 12px;
    margin-top: 15px;
    background: #f0f2f5;
    border: 2px dashed #ccc;
    border-radius: 8px;
    cursor: pointer;
    color: #666;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-add-set:hover {
    border-color: #e94560;
    color: #e94560;
    background: #fff5f7;
}

/* ============================================================
   MODALS
   ============================================================ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal.open {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(-20px);
    transition: transform 0.3s;
}

.modal.open .modal-content {
    transform: translateY(0);
}

.modal-content.modal-large {
    max-width: 700px;
}

.modal-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-modal {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.2rem;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.close-modal:hover {
    opacity: 1;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ============================================================
   CONFIRM MODALS
   ============================================================ */
.confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.confirm-modal.active {
    opacity: 1;
    visibility: visible;
}

.confirm-modal-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    max-width: 450px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.2s ease;
}

.confirm-modal.active .confirm-modal-content {
    transform: scale(1);
}

.confirm-modal-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}

.confirm-modal-icon.warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffe5a3 100%);
    color: #f39c12;
}

.confirm-modal-icon.danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #dc3545;
}

.confirm-modal-content h3 {
    font-size: 1.5rem;
    color: #1a1a2e;
    margin-bottom: 15px;
}

.confirm-modal-content p {
    color: #555;
    font-size: 1rem;
    margin-bottom: 10px;
    line-height: 1.6;
}

.confirm-item-name {
    color: #666;
    font-size: 1rem;
    margin-bottom: 10px;
}

.confirm-item-name::before {
    content: '"';
}

.confirm-item-name::after {
    content: '"';
}

.confirm-warning-text {
    color: #e94560;
    font-size: 0.95rem;
    margin-top: 5px;
}

.confirm-warning {
    color: #f39c12;
    font-weight: 600;
    font-size: 0.95rem;
    margin-top: 15px;
}

.confirm-modal-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
}

.confirm-modal-actions .btn {
    min-width: 120px;
    padding: 12px 25px;
    font-size: 1rem;
    font-weight: 600;
}

/* ============================================================
   FORMS
   ============================================================ */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #1a1a2e;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #e94560;
}

.form-control:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

/* ============================================================
   EXERCISE PREVIEW
   ============================================================ */
.exercise-preview {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-top: 10px;
}

.exercise-description {
    color: #555;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.exercise-equipment {
    color: #888;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.exercise-equipment i {
    color: #e94560;
}

/* ============================================================
   SETS EDITOR
   ============================================================ */
.last-workout-info {
    background: #e3f2fd;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.last-workout-info h4 {
    font-size: 0.9rem;
    color: #1565c0;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.last-set {
    display: inline-block;
    background: white;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.85rem;
    margin: 3px;
    color: #1565c0;
}

.sets-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.set-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
}

.set-number {
    width: 30px;
    height: 30px;
    background: #1a1a2e;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.set-inputs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    flex: 1;
}

.input-group {
    flex: 1;
    min-width: 80px;
}

.input-group label {
    display: block;
    font-size: 0.7rem;
    color: #888;
    margin-bottom: 4px;
}

.input-group input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    text-align: center;
}

.input-group input:focus {
    outline: none;
    border-color: #e94560;
}

.set-options {
    display: flex;
    gap: 8px;
}

.checkbox-label {
    cursor: pointer;
    font-size: 1.2rem;
    opacity: 0.4;
    transition: opacity 0.2s;
}

.checkbox-label input {
    display: none;
}

.checkbox-label input:checked + span {
    opacity: 1;
}

.checkbox-label:has(input:checked) {
    opacity: 1;
}

.no-sets {
    text-align: center;
    color: #888;
    padding: 20px;
    font-style: italic;
}

/* ============================================================
   NOTIFICATIONS
   ============================================================ */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 10px;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    transform: translateX(120%);
    transition: transform 0.3s;
    z-index: 3000;
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    background: linear-gradient(135deg, #4caf50 0%, #43a047 100%);
}

.notification-error {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.notification-info {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

/* ============================================================
   LOADING
   ============================================================ */
.loading {
    text-align: center;
    padding: 40px;
    color: #888;
}

.loading i {
    font-size: 2rem;
    color: #e94560;
}

/* ============================================================
   LOGIN PAGE STYLES
   ============================================================ */
.login-container {
    max-width: 500px;
    margin: 50px auto;
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.login-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.login-header h1 {
    margin: 0;
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.login-header p {
    opacity: 0.8;
    font-size: 0.95rem;
}

.login-tabs {
    display: flex;
    background: #16213e;
}

.tab-button {
    flex: 1;
    padding: 15px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
}

.tab-button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.tab-button.active {
    background: #e94560;
    color: white;
}

.login-form, .register-form {
    padding: 30px;
    display: none;
}

.login-form.active, .register-form.active {
    display: block;
}

.submit-button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #e94560 0%, #d63050 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(233, 69, 96, 0.4);
}

.error-message {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.success-message {
    background: linear-gradient(135deg, #4caf50 0%, #43a047 100%);
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.info-box {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    font-size: 0.9rem;
    color: #555;
    border-left: 4px solid #e94560;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
        grid-template-areas: 
            "calendar"
            "bodymap"
            "panel";
        padding: 15px;
        width: 100%;
        max-width: 100%;
    }
    
    .workout-panel {
        position: fixed;
        top: 0;
        right: 0;
        width: 100%;
        max-width: 400px;
        height: 100vh;
        height: 100dvh;
        max-height: 100vh;
        max-height: 100dvh;
        border-radius: 0;
        transform: translateX(100%);
        z-index: 1050;
        display: flex;
        flex-direction: column;
    }
    
    .workout-panel.open {
        transform: translateX(0);
    }

    .workout-panel .panel-header {
        flex-shrink: 0;
    }

    .workout-panel .panel-content {
        flex: 1;
        overflow-y: auto;
        min-height: 0;
    }
}

@media (max-width: 768px) {
    .main-header {
        padding: 0 10px;
        width: 100%;
    }
    
    .header-content {
        flex-wrap: wrap;
        height: auto;
        padding: 10px 0;
        width: 100%;
    }
    
    .main-content {
        padding: 10px;
        width: 100%;
    }
    
    .calendar-container {
        width: 100%;
        max-width: 100%;
    }
    
    .calendar-header {
        padding: 15px 10px;
        width: 100%;
    }
    
    .calendar-navigation {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
    
    .calendar-navigation h1 {
        order: 1;
        font-size: 1.1rem;
        text-align: center;
    }
    
    .calendar-navigation .nav-button:first-child {
        order: 0;
        position: absolute;
        left: 10px;
    }
    
    .calendar-navigation .nav-button:last-child {
        order: 2;
        position: absolute;
        right: 10px;
    }
    
    .calendar-navigation {
        position: relative;
        padding: 0 60px;
    }
    
    .logo {
        font-size: 1.1rem;
    }
    
    .main-nav {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: 10px;
        gap: 2px;
    }
    
    .nav-link {
        padding: 8px 10px;
        font-size: 0.8rem;
    }
    
    .nav-link i {
        font-size: 0.96rem;
    }
    
    .nav-link span {
        display: none;
    }
    
    .user-menu {
        gap: 10px;
    }
    
    .username span {
        display: none;
    }
    
    .nav-button {
        padding: 6px 10px;
        font-size: 0.75rem;
    }
    
    .nav-button span {
        display: none;
    }
    
    .calendar-actions {
        flex-direction: row;
        gap: 6px;
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }
    
    .view-toggle-button,
    .today-button {
        padding: 6px 12px;
        font-size: 0.75rem;
        white-space: nowrap;
    }
    
    .view-toggle-button span {
        display: inline;
    }
    }
    
    /* Vue semaine responsive */
    .calendar-grid.week-view {
        gap: 4px;
        padding: 20px 3px;
    }
    
    .calendar-grid.week-view .day-cell {
        padding: 8px 4px;
        border-radius: 12px;
        max-width: calc((100% - 24px) / 7);
    }
    
    .calendar-grid.week-view .day-number {
        font-size: 1.1rem;
    }
    
    .calendar-grid.week-view .day-label {
        font-size: 0.6rem;
    }
    
    .calendar-grid.week-view .workout-badge {
        padding: 2px 5px;
        font-size: 0.6rem;
        gap: 2px;
    }
    
    .calendar-grid.week-view .workout-badge i {
        font-size: 0.55rem;
    }
    
    .day-cell {
        min-height: 60px;
        padding: 5px;
    }
    
    .day-number {
        font-size: 0.9rem;
    }
    
    .workout-badge {
        font-size: 0.6rem;
        padding: 2px 5px;
    }
    
    .workout-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 5px;
    }
    
    .stat-item {
        padding: 10px 5px;
    }
    
    .stat-value {
        font-size: 1rem;
    }
    
    .set-row {
        flex-wrap: wrap;
    }
    
    .set-inputs {
        width: 100%;
    }
    
    .input-group {
        min-width: 70px;
    }
    
    .workout-footer-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .workout-footer-actions .btn {
        max-width: 100%;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .welcome-banner {
        margin: 10px;
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .main-content {
        padding: 10px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .workout-panel {
        max-width: 100%;
    }
}

/* ============================================================
   TEMPLATES - SÉLECTION ET APPLICATION
   ============================================================ */
.btn-template {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
    color: white;
    border: none;
}

.btn-template:hover {
    background: linear-gradient(135deg, #8e44ad 0%, #7d3c98 100%);
    box-shadow: 0 4px 12px rgba(155, 89, 182, 0.3);
}

.workout-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.workout-actions .btn {
    flex: 1;
    min-width: 180px;
}

.modal-description {
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 20px;
    line-height: 1.5;
}

.templates-list-loading {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#templates-list-container {
    display: grid;
    gap: 15px;
    max-height: 500px;
    overflow-y: auto;
}

.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.template-card:hover {
    border-color: #9b59b6;
    box-shadow: 0 4px 15px rgba(155, 89, 182, 0.2);
    transform: translateY(-2px);
}

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

.template-header h4 {
    font-size: 1.1rem;
    color: #1a1a2e;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.template-header i {
    color: #9b59b6;
}

.template-exercises-count {
    background: #f1f5f9;
    color: #64748b;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.template-exercises-count.empty {
    background: #fee2e2;
    color: #dc2626;
}

/* Template vide */
.template-card.template-empty {
    background: #fafafa;
    border-color: #e5e5e5;
    cursor: not-allowed;
    opacity: 0.8;
}

.template-card.template-empty:hover {
    border-color: #e5e5e5;
    box-shadow: none;
    transform: none;
}

.template-warning {
    background: #fef3c7;
    color: #92400e;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0;
}

.template-warning i {
    color: #f59e0b;
}

.template-warning a {
    color: #d97706;
    font-weight: 600;
    text-decoration: underline;
}

.template-warning a:hover {
    color: #b45309;
}

.btn-disabled {
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
    border: none;
}

.btn-disabled:hover {
    background: #e5e7eb;
    transform: none;
}

.template-description {
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 10px 0;
}

.template-footer {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-state i {
    font-size: 3rem;
    color: #cbd5e1;
    margin-bottom: 16px;
}

.empty-state p {
    color: #64748b;
    font-size: 1rem;
    margin-bottom: 20px;
}

/* Responsive pour les templates */
@media (max-width: 768px) {
    .workout-actions .btn {
        min-width: 100%;
        flex: none;
    }
    
    .template-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .template-exercises-count {
        align-self: flex-start;
    }
}
/* ============================================================
   MODALE DE CÉLÉBRATION DES RECORDS
   ============================================================ */
.celebration-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.celebration-modal.active {
    opacity: 1;
    visibility: visible;
}

.celebration-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    position: relative;
    overflow: hidden;
    transform: scale(0.8);
    transition: transform 0.3s;
    box-shadow: 0 20px 60px rgba(233, 69, 96, 0.4);
}

.celebration-modal.active .celebration-content {
    transform: scale(1);
}

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

.trophy-animation {
    font-size: 4rem;
    animation: bounce 0.6s ease infinite alternate;
    display: inline-block;
}

@keyframes bounce {
    from { transform: translateY(0); }
    to { transform: translateY(-15px); }
}

.celebration-header h2 {
    color: #f39c12;
    font-size: 1.6rem;
    margin: 15px 0 10px 0;
    text-shadow: 0 2px 10px rgba(243, 156, 18, 0.3);
}

.celebration-header .exercise-name {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
}

.records-list {
    margin: 20px 0;
}

.record-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 10px;
}

.record-icon {
    font-size: 2rem;
}

.record-details {
    text-align: left;
}

.record-label {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
}

.record-value {
    display: block;
    color: #2ecc71;
    font-size: 1.4rem;
    font-weight: 700;
}

.celebration-btn {
    margin-top: 20px;
    padding: 15px 40px;
    font-size: 1.1rem;
    background: linear-gradient(135deg, #e94560 0%, #d63050 100%);
    border: none;
    border-radius: 10px;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
}

.celebration-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(233, 69, 96, 0.4);
}

/* Confettis */
.confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -10px;
    border-radius: 2px;
    animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(400px) rotate(720deg);
        opacity: 0;
    }
}

@media (max-width: 480px) {
    .celebration-content {
        padding: 30px 20px;
    }
    
    .trophy-animation {
        font-size: 3rem;
    }
    
    .celebration-header h2 {
        font-size: 1.3rem;
    }
    
    .record-value {
        font-size: 1.2rem;
    }
}

/* ============================================================
   BODY MAP SECTION - Index Page
   ============================================================ */
.bodymap-section {
    grid-area: bodymap;
}

.bodymap-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.bodymap-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bodymap-header h3 {
    margin: 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.bodymap-header h3 i {
    color: #e94560;
}

.bodymap-header .period-label {
    font-weight: 400;
    font-size: 0.85rem;
    opacity: 0.8;
}

.bodymap-controls .period-select {
    padding: 6px 12px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 6px;
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 0.85rem;
    cursor: pointer;
}

.bodymap-controls .period-select option {
    background: #1a1a2e;
    color: white;
}

.bodymap-content {
    padding: 20px;
}

.diagram-wrapper {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.diagram-view {
    text-align: center;
}

.diagram-view .view-label {
    display: block;
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.diagram-container {
    width: 150px;
    height: auto;
}

.diagram-container svg {
    width: 100%;
    height: auto;
    max-height: 280px;
}

/* Styles pour les muscles dans les SVG */
.diagram-svg {
    width: 100%;
    height: auto;
    max-height: 280px;
    display: block;
}

.diagram-container {
    width: 150px;
    height: auto;
}

/* Style de base pour tous les groupes musculaires - garder gradient par défaut */
.diagram-container path[id],
.diagram-container g[id] {
    transition: all 0.3s ease;
    cursor: pointer;
}

/* Hover effect avec glow */
.diagram-container path[id]:hover {
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.8)) brightness(1.1);
    opacity: 0.9;
}

.bodymap-legend {
    margin-top: 20px;
    text-align: center;
}

.bodymap-legend .legend-title {
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bodymap-legend .legend-bar {
    height: 12px;
    max-width: 200px;
    margin: 0 auto;
    border-radius: 6px;
    background: linear-gradient(to right, #e8e8e8, #ffebee, #ef9a9a, #f44336, #b71c1c);
}

.bodymap-legend .legend-labels {
    display: flex;
    justify-content: space-between;
    max-width: 200px;
    margin: 5px auto 0;
    font-size: 0.7rem;
    color: #999;
}

/* Responsive Body Map */
@media (max-width: 600px) {
    .bodymap-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .diagram-wrapper {
        gap: 15px;
    }
    
    .diagram-container {
        width: 120px;
    }
    
    .diagram-container svg {
        max-height: 220px;
    }
}

/* ============================================================
   PREMIUM LOCKED OVERLAY
   ============================================================ */
.bodymap-container.premium-locked {
    position: relative;
    min-height: 300px;
}

.premium-overlay {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.premium-message {
    text-align: center;
    padding: 40px;
    max-width: 400px;
}

.premium-message i.fa-lock {
    font-size: 3rem;
    color: #e94560;
    margin-bottom: 20px;
    opacity: 0.8;
}

.premium-message h4 {
    margin: 0 0 10px 0;
    font-size: 1.3rem;
    color: #1a1a2e;
}

.premium-message p {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 25px;
}

.btn-upgrade {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #e94560 0%, #d63050 100%);
    color: white;
    padding: 12px 25px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(233, 69, 96, 0.3);
}

.btn-upgrade:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(233, 69, 96, 0.4);
}

.btn-upgrade i {
    color: #ffd700;
}
