/* Styles personnalisés pour Evolve Arena */

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ============================================
   BARRE DE CHARGEMENT ADN
   ============================================ */

.dna-loader-container {
    position: relative;
    width: 100%;
    height: 100px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    overflow: hidden;
    padding: 20px;
}

.dna-helix {
    position: absolute;
    width: 100%;
    height: 60px;
    top: 20px;
}

.dna-strand {
    position: absolute;
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
}

.dna-strand:nth-child(1) {
    top: 15px;
    animation: wave 2s ease-in-out infinite;
}

.dna-strand:nth-child(2) {
    top: 45px;
    animation: wave 2s ease-in-out infinite reverse;
}

.dna-base {
    position: absolute;
    width: 3px;
    height: 30px;
    background: rgba(255, 255, 255, 0.6);
    animation: pulse 1.5s ease-in-out infinite;
}

.dna-base:nth-child(3) { left: 10%; animation-delay: 0s; }
.dna-base:nth-child(4) { left: 20%; animation-delay: 0.2s; }
.dna-base:nth-child(5) { left: 30%; animation-delay: 0.4s; }
.dna-base:nth-child(6) { left: 40%; animation-delay: 0.6s; }
.dna-base:nth-child(7) { left: 50%; animation-delay: 0.8s; }
.dna-base:nth-child(8) { left: 60%; animation-delay: 1s; }
.dna-base:nth-child(9) { left: 70%; animation-delay: 1.2s; }
.dna-base:nth-child(10) { left: 80%; animation-delay: 1.4s; }
.dna-base:nth-child(11) { left: 90%; animation-delay: 1.6s; }

@keyframes wave {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.4;
        transform: scaleY(0.8);
    }
    50% {
        opacity: 1;
        transform: scaleY(1.2);
    }
}

.dna-progress-bar {
    position: absolute;
    bottom: 10px;
    left: 20px;
    right: 20px;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
}

