/* ============================================================
   BacHO — Ajustements des écrans élève
   Ce qui reste ici ne concerne que la mise en page de /fiche et
   /elements : le dessin des composants vit dans bacho-app.css.
   ============================================================ */

html,
body {
    font-family: var(--bh-sans);
    background: var(--bh-paper);
    color: var(--bh-ink);
}

* {
    scroll-behavior: smooth;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Bottom nav safe area on mobile */
@media (max-width: 767px) {
    .main-wrap {
        padding-bottom: 5.5rem;
    }

    .bottom-nav {
        padding-bottom: max(0.5rem, env(safe-area-inset-bottom, 0));
    }
}

/* Sheet Modal - column layout: header, scrollable content (image + description + elements + buttons), footer */
#sheetModal .relative,
#ficheModal .relative {
    display: flex;
    flex-direction: column;
    height: 90vh;
    max-height: 90vh;
}

#sheetModal .relative>div:first-child,
#ficheModal .relative>div:first-child {
    flex-shrink: 0;
}

#sheetModal .relative>div:nth-child(2),
#ficheModal .relative>div:nth-child(2) {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

/* Mobile: same column layout, full height */
@media (max-width: 768px) {

    #sheetModal .relative,
    #ficheModal .relative {
        height: 95vh;
        max-height: 95vh;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Étincelles */
@keyframes sparkle {

    0%,
    100% {
        opacity: 0;
        transform: translate(0, 0) scale(0.5);
    }

    25% {
        opacity: 1;
        transform: translate(-5px, -10px) scale(1.2);
    }

    50% {
        opacity: 0;
        transform: translate(-10px, -20px) scale(0.8);
    }

    75% {
        opacity: 1;
        transform: translate(5px, -15px) scale(1);
    }
}

.sparkles-container {
    position: relative;
}

.sparkle {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    box-shadow: 0 0 10px #fbbf24;
    pointer-events: none;
    z-index: 10;
}

.sparkle-1 {
    top: -5px;
    right: -5px;
    animation: sparkle 1.8s infinite 0s;
}

.sparkle-2 {
    top: 10px;
    right: -12px;
    width: 8px;
    height: 8px;
    animation: sparkle 2s infinite 0.3s;
}

.sparkle-3 {
    top: 25px;
    right: -8px;
    width: 5px;
    height: 5px;
    animation: sparkle 2.2s infinite 0.6s;
}

.sparkle-4 {
    top: -8px;
    right: 15px;
    width: 7px;
    height: 7px;
    animation: sparkle 1.9s infinite 0.9s;
}

.sparkle-5 {
    top: -12px;
    right: 0px;
    width: 6px;
    height: 6px;
    animation: sparkle 2.1s infinite 1.2s;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.animate-slide-up {
    animation: slideUp 0.3s ease-out;
}

/* Animation de la flèche */
@keyframes arrowMove {
    0% {
        transform: translateX(0);
        opacity: 0.6;
    }

    50% {
        transform: translateX(8px);
        opacity: 1;
    }

    100% {
        transform: translateX(0);
        opacity: 0.6;
    }
}

@keyframes arrowBounce {

    0%,
    100% {
        transform: translateX(0);
    }

    50% {
        transform: translateX(8px);
    }
}

@keyframes arrowDown {

    0%,
    100% {
        transform: translateY(0);
        opacity: 0.6;
    }

    50% {
        transform: translateY(6px);
        opacity: 1;
    }
}

.animated-arrow {
    animation: arrowMove 1.5s ease-in-out infinite;
    display: inline-flex;
}

.animated-arrow.bounce {
    animation: arrowBounce 0.8s ease-in-out infinite;
}

.animated-arrow-mobile {
    animation: arrowDown 1.5s ease-in-out infinite;
    display: inline-flex;
}

.arrow-guide-desktop {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.05), rgba(53, 70, 95, 0.1));
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    border: 1px solid rgba(15, 23, 42, 0.2);
    transition: all 0.3s ease;
}

.arrow-guide-desktop:hover {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.1), rgba(53, 70, 95, 0.15));
    border-color: rgba(15, 23, 42, 0.4);
    cursor: pointer;
}

/* Version responsive pour les petits écrans */
@media (max-width: 768px) {
    .arrow-guide-desktop {
        padding: 0.25rem 0.75rem;
    }

    .arrow-guide-desktop span {
        font-size: 0.7rem;
    }
}

/* Option : flèche cliquable */
.arrow-guide-desktop,
.animated-arrow-mobile {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.arrow-guide-desktop:active,
.animated-arrow-mobile:active {
    transform: scale(0.95);
}

/* ── Fiche preview dans les cards ── */
