/* style.css */
body {
    background-color: #222; 
    background-color: #222; 
    background-image: url('/textures/bg/bg.png');
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-size: 100% 100%;
    display: flex; justify-content: center; align-items: center;
    height: 100vh; margin: 0; color: white; font-family: sans-serif;
    flex-direction: column;
}

canvas {
    border: 4px solid #fff;
    background-color: #a8e6cf; 
    box-shadow: 0px 0px 15px rgba(0,0,0,0.5);
    image-rendering: pixelated; 
}

#gameMenu {
    position: absolute; 
    background-color: white; border: 4px solid #333; border-radius: 8px;
    padding: 20px; width: 200px; display: flex; flex-direction: column;
    gap: 15px; color: black; box-shadow: 5px 5px 0px rgba(0,0,0,0.3); text-align: center;
}

.hidden { display: none !important; }

#gameMenu button {
    padding: 10px; font-size: 16px; font-weight: bold; cursor: pointer;
    border: 2px solid #ccc; background-color: #f0f0f0; border-radius: 4px;
}
#gameMenu button:hover { background-color: #e0e0e0; border-color: #333; }

#partyScreen {
    position: absolute; background-color: #f8f8f8; border: 6px solid #444; border-radius: 10px;
    padding: 20px; width: 500px; color: black; box-shadow: 8px 8px 0px rgba(0,0,0,0.5);
    display: flex; flex-direction: column;
}

.box-container { background-color: #e0e0e0; border: 2px solid #aaa; border-radius: 8px; padding: 10px; }
.slot-grid { display: grid; gap: 10px; }
.party-grid { grid-template-columns: repeat(6, 1fr); }
.storage-grid { grid-template-columns: repeat(6, 1fr); min-height: 120px; }

.monster-slot {
    background-color: white; 
    border: 2px solid #888; 
    border-radius: 6px; 
    height: 100px;
    display: flex; 
    flex-direction: column; 
    justify-content: flex-start; /* Pushes content to the top */
    align-items: flex-start; /* Aligns to the left */
    padding: 8px; /* Adds breathing room inside the box */
    box-sizing: border-box; /* Keeps padding from breaking the grid */
    font-size: 10px; 
    font-weight: bold; 
    cursor: pointer;
}
.party-grid .monster-slot:first-child { border: 3px solid #ffcc00; background-color: #fffae6; }
.empty-slot { background-color: #ccc; border: 2px dashed #999; }
.selected-slot { border: 3px solid #ff3333 !important; background-color: #ffe6e6 !important; transform: scale(1.05); }

/* Tiny text for attacks */
.move-text { font-size: 8px; font-weight: normal; color: #555; margin-top: 2px; }

/* ==========================================
   ADMIN MENU STYLES
   ========================================== */
#adminMenu {
    position: absolute;
    background-color: #f8f8f8;
    border: 6px solid #b8860b; /* Gold border */
    border-radius: 10px;
    padding: 20px;
    width: 250px;
    color: black;
    box-shadow: 8px 8px 0px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    gap: 5px;
}

#adminMenu label {
    font-weight: bold;
    font-size: 14px;
    margin-top: 5px;
}

#adminMenu select, #adminMenu input {
    padding: 5px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

#pokedexScreen {
    position: absolute;
    background-color: #f8f8f8;
    border: 6px solid #d32f2f; /* Classic Pokédex Red */
    border-radius: 10px;
    padding: 20px;
    width: 450px;
    max-height: 80vh; /* Prevents it from being taller than your screen */
    color: black;
    box-shadow: 8px 8px 0px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
}

.pokedex-container {
    flex-grow: 1;
    overflow-y: auto; /* Makes the list scrollable! */
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 10px;
}

.dex-entry {
    background-color: white;
    border: 2px solid #aaa;
    border-radius: 8px;
    padding: 10px;
    display: flex;
    flex-direction: column;
}

.dex-header {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    font-size: 16px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
    margin-bottom: 5px;
}

.dex-type {
    background-color: #333;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.dex-details {
    font-size: 12px;
    color: #444;
}

.dex-note {
    margin-top: 5px;
    font-style: italic;
    color: #666;
    border-top: 1px dashed #ccc;
    padding-top: 5px;
}


/* ==========================================
   BATTLE SCREEN STYLES
   ========================================== */
#battleScreen {
    position: absolute;
    width: 640px; height: 480px; /* Same size as canvas */
    background-color: #e0f7fa; /* Light blue background */
    border: 4px solid #333;
    display: flex; flex-direction: column;
    z-index: 100;
}

.battle-top { flex: 1; position: relative; }

.battle-bottom { 
    height: 120px; display: flex; 
    border-top: 4px solid #333; background: white;
}

.battle-text { 
    flex: 1; padding: 15px; font-size: 18px; 
    font-weight: bold; color: #333; border-right: 4px solid #333;
}

.battle-actions { 
    width: 250px; display: grid; 
    grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; 
}

.battle-actions button { 
    font-size: 14px; font-weight: bold; cursor: pointer;
    border: 1px solid #ccc; background-color: #f9f9f9;
}
.battle-actions button:hover { background-color: #ddd; }

.stat-box { 
    position: absolute; background: white; border: 3px solid #444; 
    padding: 10px; border-radius: 8px; width: 220px; color: black;
    box-shadow: 4px 4px 0px rgba(0,0,0,0.3);
}

#enemyStatBox { top: 30px; right: 30px; }
#playerStatBox { bottom: 30px; left: 30px; }

.hp-bar { width: 100%; height: 12px; background: #555; margin-top: 5px; border-radius: 4px; border: 2px solid #222; overflow: hidden; }
.hp-fill { height: 100%; background: #4CAF50; width: 100%; transition: width 0.3s ease-out; }


#wildEncounterScreen {
    position: absolute;
    background-color: white;
    border: 6px solid #333;
    border-radius: 10px;
    padding: 20px;
    width: 300px;
    box-shadow: 8px 8px 0px rgba(0,0,0,0.5);
    z-index: 200;
    
    /* NEW: Perfectly centers the popup over the canvas */
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}



/* ==========================================
   HEAL DIALOG STYLES
   ========================================== */
#healDialog {
    position: absolute;
    background-color: white;
    border: 6px solid #2196F3; /* Hospital Blue Border */
    border-radius: 10px;
    padding: 20px;
    width: 300px;
    text-align: center;
    box-shadow: 8px 8px 0px rgba(0,0,0,0.5);
    z-index: 300;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}