.dna-progress {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #34d399);
    border-radius: 3px;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.dna-info {
    position: absolute;
    top: 10px;
    right: 20px;
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* ============================================
   CARTE DU MONDE
   ============================================ */

.world-grid {
    display: grid;
    gap: 2px;
    background: #1f2937;
    padding: 4px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.grid-cell {
    aspect-ratio: 1;
    border-radius: 4px;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 2px solid transparent;
    --border-player: transparent;
    --border-clan: transparent;
    --border-enemy: transparent;
    --glow-player: transparent;
    --glow-clan: transparent;
    --glow-enemy: transparent;
    box-shadow:
        0 0 0 2px var(--border-player),
        0 0 0 2px var(--border-clan),
        0 0 0 2px var(--border-enemy),
        0 0 12px var(--glow-player),
        0 0 12px var(--glow-clan),
        0 0 12px var(--glow-enemy);
}

.grid-cell:hover {
    transform: scale(1.1);
    z-index: 10;
}

.grid-cell.owned {
    --border-player: rgba(250, 204, 21, 0.95);
    --glow-player: rgba(250, 204, 21, 0.45);
}

.grid-cell.clan {
    --border-clan: rgba(16, 185, 129, 0.85);
    --glow-clan: rgba(16, 185, 129, 0.35);
}

.grid-cell.enemy {
    --border-enemy: rgba(248, 113, 113, 0.9);
    --glow-enemy: rgba(248, 113, 113, 0.45);
}

/* Images des biomes */
.biome-foret-tropicale {
    background: #10b981 url('/static/images/biomes/foret tropicale.png') center/cover no-repeat;
}
.biome-foret-temperee {
    background: #059669 url('/static/images/biomes/foret temperee.png') center/cover no-repeat;
}
.biome-mangrove {
    background: #84cc16 url('/static/images/biomes/mangrove.png') center/cover no-repeat;
}
.biome-montagne {
    background: #78716c url('/static/images/biomes/montagne.png') center/cover no-repeat;
}
.biome-toundra {
    background: #d1d5db url('/static/images/biomes/toundra.png') center/cover no-repeat;
}
.biome-desert {
    background: #fbbf24 url('/static/images/biomes/desert.png') center/cover no-repeat;
}
.biome-recif-corallien {
    background: #06b6d4 url('/static/images/biomes/recif corallien.png') center/cover no-repeat;
}
.biome-estuaire {
    background: #3b82f6 url('/static/images/biomes/estuaire.png') center/cover no-repeat;
}
.biome-lagune-cotiere {
    background: #60a5fa url('/static/images/biomes/lagune cotiere.png') center/cover no-repeat;
}
.biome-eaux-polaires {
    background: #bfdbfe url('/static/images/biomes/eau polaire.png') center/cover no-repeat;
}
.biome-ocean-profond {
    background: #1e40af url('/static/images/biomes/ocean profond.png') center/cover no-repeat;
}
.biome-fosse-oceanique {
    background: #1e3a8a url('/static/images/biomes/fosse oceanique.png') center/cover no-repeat;
}

/* Case non visible (fog of war) - assombrie mais toujours visible */
.grid-cell.hidden {
    position: relative;
    filter: grayscale(100%) brightness(0.4);
}

/* Overlay de brouillard sur les cases non explorées */
.grid-cell.hidden::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    pointer-events: none;
}

.grid-cell.hidden .cell-tooltip {
    display: none;
}

.cell-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    margin-bottom: 5px;
    z-index: 20;
}

.grid-cell:hover .cell-tooltip {
    opacity: 1;
}

/* ============================================
   BARRE DE CHARGEMENT DEPLACEMENT
   ============================================ */

.movement-loader-container {
    position: relative;
    width: 100%;
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    border-radius: 12px;
    overflow: hidden;
    padding: 20px;
    color: white;
}

.movement-icon {
    position: absolute;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    font-size: 32px;
    animation: moveRight 2s ease-in-out infinite;
}

@keyframes moveRight {
    0%, 100% {
        transform: translateY(-50%) translateX(0);
    }
    50% {
        transform: translateY(-50%) translateX(10px);
    }
}

.movement-info {
    margin-left: 60px;
    margin-bottom: 10px;
}

.movement-info-line {
    font-size: 14px;
    margin-bottom: 5px;
}

.movement-info-line strong {
    font-weight: bold;
}

.movement-progress-bar {
    margin-left: 60px;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
}

.movement-progress {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #34d399);
    border-radius: 4px;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

/* =========================
   Mode sombre
   ========================= */
html.dark-mode body {
    background: linear-gradient(135deg, #0f172a 0%, #1f1d38 100%) !important;
    color: #f3f4f6;
}

html.dark-mode .bg-white,
html.dark-mode .bg-gray-50,
html.dark-mode .bg-gray-100 {
    background-color: #1f2937 !important;
    color: #f3f4f6 !important;
}

html.dark-mode .bg-white\/95,
html.dark-mode .bg-white\/90 {
    background-color: rgba(17, 24, 39, 0.95) !important;
    color: #f3f4f6 !important;
}

html.dark-mode .bg-gradient-to-r,
html.dark-mode .bg-gradient-to-br {
    background-image: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(17, 24, 39, 0.9)) !important;
    color: #f3f4f6;
}

html.dark-mode .text-gray-800,
html.dark-mode .text-gray-700 {
    color: #f9fafb !important;
}

html.dark-mode .text-gray-900 {
    color: #fdfdfd !important;
}

html.dark-mode .text-gray-600 {
    color: #d1d5db !important;
}

html.dark-mode .text-gray-500,
html.dark-mode .text-gray-400 {
    color: #9ca3af !important;
}

html.dark-mode .bg-gray-900 {
    background-color: #030712 !important;
}

html.dark-mode .border-gray-200 {
    border-color: #374151 !important;
}

html.dark-mode .border-gray-700 {
    border-color: #4b5563 !important;
}

html.dark-mode .bg-yellow-100 {
    background-color: #422006 !important;
    color: #fde68a !important;
}

html.dark-mode .bg-blue-50,
html.dark-mode .bg-purple-50,
html.dark-mode .bg-green-50 {
    background-color: rgba(15, 23, 42, 0.6) !important;
    color: #f3f4f6;
}

html.dark-mode .bg-yellow-50,
html.dark-mode .bg-amber-50,
html.dark-mode .bg-gray-200,
html.dark-mode .bg-gray-300 {
    background-color: rgba(55, 65, 81, 0.7) !important;
    color: #f3f4f6 !important;
}

html.dark-mode .border-purple-100,
html.dark-mode .border-amber-100,
html.dark-mode .border-gray-100 {
    border-color: #4b5563 !important;
}

html.dark-mode .text-amber-900,
html.dark-mode .text-amber-700,
html.dark-mode .text-amber-600 {
    color: #fde68a !important;
}

html.dark-mode .bg-yellow-500 {
    color: #111827;
}

html.dark-mode footer.bg-gray-900 {
    background-color: #030712 !important;
}

html.dark-mode input,
html.dark-mode select,
html.dark-mode textarea {
    background-color: #111827 !important;
    color: #f9fafb !important;
    border-color: #4b5563 !important;
}

html.dark-mode input::placeholder,
html.dark-mode textarea::placeholder {
    color: #9ca3af !important;
}
