/* Police personnalisée pour toute l'application */
body {
    font-family: 'Space Grotesk', sans-serif;
    height: 100vh;
    margin: 0;
    padding: 0;
}

.container-fluid {
    padding: 1.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
}

.aspect-ratio-1 {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    border: 2px solid #dee2e6;
    border-radius: 0.5rem;
    transition: all 0.2s ease-in-out;
    font-family: 'Space Grotesk', sans-serif;
    width: 4rem !important;
    height: 4rem !important;
}

.aspect-ratio-1:hover {
    border-color: #6c757d;
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Style pour la zone d'affichage du code */
#codeDisplay {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    align-items: center;
    min-height: 8rem;
    margin-bottom: 3rem;
}

.code-digit {
    width: 5rem;
    height: 5rem;
    border: 3px solid #dee2e6;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 600;
    background: transparent;
    color: #dee2e6;
    position: relative;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.code-digit::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 0.75rem;
    background: rgba(13, 110, 253, 0.1);
    opacity: 0;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: -1;
    transform-origin: center;
}

.code-digit.current {
    border-color: #0d6efd;
    color: #0d6efd;
}

.code-digit.current::before {
    opacity: 1;
}

.code-digit.filled {
    border-color: #198754;
    color: #198754;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.code-digit.digit {
    border-color: #fd7e14;
    color: #fd7e14;
}

.code-digit.digit.current::before {
    background: rgba(253, 126, 20, 0.1);
}

/* Styles pour code terminé */
.code-digit.completed-letter {
    background-color: #198754;
    border-color: #198754;
    color: white;
    animation: pulse-complete 1s;
}

.code-digit.completed-digit {
    background-color: #fd7e14;
    border-color: #fd7e14;
    color: white;
    animation: pulse-complete 1s;
}

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

/* Style pour le clavier */
.keyboard {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.row {
    margin-bottom: 1rem;
}

/* Style pour le bouton Delete */
.btn-danger {
    border-radius: 0.75rem;
    border: 3px solid #dc3545;
    transition: all 0.2s ease-in-out;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 1.3rem;
    padding: 0.5rem 1.2rem;
    height: 4rem;
    width: 10rem !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.btn-danger i {
    font-size: 1.4rem;
    display: flex;
    align-items: center;
}

/* Styles pour les cartes de motifs */
.motif-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 160px;
    border: 2px solid transparent;
    margin-bottom: 1rem;
}

.motif-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
    border-color: #0d6efd;
}

.motif-card.selected {
    background-color: #0d6efd;
    border-color: #0d6efd;
    transform: translateY(-5px);
    box-shadow: 0 8px 12px rgba(13, 110, 253, 0.2);
}

.motif-card.selected i,
.motif-card.selected h3,
.motif-card.selected p {
    color: white;
}

.motif-card i {
    font-size: 2.5rem;
    color: #0d6efd;
    margin-bottom: 0.75rem;
    transition: color 0.3s ease;
}

.motif-card h3 {
    font-size: 1.3rem;
    margin: 0 0 0.75rem 0;
    color: #333;
    font-weight: 600;
    transition: color 0.3s ease;
}

.motif-card p {
    font-size: 0.9rem;
    color: #666;
    margin: 0;
    line-height: 1.3;
    transition: color 0.3s ease;
}

/* Responsive design */
@media (min-height: 700px) {
    .aspect-ratio-1 {
        width: 4.5rem !important;
        height: 4.5rem !important;
        font-size: 1.7rem;
    }
    
    .code-digit {
        width: 6rem;
        height: 6rem;
        font-size: 3rem;
    }
    
    .btn-danger {
        height: 4.5rem;
        width: 12rem !important;
        font-size: 1.5rem;
    }

    .motif-card {
        min-height: 180px;
    }

    .motif-card i {
        font-size: 3rem;
    }

    .motif-card h3 {
        font-size: 1.5rem;
    }

    .motif-card p {
        font-size: 1rem;
    }
}

@media (min-height: 900px) {
    .aspect-ratio-1 {
        width: 5rem !important;
        height: 5rem !important;
        font-size: 2rem;
    }
    
    .code-digit {
        width: 7rem;
        height: 7rem;
        font-size: 3.5rem;
    }
    
    .btn-danger {
        height: 5rem;
        width: 14rem !important;
        font-size: 1.7rem;
    }

    .motif-card {
        min-height: 200px;
    }

    .motif-card i {
        font-size: 3.5rem;
    }

    .motif-card h3 {
        font-size: 1.7rem;
    }

    .motif-card p {
        font-size: 1.1rem;
    }
}


/* Notification styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 5px;
    color: white;
    font-weight: bold;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    animation: slide-in 0.5s ease-out;
}

.notification.success {
    background-color: #4CAF50;
}

.notification.error {
    background-color: #f44336;
}

.notification.fade-out {
    animation: fade-out 0.5s ease-out;
}

@keyframes slide-in {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fade-out {
    from { opacity: 1; }
    to { opacity: 0; }
}


/* Styles pour le loader overlay */
#loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loader-container {
    text-align: center;
}


/* Two-row layout for motif cards */
.motif-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: center;
}

.motif-row {
    display: flex;
    justify-content: space-around;
    margin-bottom: 1rem;
}

#interface2 {
    overflow: hidden;
    height: 100%;
}