/* Styles globaux pour l'application FONDS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    height: 100%;
    overflow-y: auto;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 100vh;
    height: auto;
    background-color: #030712;
    color: #ffffff;
    position: relative;
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Scrollbar personnalisée */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #111827;
}

::-webkit-scrollbar-thumb {
    background: #374151;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4b5563;
}

/* Transitions */
.transition-all {
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

.transition-colors {
    transition-property: color, background-color, border-color;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

.transition-opacity {
    transition-property: opacity;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 300ms;
}

/* Utilitaires pour les notifications */
.notification-enter {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translate(-50%, 100%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

/* Modal overlay */
.modal-overlay {
    backdrop-filter: blur(4px);
}

/* Gradient text */
.gradient-text {
    background: linear-gradient(to right, #3b82f6, #10b981);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Layout principal */
.main-layout {
    background-color: #111827;
    min-height: 100vh;
    color: #ffffff;
    font-family: 'Inter', sans-serif;
    display: flex;
    flex-direction: column;
    position: relative;
    width: 100%;
    height: auto;
    overflow: visible;
    overflow-y: visible;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: #030712;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    position: relative;
    z-index: 10;
    width: 100%;
}

.main-content {
    flex: 1 1 auto;
    overflow: visible;
    padding-bottom: 7rem; /* Espace suffisant pour le bottom-nav fixe (environ 80-90px) */
    width: 100%;
    position: relative;
    min-height: 0;
    max-height: none;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #030712;
    border-top: 1px solid #1f2937;
    padding: 0.5rem;
    box-shadow: inset 0 1px 0 0 rgba(0, 0, 0, 0.1);
    z-index: 50;
    flex-shrink: 0;
    width: 100%;
}

.nav-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.nav-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 0.75rem;
    transition: all 150ms;
    text-decoration: none;
    cursor: pointer;
    color: #9ca3af;
}

.nav-button:hover {
    background-color: #1f2937;
    color: #ffffff;
}

.nav-button.active {
    color: #3b82f6;
}

.nav-button:not(.active) {
    color: #9ca3af;
}

.nav-button span {
    display: inline-block;
    min-height: 24px;
    min-width: 24px;
}

/* Utilitaires Tailwind-like */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }
.h-screen { height: 100vh; }
.min-h-screen { min-height: 100vh; }

/* ============================================
   RÈGLES CRITIQUES POUR LE SCROLL
   Override Tailwind CSS - À LA FIN DU FICHIER
   Ces règles DOIVENT être à la fin pour override Tailwind
   ============================================ */
/* Forcer le scroll sur html et body pour toutes les pages */
/* IMPORTANT: html doit permettre le scroll, body doit scroller */
html {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    height: 100% !important;
    max-height: none !important;
    position: relative !important;
}

body {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    height: auto !important;
    min-height: 100vh !important;
    max-height: none !important;
    position: relative !important;
}

/* Pages avec main-layout - permettre le scroll des listes */
body.main-layout {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    height: auto !important;
    min-height: 100vh !important;
    max-height: none !important;
    display: flex !important;
    flex-direction: column !important;
    position: relative !important;
}

body.main-layout .main-content {
    overflow: visible !important;
    max-height: none !important;
    height: auto !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    padding-bottom: 7rem !important; /* Espace suffisant pour le bottom-nav fixe (environ 80-90px) */
}

/* Ajustement pour le dashboard où le menu est masqué */
.main-content[data-page="dashboard"] {
    padding-bottom: 2rem !important;
}

/* S'assurer que main-layout ne bloque pas le scroll */
.main-layout {
    overflow: visible !important;
    overflow-y: visible !important;
    height: auto !important;
    min-height: 100vh !important;
    max-height: none !important;
}

/* Override Tailwind h-screen qui peut bloquer le scroll */
body.main-layout.h-screen,
body.main-layout .h-screen {
    height: auto !important;
    min-height: 100vh !important;
}

/* ============================================
   RÈGLE CRITIQUE FINALE - FORCER LE SCROLL
   Cette règle DOIT être la dernière pour override tout
   Utilise overflow-y: auto pour afficher la scrollbar seulement si nécessaire
   ============================================ */
html {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    height: 100% !important;
    max-height: none !important;
}

body {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    height: auto !important;
    min-height: 100vh !important;
    max-height: none !important;
}

body.main-layout {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    height: auto !important;
    min-height: 100vh !important;
    max-height: none !important;
    display: flex !important;
    flex-direction: column !important;
}

.w-full { width: 100%; }
.max-w-sm { max-width: 24rem; }
.max-w-md { max-width: 28rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-4 { margin-top: 1rem; }
.ml-4 { margin-left: 1rem; }
.mr-2 { margin-right: 0.5rem; }
.mr-4 { margin-right: 1rem; }
.mx-4 { margin-left: 1rem; margin-right: 1rem; }
.my-4 { margin-top: 1rem; margin-bottom: 1rem; }
.my-8 { margin-top: 2rem; margin-bottom: 2rem; }
.space-x-2 > * + * { margin-left: 0.5rem; }
.space-x-4 > * + * { margin-left: 1rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-4 > * + * { margin-top: 1rem; }

/* Assurer que les listes peuvent scroller et s'afficher correctement */
.space-y-2, .space-y-4 {
    display: block !important;
    width: 100% !important;
    overflow: visible !important;
    max-height: none !important;
}

/* Assurer que les conteneurs de listes ne bloquent pas le scroll */
#rooms-list, #players-list, #challenges-list, #rankings-list {
    overflow: visible !important;
    width: 100%;
    display: block;
    position: relative;
    min-height: 0;
    max-height: none !important;
}


.text-center { text-align: center; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-6xl { font-size: 3.75rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.text-white { color: #ffffff; }
.text-gray-400 { color: #9ca3af; }
.text-gray-500 { color: #6b7280; }
.text-blue-400 { color: #60a5fa; }
.text-blue-500 { color: #3b82f6; }
.text-green-400 { color: #4ade80; }
.text-green-500 { color: #10b981; }
.text-red-400 { color: #f87171; }
.text-red-500 { color: #ef4444; }
.text-yellow-400 { color: #facc15; }
.text-purple-400 { color: #a78bfa; }
.bg-gray-700 { background-color: #374151; }
.bg-gray-800 { background-color: #1f2937; }
.bg-gray-900 { background-color: #111827; }
.bg-gray-950 { background-color: #030712; }
.bg-blue-600 { background-color: #2563eb; }
.bg-green-500 { background-color: #10b981; }
.bg-green-600 { background-color: #059669; }
.bg-red-500 { background-color: #ef4444; }
.bg-red-600 { background-color: #dc2626; }
.hover\:bg-gray-700:hover { background-color: #374151; }
.hover\:bg-gray-800:hover { background-color: #1f2937; }
.hover\:bg-blue-700:hover { background-color: #1d4ed8; }
.hover\:bg-green-600:hover { background-color: #059669; }
.hover\:bg-red-600:hover { background-color: #dc2626; }
.hover\:text-white:hover { color: #ffffff; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-3xl { border-radius: 1.5rem; }
.rounded-full { border-radius: 9999px; }
.shadow { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1); }
.shadow-2xl { box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); }
.border-2 { border-width: 2px; }
.border-gray-700 { border-color: #374151; }
.border-gray-800 { border-color: #1f2937; }
.border-b { border-bottom-width: 1px; }
.last\:border-b-0:last-child { border-bottom-width: 0; }
.w-2 { width: 0.5rem; }
.w-5 { width: 1.25rem; }
.w-6 { width: 1.5rem; }
.w-8 { width: 2rem; }
.w-10 { width: 2.5rem; }
.w-12 { width: 3rem; }
.w-16 { width: 4rem; }
.h-2 { height: 0.5rem; }
.h-5 { height: 1.25rem; }
.h-6 { height: 1.5rem; }
.h-8 { height: 2rem; }
.h-10 { height: 2.5rem; }
.h-12 { height: 3rem; }
.h-16 { height: 4rem; }
.w-10 { width: 2.5rem; }
.h-10 { height: 2.5rem; }
.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gap-4 { gap: 1rem; }
.block { display: block; }
.fixed { position: fixed; }
.absolute { position: absolute; }
.relative { position: relative; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.bottom-20 { bottom: 5rem; }
.top-4 { top: 1rem; }
.right-4 { right: 1rem; }
.left-1\/2 { left: 50%; }
.-translate-x-1\/2 { transform: translateX(-50%); }
.z-50 { z-index: 50; }
.z-\[60\] { z-index: 60; }
.bg-opacity-70 { background-color: rgba(0, 0, 0, 0.7); }
.bg-gradient-to-br { background-image: linear-gradient(to bottom right, var(--tw-gradient-stops)); }
.from-gray-800 { --tw-gradient-from: #1f2937; --tw-gradient-to: rgba(31, 41, 55, 0); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); }
.to-gray-700 { --tw-gradient-to: #374151; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flex-grow { flex-grow: 1; }
.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }
.underline { text-decoration: underline; }
.tracking-tight { letter-spacing: -0.025em; }
.focus\:outline-none:focus { outline: 2px solid transparent; outline-offset: 2px; }
.focus\:ring-2:focus { box-shadow: 0 0 0 2px var(--tw-ring-color); }
.focus\:ring-blue-500:focus { --tw-ring-color: #3b82f6; }
.placeholder-gray-400::placeholder { color: #9ca3af; }
.placeholder-gray-500::placeholder { color: #6b7280; }
.hidden { display: none !important; }
.disabled\:bg-gray-600:disabled { background-color: #4b5563; }
.disabled\:cursor-not-allowed:disabled { cursor: not-allowed; }

/* Notification */
.notification-toast {
    position: fixed;
    bottom: 5rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 60;
    transition: opacity 300ms;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 50;
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 24rem;
    border-radius: 1.5rem;
    background-color: #111827;
    color: #ffffff;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Responsive */
@media (min-width: 640px) {
    .sm\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
