/* ----------------------------------------------------------- 
   PokéLid Dashboard - Cleaned & Fixed CSS
   ----------------------------------------------------------- */

/* === ROOT VARIABLES === */
:root {
    --poke-red:    #ef5350;
    --belt-black:  #212121;
    --success:     #4CAF50;
    --bg-light:    #f0f2f5;
    --text-dark:   #333;
    --text-light:  #eee;
    --shadow-soft: 0 4px 6px rgba(0,0,0,0.05);
    --shadow-strong: 0 8px 15px rgba(0,0,0,0.1);
}

/* === BASE & FULL-HEIGHT SETUP === */
html, body {
    height: 100%;
    margin: 0;
    font-family: 'Fredoka', 'Nunito', system-ui, -apple-system, sans-serif;
    color: var(--text-dark);
    background: var(--bg-light);
}

.dashboard-wrapper {
    display: flex;
    min-height: 100dvh;           /* modern safe full viewport height */
    height: 100%;                 /* fallback */
}

/* === SIDEBAR / REGION NAV === */
#region-nav {
    width: 260px;
    background: var(--belt-black);
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex-shrink: 0;
    padding-top: 10px;
}

#region-nav h2 {
    font-size: 1.2rem;
    border-bottom: 1px solid #444;
    margin: 0 25px 10px;
    padding-bottom: 8px;
}

#region-nav button {
    background: transparent;
    color: var(--text-light);
    border: none;
    padding: 15px 25px;
    text-align: left;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

#region-nav button:hover {
    background: #333;
    color: var(--poke-red);
}

.nav-active,
.nav-btn.active {
    background: var(--poke-red) !important;
    color: white !important;
    border-left: 5px solid white;
}

/* === MAIN CONTENT AREA === */
main {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0 0 100px 0;           /* room for fixed save menu */
    background: var(--bg-light);
}

/* === HEADER === */
.modern-header {
    background-color: var(--poke-red);
    padding: 60px 20px;
    text-align: center;
    color: white;
    border-bottom: 8px solid var(--belt-black);
}

.modern-header h1 {
    margin: 0;
    font-size: 2.8rem;
    text-shadow: 2px 2px 0 var(--belt-black);
}

/* === STATS BANNER === */
.stats-banner {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin: -40px auto 30px;
    width: min(90%, 1100px);
    max-width: 1100px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    text-align: center;
}

.progress-container {
    background: #333;
    height: 16px;
    border-radius: 10px;
    width: 90%;
    margin: 10px auto;
    overflow: hidden;
    border: 3px solid var(--belt-black);
}

.progress-bar {
    height: 100%;
    transition: width 0.4s ease-in-out;
    box-shadow: inset 0 -4px 0 rgba(0,0,0,0.2);
}

.progress-bar.grand { background: #ff1c1c; }
.progress-bar.pref  { background: var(--success); }

/* === LID CARDS GRID === */
#lid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px;
}

@media (max-width: 420px) {
    #lid-container {
        grid-template-columns: 1fr;
        padding: 16px;
    }
}

.lid-card {
    background: white;
    padding: 20px;
    border-radius: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-soft);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #eee;
}

.lid-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-strong);
}

.lid-card.found {
    border-left: 8px solid var(--success);
    background: #f9fff9;
}

/* === CATCH BUTTON (Poké Ball) === */
.catch-btn {
    width: 60px;
    height: 60px;
    background-color: white;
    border: 4px solid var(--belt-black);
    border-radius: 50%;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

.catch-btn::after {
    content: '';
    width: 18px;
    height: 18px;
    background-color: white;
    border: 3px solid var(--belt-black);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
}

.catch-btn:hover {
    animation: shake 0.6s infinite;
}

.catch-btn.is-caught {
    background: linear-gradient(to bottom, 
        var(--poke-red) 45%, 
        var(--belt-black) 45%, 
        var(--belt-black) 55%, 
        white 55%);
    animation: pulse 2s infinite;
}

.catch-btn.is-caught:hover {
    animation: pulse 2s infinite;   /* prevent shake override */
}

@keyframes shake {
    0%   { transform: rotate(0deg); }
    25%  { transform: rotate(-15deg); }
    75%  { transform: rotate(15deg); }
    100% { transform: rotate(0deg); }
}

@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(239, 83, 80, 0.7); }
    70%  { box-shadow: 0 0 0 15px rgba(239, 83, 80, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 83, 80, 0); }
}

/* === SEARCH BAR === */
.search-container {
    position: relative;
    max-width: 600px;
    margin: 24px auto;
    padding: 0 20px;
}

#lid-search {
    width: 100%;
    padding: 15px 20px 15px 48px;
    border-radius: 50px;
    border: 3px solid var(--belt-black);
    box-shadow: 0 4px 0 var(--belt-black);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

#lid-search:focus {
    outline: none;
    border-color: var(--poke-red);
    box-shadow: 0 4px 0 var(--belt-black),
                0 0 0 4px rgba(239, 83, 80, 0.2);
}

.search-icon {
    position: absolute;
    left: 36px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.3rem;
    color: #888;
}

/* === FIXED SAVE MENU === */
.save-menu {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 15px;
    display: flex;
    justify-content: center;
    gap: 20px;
    box-shadow: 0 -5px 15px rgba(0,0,0,0.1);
    z-index: 1000;
}

/* === FOCUS STYLES (accessibility) === */
button:focus-visible,
#lid-search:focus-visible,
.catch-btn:focus-visible {
    outline: 3px solid var(--poke-red);
    outline-offset: 3px;
}
