/**
 * BCA Lucky Flash - Styles CSS
 * Version: 1.0.0
 */

/* ==========================================================================
   CONTENEUR PRINCIPAL
   ========================================================================== */

.bca-flash-container {
    max-width: 900px;
    margin: 30px auto;
    padding: 30px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* ==========================================================================
   VUE DES CARTES FLASH
   ========================================================================== */

.bca-flash-view {
    display: block;
}

/* En-tête */
.bca-flash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.bca-flash-title {
    margin: 0;
    font-size: 28px;
    color: #333;
    font-weight: 700;
}

.bca-flash-settings-btn {
    display: inline;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    color: #495057;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.bca-flash-settings-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.bca-flash-settings-btn svg {
    width: 20px;
    height: 20px;
}

.bca-flash-settings-btn-txt {
    display:inline;
}

/**
* help button
*/
.bca-help-btn {
    /*display: flex;*/
    display: inline;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    color: #495057;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.bca-help-btn:hover {
    background: #00d4ff;
    border-color: #adb5bd;
}

.bca-help-btn svg {
    width: 20px;
    height: 20px;
}

/* Wrapper de la roue */
.bca-wheel-wrapper {
    position: relative;
    width: 500px;
    height: 500px;
    margin: 0 auto 30px;
}


/* ==========================================================================
   GRILLE DE CARTES
   ========================================================================== */

.bca-flash-cards-wrapper {
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.bca-flash-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    max-width: 100%;
}

/* Carte individuelle */
.bca-flash-card {
    position: relative;
    aspect-ratio: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.bca-flash-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.bca-flash-card:hover::before {
    opacity: 1;
}

.bca-flash-card-text {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    text-align: center;
    word-break: break-word;
    position: relative;
    z-index: 2;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* État actif (pendant le clignotement) */
.bca-flash-card.active {
    animation: bca-flash-pulse 0.15s ease-in-out;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.8), 0 0 50px rgba(255, 215, 0, 0.5);
}

@keyframes bca-flash-pulse {
    0%, 100% {
        transform: scale(1);
        filter: brightness(1);
    }
    50% {
        transform: scale(1.05);
        filter: brightness(1.5);
    }
}

/* État gagnant (résultat final) */
.bca-flash-card.winner {
    animation: bca-flash-winner 1s ease-in-out infinite;
    box-shadow: 0 0 40px rgba(255, 215, 0, 1), 0 0 80px rgba(255, 215, 0, 0.7);
    transform: scale(1.05);
    z-index: 10;
}

@keyframes bca-flash-winner {
    0%, 100% {
        filter: brightness(1.3) saturate(1.5);
        box-shadow: 0 0 40px rgba(255, 215, 0, 1), 0 0 80px rgba(255, 215, 0, 0.7);
    }
    50% {
        filter: brightness(1.6) saturate(2);
        box-shadow: 0 0 50px rgba(255, 215, 0, 1), 0 0 100px rgba(255, 215, 0, 0.9);
    }
}

/* Couleurs variées pour les cartes */
.bca-flash-card:nth-child(8n+1) { background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%); }
.bca-flash-card:nth-child(8n+2) { background: linear-gradient(135deg, #4ECDC4 0%, #44A08D 100%); }
.bca-flash-card:nth-child(8n+3) { background: linear-gradient(135deg, #45B7D1 0%, #2E86AB 100%); }
.bca-flash-card:nth-child(8n+4) { background: linear-gradient(135deg, #FFA07A 0%, #FA709A 100%); }
.bca-flash-card:nth-child(8n+5) { background: linear-gradient(135deg, #98D8C8 0%, #6BCF7F 100%); }
.bca-flash-card:nth-child(8n+6) { background: linear-gradient(135deg, #F7DC6F 0%, #F8B739 100%); }
.bca-flash-card:nth-child(8n+7) { background: linear-gradient(135deg, #BB8FCE 0%, #8E44AD 100%); }
.bca-flash-card:nth-child(8n+8) { background: linear-gradient(135deg, #85C1E2 0%, #52B788 100%); }

/* ==========================================================================
   AFFICHAGE DU RÉSULTAT
   ========================================================================== */

.bca-flash-result-display {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    color: white;
}

.bca-flash-result-label {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    opacity: 0.9;
}

.bca-flash-result-value {
    font-size: 32px;
    font-weight: 700;
    min-height: 40px;
    word-break: break-word;
}

/* ==========================================================================
   CONTRÔLES DE FLASH
   ========================================================================== */

.bca-flash-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.bca-flash-input-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.bca-flash-input-group label {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.bca-flash-count-input {
    width: 100px;
    padding: 10px 15px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 16px;
    text-align: center;
    transition: border-color 0.3s ease;
}

.bca-flash-count-input:focus {
    outline: none;
    border-color: #667eea;
}

.bca-flash-btn {
    width: 100%;
    padding: 18px 32px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    border: none;
    border-radius: 8px;
    color: #333;
    font-size: 20px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

.bca-flash-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 215, 0, 0.6);
}

.bca-flash-btn:active:not(:disabled) {
    transform: translateY(0);
}

.bca-flash-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.bca-flash-btn-icon {
    font-size: 28px;
}

.bca-flash-btn-loader {
    display: inline-block;
}

.bca-flash-spinner-icon {
    width: 24px;
    height: 24px;
    animation: bca-flash-rotate 1s linear infinite;
}

.bca-flash-spinner-icon circle {
    stroke: #333;
    stroke-dasharray: 90, 150;
    stroke-dashoffset: 0;
    stroke-linecap: round;
}

@keyframes bca-flash-rotate {
    100% {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   TABLEAU DE STATISTIQUES
   ========================================================================== */

.bca-flash-statistics-container {
    margin-top: 40px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 8px;
}

.bca-flash-statistics-title {
    margin: 0 0 20px 0;
    font-size: 22px;
    color: #333;
    font-weight: 700;
}

.bca-flash-statistics-table-wrapper {
    overflow-x: auto;
    margin-bottom: 20px;
}

.bca-flash-statistics-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 6px;
    overflow: hidden;
}

.bca-flash-statistics-table th {
    padding: 12px 16px;
    background: #667eea;
    color: white;
    font-weight: 600;
    text-align: left;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bca-flash-statistics-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #e9ecef;
    color: #495057;
    font-size: 15px;
}

.bca-flash-statistics-table tbody tr:last-child td {
    border-bottom: none;
}

.bca-flash-statistics-table tbody tr:hover {
    background: #f8f9fa;
}

.bca-flash-reset-stats-btn {
    padding: 10px 20px;
    background: #dc3545;
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.bca-flash-reset-stats-btn:hover {
    background: #c82333;
}

/* ==========================================================================
   VUE DE CONFIGURATION
   ========================================================================== */

.bca-flash-config-view {
    display: none;
}

.bca-flash-config-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.bca-flash-back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    color: #495057;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.bca-flash-back-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.bca-flash-back-btn svg {
    width: 20px;
    height: 20px;
}

.bca-flash-config-title {
    margin: 0;
    font-size: 28px;
    color: #333;
    font-weight: 700;
}

/* Formulaire de configuration */
.bca-flash-config-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.bca-flash-config-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bca-flash-config-label {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bca-flash-choice-counter {
    font-size: 14px;
    color: #6c757d;
    font-weight: 400;
}

.bca-flash-preset-select {
    padding: 12px 16px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 15px;
    background: white;
    color: #495057;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.bca-flash-preset-select:focus {
    outline: none;
    border-color: #667eea;
}

.bca-flash-custom-textarea {
    padding: 12px 16px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    min-height: 150px;
    transition: border-color 0.3s ease;
}

.bca-flash-custom-textarea:focus {
    outline: none;
    border-color: #667eea;
}

.bca-flash-config-help {
    margin: 0;
    font-size: 13px;
    color: #6c757d;
    font-style: italic;
}

/* Séparateur */
.bca-flash-config-divider {
    position: relative;
    text-align: center;
    margin: 10px 0;
}

.bca-flash-config-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #dee2e6;
}

.bca-flash-config-divider span {
    position: relative;
    display: inline-block;
    padding: 0 15px;
    background: white;
    color: #6c757d;
    font-size: 14px;
    font-weight: 600;
}

/* Boutons d'action */
.bca-flash-config-actions {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.bca-flash-apply-btn,
.bca-flash-reset-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.bca-flash-apply-btn {
    background: #28a745;
    color: white;
}

.bca-flash-apply-btn:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.bca-flash-reset-btn {
    background: #6c757d;
    color: white;
}

.bca-flash-reset-btn:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(108, 117, 125, 0.3);
}

.bca-flash-apply-btn svg,
.bca-flash-reset-btn svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.5;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
    .bca-flash-container {
        padding: 20px;
    }
    
    .bca-flash-cards-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 12px;
    }
    
    .bca-flash-header {
        /*flex-direction: column;*/
        flex-direction: row;
        gap: 15px;
        align-items: flex-start;
    }
    
    .bca-flash-title,
    .bca-flash-config-title {
        font-size: 22px;
    }
    
    .bca-flash-settings-btn {
        padding:10px 10px;
        display: inline;
    }
    
    .bca-help-btn {
        padding:10px 10px;
        display: inline;
    }
    
    .bca-flash-settings-btn-txt {
        display: none;
    }
    
    
    .bca-flash-result-value {
        font-size: 24px;
    }
    
    .bca-flash-input-group {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .bca-flash-config-actions {
        flex-direction: column;
    }
    
    .bca-flash-card-text {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .bca-flash-container {
        padding: 15px;
    }
    
    .bca-flash-cards-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 10px;
    }
    
    .bca-flash-title,
    .bca-flash-config-title {
        font-size: 20px;
    }
    
    .bca-settings-btn-txt {
        display: none;
    }
    
    .bca-flash-result-value {
        font-size: 20px;
    }
    
    .bca-flash-btn {
        font-size: 16px;
        padding: 14px 24px;
    }
    
    .bca-flash-card-text {
        font-size: 14px;
    }
}