/**
 * 1-progressions.css
 * Styles principaux du mode Progressions
 * ✅ VERSION AMÉLIORÉE - Responsive optimisé
 */

/* ============================================
   📱 CONTAINER PRINCIPAL
   ============================================ */

[data-mode="progressions"] .page-layout {
    display: flex;
    flex-direction: column;
    gap: clamp(1rem, 3vw, 2rem);
    padding: clamp(0.5rem, 2vw, 1rem);
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

/* ============================================
   📊 GRILLE TEXTUELLE DE LA PROGRESSION
   ============================================ */

.text-grid-section {
    background: white;
    border-radius: clamp(6px, 1vw, 8px);
    padding: clamp(0.75rem, 2vw, 1.5rem);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    width: 100%;
    box-sizing: border-box;
}

.text-grid-title {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    font-weight: 600;
    color: #808000;
    margin-bottom: clamp(0.5rem, 1.5vw, 1rem);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #FFF8DC;
}

.text-grid-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

.chord-text-grid {
    width: 100%;
    border-collapse: collapse;
    min-width: 280px;
}

.chord-text-grid td {
    padding: clamp(0.5rem, 2vw, 1rem);
    text-align: center;
    border: 1px solid #e0e0e0;
    font-size: clamp(0.875rem, 2.5vw, 1.125rem);
    font-weight: 500;
    color: #333;
    background: #fafafa;
    position: relative;
}

.chord-text-grid td.chord-cell {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    transition: all 0.2s ease;
}

.chord-text-grid td.chord-cell:hover {
    background: linear-gradient(135deg, #fff8dc 0%, #ffffff 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(128, 128, 0, 0.15);
}

/* Bouton supprimer dans la cellule */
.delete-chord-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: clamp(20px, 4vw, 24px);
    height: clamp(20px, 4vw, 24px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    font-size: clamp(0.65rem, 1.5vw, 0.75rem);
}

.chord-text-grid td.chord-cell:hover .delete-chord-btn {
    opacity: 1;
}

.delete-chord-btn:hover {
    background: rgba(220, 53, 69, 1);
    transform: scale(1.1);
}

/* ============================================
   📱 RESPONSIVE - MOBILE
   ============================================ */

@media (max-width: 768px) {
    [data-mode="progressions"] .page-layout {
        padding: 0.5rem;
        gap: 1rem;
    }

    .text-grid-section {
        padding: 0.75rem;
        border-radius: 6px;
    }

    .text-grid-title {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }

    .chord-text-grid {
        min-width: 240px;
    }

    .chord-text-grid td {
        padding: 0.5rem;
        font-size: 0.875rem;
    }

    .delete-chord-btn {
        opacity: 1; /* Toujours visible sur mobile */
        width: 20px;
        height: 20px;
        font-size: 0.65rem;
    }
}

/* ============================================
   📱 RESPONSIVE - TRÈS PETIT MOBILE
   ============================================ */

@media (max-width: 480px) {
    [data-mode="progressions"] .page-layout {
        padding: 0.25rem;
        gap: 0.75rem;
    }

    .text-grid-section {
        padding: 0.5rem;
        border-radius: 4px;
    }

    .text-grid-title {
        font-size: 0.9rem;
        margin-bottom: 0.4rem;
    }

    .chord-text-grid {
        min-width: 200px;
    }

    .chord-text-grid td {
        padding: 0.4rem;
        font-size: 0.8rem;
    }

    .delete-chord-btn {
        width: 18px;
        height: 18px;
        font-size: 0.6rem;
        top: 2px;
        right: 2px;
    }
}

/* ============================================
   PRÉFÉRENCE MOUVEMENT RÉDUIT
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    .chord-text-grid td.chord-cell,
    .delete-chord-btn {
        transition: none;
    }

    .chord-text-grid td.chord-cell:hover {
        transform: none;
    }

    .delete-chord-btn:hover {
        transform: none;
    }
}

/* ============================================
   PRINT
   ============================================ */

@media print {
    .delete-chord-btn {
        display: none !important;
    }
}
