/* Bouton Options */
.options-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--border-color);
    color: var(--text-primary);
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100;
}

.options-btn:hover {
    background: var(--accent-blue);
    color: white;
    transform: scale(1.1);
}

.options-btn.active {
    background: var(--accent-blue);
    color: white;
}

/* Menu déroulant des options */
.options-menu {
    position: absolute;
    top: 65px;
    right: 15px;
    background: var(--card-bg);
    border-radius: 15px;
    box-shadow: 0 8px 25px var(--shadow);
    border: 1px solid var(--border-color);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.3s ease;
    z-index: 99;
}

.options-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.options-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid var(--card-bg);
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 10px;
    margin: 6px;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.menu-item:hover {
    background: var(--bg-primary);
    transform: translateX(2px);
}

.menu-item:first-child {
    margin-top: 8px;
}

.menu-item:last-child {
    margin-bottom: 8px;
}

.menu-item.danger:hover {
    background: rgba(255, 138, 128, 0.1);
    color: var(--accent-red);
}

.menu-icon {
    font-size: 1.1rem;
    min-width: 20px;
    text-align: center;
}

.menu-text {
    flex: 1;
    font-weight: 500;
}

/* Overlay pour fermer le menu */
.options-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 98;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.options-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Boutons principaux optimisés mobile */
.import-btn {
    flex: 1;
    min-width: 140px; /* Augmenté de 120px */
    padding: 14px 16px; /* Augmenté pour faciliter le touch */
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 25px; /* Réduit de 50px pour économiser l'espace */
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    font-size: 0.95rem; /* Légèrement augmenté */
}

.import-btn:hover {
    background: #42a5f5;
    transform: translateY(-2px);
}

.today-btn {
    padding: 14px 16px; /* Augmenté pour faciliter le touch */
    background: var(--border-color);
    color: var(--text-secondary);
    border: none;
    border-radius: 25px; /* Réduit de 50px */
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-size: 0.95rem; /* Légèrement augmenté */
    white-space: nowrap;
    min-width: 120px; /* Largeur minimum */
}

.today-btn:hover {
    background: var(--accent-green);
    color: white;
    transform: translateY(-1px);
}

.today-btn.not-current-week {
    background: var(--accent-orange);
    color: white;
}

.today-btn.not-current-week:hover {
    background: #d49843;
    transform: translateY(-1px);
}

.file-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

/* Boutons de navigation plus grands pour mobile */
.nav-btn {
    background: var(--bg-secondary);
    border: none;
    border-radius: 50%;
    width: 55px; /* Augmenté de 50px */
    height: 55px; /* Augmenté de 50px */
    font-size: 1.8rem; /* Augmenté de 1.5rem */
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
}

.nav-btn:hover {
    background: var(--accent-blue);
    color: white;
    transform: translateY(-2px);
}

.nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

/* Badges */
.current-badge {
    background: var(--accent-green);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.today-badge {
    background: var(--accent-green);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.rest-badge {
    background: var(--accent-orange);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.night-badge {
    background: #673ab7;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.multiple-badge {
    background: var(--accent-red);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.duration-badge {
    background: rgba(255,255,255,0.8);
    color: #333;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
}

.dark-theme .duration-badge {
    background: rgba(0,0,0,0.3);
    color: #e0e0e0;
}

/* Créneaux horaires */
.time-slot {
    background: #e3f2fd;
    border: 2px solid var(--accent-blue);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dark-theme .time-slot {
    background: #1e3a5f;
}

.night-slot {
    background: #f3e5f5;
    border-color: #673ab7;
}

.dark-theme .night-slot {
    background: #2d1b36;
}

.time-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-blue);
    border-radius: 50%;
}

.night-dot {
    background: #673ab7;
}

.time-text {
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.total-hours {
    background: #c8e6c9;
    color: #2e7d32;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    display: inline-block;
    margin-top: 10px;
}

.dark-theme .total-hours {
    background: #2e5234;
    color: #81c784;
}

/* Barre de statistiques responsive */
.stats-bar {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 12px 8px; /* Réduit pour mobile */
    margin-bottom: 16px; /* Réduit de 20px */
    display: flex;
    justify-content: space-around;
    text-align: center;
    box-shadow: 0 2px 10px var(--shadow);
    flex-wrap: nowrap; /* Forcer sur une ligne */
    gap: 5px; /* Réduit de 10px */
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px; /* Réduit de 5px */
    min-width: 70px; /* Réduit de 80px */
    flex: 1; /* Distribution égale */
}

.stat-value {
    font-size: 1.3rem; /* Réduit de 1.5rem */
    font-weight: 700;
    color: var(--accent-blue);
}

.stat-label {
    font-size: 0.75rem; /* Réduit de 0.8rem */
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px; /* Réduit de 0.5px */
    line-height: 1.2;
}

/* Spinner de chargement */
.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

/* Indicateur de sauvegarde */
.save-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--accent-green);
    color: white;
    padding: 10px 15px;
    border-radius: 25px;
    font-size: 0.9rem;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.save-indicator.show {
    opacity: 1;
    transform: translateY(0);
}