/* ===================================
   CSS Variables for Type-Based Theming
   =================================== */
:root {
    --primary-color: #DC0A2D;
    --text-dark: #212121;
    --text-light: #666;
    --bg-light: #F8F8F8;
    --card-bg: #FFFFFF;
    --shadow-light: rgba(0, 0, 0, 0.08);
    --shadow-medium: rgba(0, 0, 0, 0.12);
    --shadow-heavy: rgba(0, 0, 0, 0.2);
}

/* Type Colors - Pokemon-inspired */
.type-normal { background: linear-gradient(135deg, #A8A878 0%, #C6C6A7 100%); }
.type-fire { background: linear-gradient(135deg, #F08030 0%, #FFAA5A 100%); }
.type-water { background: linear-gradient(135deg, #6890F0 0%, #9DB7F5 100%); }
.type-electric { background: linear-gradient(135deg, #F8D030 0%, #FFF350 100%); }
.type-grass { background: linear-gradient(135deg, #78C850 0%, #A7DB8D 100%); }
.type-ice { background: linear-gradient(135deg, #98D8D8 0%, #BCE6E6 100%); }
.type-fighting { background: linear-gradient(135deg, #C03028 0%, #E05552 100%); }
.type-poison { background: linear-gradient(135deg, #A040A0 0%, #C563C5 100%); }
.type-ground { background: linear-gradient(135deg, #E0C068 0%, #EDD598 100%); }
.type-flying { background: linear-gradient(135deg, #A890F0 0%, #C6B7F5 100%); }
.type-psychic { background: linear-gradient(135deg, #F85888 0%, #FA92B2 100%); }
.type-bug { background: linear-gradient(135deg, #A8B820 0%, #C6D16E 100%); }
.type-rock { background: linear-gradient(135deg, #B8A038 0%, #D1C17D 100%); }
.type-ghost { background: linear-gradient(135deg, #705898 0%, #A292BC 100%); }
.type-dragon { background: linear-gradient(135deg, #7038F8 0%, #A27DFA 100%); }
.type-dark { background: linear-gradient(135deg, #705848 0%, #A29288 100%); }
.type-steel { background: linear-gradient(135deg, #B8B8D0 0%, #D1D1E0 100%); }
.type-fairy { background: linear-gradient(135deg, #EE99AC 0%, #F4BDC9 100%); }

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Baloo 2', cursive, sans-serif;
    background: linear-gradient(180deg, #F8F8F8 0%, #E8E8E8 100%);
    color: var(--text-dark);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    padding: 0;
    margin: 0;
    /* iPad/Touch improvements */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    touch-action: manipulation;
    overscroll-behavior-y: none; /* Prevent pull-to-refresh */
}

/* ===================================
   Loading Screen
   =================================== */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #DC0A2D 0%, #8B0000 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    color: white;
    overflow: hidden;
}

.pokeball-loader {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(180deg, #DC0A2D 0%, #DC0A2D 48%, #222 48%, #222 52%, white 52%, white 100%);
    border: 5px solid #1a1a1a;
    position: relative;
    box-shadow: 
        0 0 0 8px rgba(220, 10, 45, 0.2),
        0 10px 30px rgba(0, 0, 0, 0.4);
    animation: spinBounce 2s ease-in-out infinite;
}

@keyframes spinBounce {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-20px) rotate(90deg); }
    50% { transform: translateY(0) rotate(180deg); }
    75% { transform: translateY(-20px) rotate(270deg); }
}

.pokeball-loader::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    background: white;
    border: 5px solid #1a1a1a;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.3);
}

.loading-screen p {
    margin-top: 40px;
    font-size: 1.3rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    animation: fadeInOut 2s ease-in-out infinite;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* ===================================
   App Container
   =================================== */
.app-container {
    max-width: 768px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    box-shadow: 0 0 40px var(--shadow-light);
    position: relative;
    overflow-y: auto;
    max-height: 100vh;
}

/* ===================================
   Header
   =================================== */
.app-header {
    background: linear-gradient(135deg, #DC0A2D 0%, #FF1744 100%);
    color: white;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 12px var(--shadow-medium);
    position: relative;
    z-index: 1000;
}

.app-title {
    font-size: 1.5rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    text-align: center;
    justify-content: center;
}

.header-spacer {
    width: 44px;
    height: 44px;
}

.header-pokemon-number {
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    flex: 1;
    text-align: center;
}

.spruce-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    animation: float 3s ease-in-out infinite;
}

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

.view-toggle-button {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.5rem;
    opacity: 1;
    visibility: visible;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.view-toggle-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.view-toggle-button:active {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0.95);
}

/* ===================================
   Pokemon List - Responsive Grid System
   =================================== */
.pokemon-list {
    padding: 1rem;
    display: grid;
    /* Mobile-first: 2 columns on smallest screens */
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    overflow-y: auto;
    max-height: calc(100vh - 150px);
    width: 100%;
}

.pokemon-card {
    background: white;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px var(--shadow-light);
    position: relative;
    overflow: hidden;
    width: 100%;
    /* Use padding-bottom trick for reliable aspect ratio */
    padding-bottom: 100%;
    height: 0;
    background-size: cover;
    background-position: center;
}

.pokemon-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.7) 100%);
    z-index: 1;
}

.pokemon-card:active {
    transform: scale(0.95);
    box-shadow: 0 2px 8px var(--shadow-light);
    animation: tap-bounce 0.3s ease;
}

@keyframes tap-bounce {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

.card-number {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    font-size: 1.25rem;
    font-weight: 800;
    color: white;
    z-index: 2;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.card-image-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 0;
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.card-name {
    position: absolute;
    bottom: 2.5rem;
    left: 0.75rem;
    right: 0.75rem;
    font-size: 1.125rem;
    font-weight: 800;
    color: white;
    text-align: left;
    z-index: 2;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.pokemon-types {
    position: absolute;
    bottom: 0.75rem;
    left: 0.75rem;
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
    z-index: 2;
}

.type-badge {
    padding: 0.25rem 0.625rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    text-transform: capitalize;
}

/* ===================================
   Pokemon Detail View
   =================================== */
.pokemon-detail {
    position: relative;
    background: white;
    overflow-y: visible;
    z-index: 200;
    animation: slideInRight 0.4s ease;
    min-height: 100vh;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.detail-content {
    padding-bottom: 2rem;
    position: relative;
}

.pokemon-header {
    background: var(--detail-bg-color, linear-gradient(135deg, #DC0A2D 0%, #FF1744 100%));
    color: white;
    padding: 2rem 1.5rem 1.5rem;
    padding-top: calc(2rem + 80px);
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-top: -80px;
}

.pokemon-header::before {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    border-radius: 50%;
}

.pokemon-number {
    font-size: 1.125rem;
    font-weight: 700;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.pokemon-name {
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.pokemon-header .pokemon-types {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
    left: 0;
    margin: 0;
}

.pokemon-image-container {
    position: relative;
    width: 100%;
    padding: 0;
    background: white;
    margin: 0;
}

.pokemon-detail-image {
    width: 100%;
    height: auto;
    display: block;
    animation: bounceIn 0.6s ease;
}

@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

.pokemon-info-header {
    padding: 1.5rem 1.5rem 0;
}

.pokemon-category {
    text-align: center;
    margin-bottom: 0.75rem;
}

.pokemon-category span {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-light);
    font-style: italic;
}

.pokemon-pronunciation {
    text-align: center;
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: var(--bg-light);
    border-radius: 12px;
}

.pronunciation-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-light);
    margin-right: 0.5rem;
}

.pronunciation-text {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
}

/* Sections */
.pokedex-entry-section,
.pokemon-stats,
.abilities-section,
.weaknesses-section,
.behavior-section,
.battle-role-section,
.signature-moves-section,
.evolution-section {
    padding: 0 1.5rem;
    margin: 1.5rem 0;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title .icon {
    font-size: 1.5rem;
}

.pokedex-entries {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.pokedex-entry {
    background: var(--bg-light);
    padding: 1.25rem;
    border-radius: 16px;
    font-size: 1.0625rem;
    line-height: 1.6;
    color: var(--text-dark);
    border-left: 4px solid var(--detail-accent-color, #DC0A2D);
    position: relative;
}

.pokedex-entry.secondary {
    background: white;
    border: 2px solid var(--bg-light);
    border-left: 4px solid var(--detail-accent-color, #DC0A2D);
    font-size: 0.9375rem;
    opacity: 0.9;
}

.speak-button {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    pointer-events: auto;
}

.speak-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.speak-button:active {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0.95);
}

.speak-button.speaking {
    animation: pulse 1s ease infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Mega Evolution Button */
.mega-evolution-button {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: linear-gradient(135deg, #9333EA 0%, #C026D3 100%);
    border: 3px solid #FFF;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(147, 51, 234, 0.6), 0 0 0 0 rgba(147, 51, 234, 0.4);
    transition: all 0.3s ease;
    z-index: 1050;
    animation: wiggle-hint 3s ease-in-out infinite;
}

@keyframes wiggle-hint {
    0%, 100% { transform: rotate(0deg); }
    10% { transform: rotate(-5deg) scale(1.05); }
    20% { transform: rotate(5deg) scale(1.05); }
    30% { transform: rotate(-5deg) scale(1.05); }
    40% { transform: rotate(0deg); }
}

.mega-evolution-button::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, #EC4899, #8B5CF6, #3B82F6);
    border-radius: 50%;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mega-evolution-button:hover::before {
    opacity: 1;
    animation: rotate-gradient 2s linear infinite;
}

.mega-evolution-button:hover {
    transform: scale(1.15);
    box-shadow: 0 6px 30px rgba(147, 51, 234, 0.8), 0 0 40px rgba(147, 51, 234, 0.5);
    animation: pulse-glow 1.5s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 6px 30px rgba(147, 51, 234, 0.8), 0 0 40px rgba(147, 51, 234, 0.5);
    }
    50% {
        box-shadow: 0 8px 40px rgba(147, 51, 234, 1), 0 0 60px rgba(147, 51, 234, 0.7);
    }
}

.mega-evolution-button:active {
    transform: scale(0.95);
}

.mega-icon {
    width: 40px;
    height: 40px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease;
}

.mega-evolution-button:hover .mega-icon {
    transform: rotate(360deg) scale(1.1);
}

.mega-evolution-button.mega-active {
    background: linear-gradient(135deg, #6B7280 0%, #4B5563 100%);
    box-shadow: 0 4px 20px rgba(107, 114, 128, 0.3);
    filter: grayscale(0.5) brightness(0.8);
    animation: none;
}

.mega-evolution-button.mega-active:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(107, 114, 128, 0.4);
}

.mega-evolution-button.mega-active::before {
    opacity: 0;
}

@keyframes rotate-gradient {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Form Switch Button (for alternate forms like Harebuki) */
.mega-evolution-button.form-switch {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.6), 0 0 0 0 rgba(59, 130, 246, 0.4);
}

.mega-evolution-button.form-switch:hover {
    box-shadow: 0 6px 30px rgba(59, 130, 246, 0.8), 0 0 40px rgba(59, 130, 246, 0.5);
}

.mega-evolution-button.form-switch:hover::before {
    background: linear-gradient(135deg, #60A5FA, #3B82F6, #1D4ED8);
}

@keyframes mega-pulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 4px 20px rgba(245, 158, 11, 0.5);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 0 6px 30px rgba(245, 158, 11, 0.8), 0 0 40px rgba(245, 158, 11, 0.4);
    }
}

/* Mega Evolution Transformation Animation */
.mega-transforming {
    animation: mega-transform 1s ease-out;
    position: relative;
}

/* Mega particle glitter effect */
.mega-transforming::before,
.mega-transforming::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    background-image: url('MegaEvolutionIcon.webp');
    background-size: 30px 30px;
    opacity: 0;
    animation: mega-particles 1s ease-out;
}

.mega-transforming::before {
    background-position: 0 0, 15% 25%, 85% 15%, 50% 40%, 20% 60%, 70% 70%, 40% 85%, 90% 50%, 10% 90%, 60% 10%;
    animation-delay: 0s;
}

.mega-transforming::after {
    background-position: 30% 10%, 80% 30%, 10% 45%, 65% 20%, 45% 65%, 25% 80%, 75% 55%, 50% 95%, 95% 75%, 5% 35%;
    animation-delay: 0.2s;
}

@keyframes mega-particles {
    0% {
        opacity: 0;
        transform: scale(0) rotate(0deg);
        filter: brightness(1);
    }
    20% {
        opacity: 0.6;
        transform: scale(1.2) rotate(180deg);
        filter: brightness(2) blur(1px);
    }
    40% {
        opacity: 0.8;
        transform: scale(1) rotate(360deg);
        filter: brightness(3) blur(0px);
    }
    70% {
        opacity: 0.5;
        transform: scale(0.8) rotate(540deg);
        filter: brightness(2) blur(2px);
    }
    100% {
        opacity: 0;
        transform: scale(0.3) rotate(720deg);
        filter: brightness(1) blur(3px);
    }
}

/* Individual mega particles */
.mega-particle {
    position: fixed;
    width: 40px;
    height: 40px;
    background-image: url('MegaEvolutionIcon.webp');
    background-size: contain;
    background-repeat: no-repeat;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    animation: particle-float 1s ease-out forwards;
}

@keyframes particle-float {
    0% {
        opacity: 0;
        transform: scale(0) rotate(0deg) translateY(0);
        filter: brightness(1);
    }
    15% {
        opacity: 0.7;
        transform: scale(1.3) rotate(180deg) translateY(-20px);
        filter: brightness(2.5) drop-shadow(0 0 10px rgba(147, 51, 234, 0.8));
    }
    30% {
        opacity: 0.9;
        transform: scale(1) rotate(360deg) translateY(-40px);
        filter: brightness(3) drop-shadow(0 0 15px rgba(236, 72, 153, 0.9));
    }
    60% {
        opacity: 0.6;
        transform: scale(0.7) rotate(540deg) translateY(-60px);
        filter: brightness(2) drop-shadow(0 0 8px rgba(147, 51, 234, 0.6));
    }
    100% {
        opacity: 0;
        transform: scale(0.2) rotate(720deg) translateY(-80px);
        filter: brightness(1) blur(2px);
    }
}

@keyframes mega-transform {
    0% {
        transform: scale(1) rotate(0deg);
        filter: brightness(1) contrast(1);
    }
    15% {
        transform: scale(1.08) rotate(2deg);
        filter: brightness(1.4) contrast(1.2);
    }
    30% {
        transform: scale(0.92) rotate(-2deg);
        filter: brightness(2) contrast(1.5) saturate(2);
        box-shadow: 0 0 80px rgba(147, 51, 234, 0.9), 0 0 150px rgba(236, 72, 153, 0.6), inset 0 0 50px rgba(255, 255, 255, 0.3);
    }
    45% {
        transform: scale(1.12) rotate(3deg);
        filter: brightness(2.5) contrast(1.8) saturate(2.5) hue-rotate(10deg);
        box-shadow: 0 0 100px rgba(147, 51, 234, 1), 0 0 200px rgba(236, 72, 153, 0.8), inset 0 0 60px rgba(255, 255, 255, 0.4);
    }
    60% {
        transform: scale(0.96) rotate(-1deg);
        filter: brightness(2) contrast(1.6) saturate(2);
        box-shadow: 0 0 60px rgba(147, 51, 234, 0.8), 0 0 120px rgba(236, 72, 153, 0.5);
    }
    80% {
        transform: scale(1.04) rotate(1deg);
        filter: brightness(1.3) contrast(1.2);
    }
    100% {
        transform: scale(1) rotate(0deg);
        filter: brightness(1) contrast(1);
    }
}

.mega-transforming .pokemon-detail-image {
    animation: image-mega-transform 1s ease-out;
}

@keyframes image-mega-transform {
    0% {
        transform: scale(1) rotateY(0deg);
        opacity: 1;
        filter: brightness(1) blur(0px);
    }
    20% {
        transform: scale(1.15) rotateY(5deg);
        opacity: 0.9;
        filter: brightness(1.8) blur(2px) saturate(1.5);
    }
    40% {
        transform: scale(0.7) rotateY(-5deg);
        opacity: 0.3;
        filter: brightness(3) blur(12px) saturate(3) hue-rotate(20deg);
    }
    60% {
        transform: scale(0.5) rotateY(0deg);
        opacity: 0.1;
        filter: brightness(4) blur(16px) saturate(4) contrast(2);
    }
    75% {
        transform: scale(0.8) rotateY(3deg);
        opacity: 0.5;
        filter: brightness(2.5) blur(8px) saturate(2);
    }
    90% {
        transform: scale(1.1) rotateY(-2deg);
        opacity: 0.8;
        filter: brightness(1.5) blur(2px) saturate(1.3);
    }
    100% {
        transform: scale(1) rotateY(0deg);
        opacity: 1;
        filter: brightness(1) blur(0px);
    }
}

/* Stats */
.pokemon-stats {
    background: white;
    border: 2px solid #F0F0F0;
    border-radius: 16px;
    padding: 1rem;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #F0F0F0;
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-label {
    font-weight: 600;
    color: var(--text-light);
}

.stat-value {
    font-weight: 700;
    color: var(--text-dark);
}

/* Abilities */
.abilities-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.ability-badge {
    background: var(--detail-accent-color, #DC0A2D);
    color: white;
    padding: 0.625rem 1.25rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9375rem;
}

/* Info Lists */
.info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-list li {
    background: var(--bg-light);
    padding: 0.875rem 1rem;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    font-size: 0.9375rem;
    line-height: 1.5;
    border-left: 3px solid var(--detail-accent-color, #DC0A2D);
}

.info-list li:last-child {
    margin-bottom: 0;
}

/* Type Badges */
.type-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* Evolution Chain */
.evolution-chain {
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 0.75rem;
    padding: 1rem 0;
    overflow-x: auto;
}

.evolution-stage {
    text-align: center;
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.evolution-stage:hover {
    transform: scale(1.05);
}

.evolution-image-container {
    width: 120px;
    height: 120px;
    margin: 0 auto 0.5rem;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: 0 4px 12px var(--shadow-light);
    overflow: hidden;
    border: 3px solid var(--bg-light);
}

.evolution-image {
    width: 140%;
    height: 140%;
    object-fit: cover;
    object-position: center;
}

.evolution-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
}

.evolution-number {
    font-size: 0.75rem;
    color: var(--text-light);
}

.evolution-arrow {
    font-size: 1.5rem;
    color: var(--text-light);
    flex-shrink: 0;
}

/* Navigation Arrows */
.detail-navigation {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6rem;
    z-index: 300;
}

.nav-arrow {
    background: linear-gradient(135deg, var(--detail-accent-color, #DC0A2D) 0%, rgba(255,255,255,0.2) 100%);
    border: 4px solid white;
    color: white;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 20px var(--shadow-heavy), 0 0 0 0 var(--detail-accent-color);
    transition: all 0.3s ease;
    animation: pulse-hint 2s ease-in-out infinite;
}

@keyframes pulse-hint {
    0%, 100% { box-shadow: 0 6px 20px var(--shadow-heavy), 0 0 0 0 var(--detail-accent-color); }
    50% { box-shadow: 0 8px 25px var(--shadow-heavy), 0 0 0 8px rgba(255,255,255,0.2); }
}

.nav-arrow:hover {
    transform: scale(1.1);
    animation: none;
}

.nav-arrow:active {
    transform: scale(0.95);
    box-shadow: 0 3px 10px var(--shadow-heavy), 0 0 20px var(--detail-accent-color);
}

.nav-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ===================================
   Responsive Design
   =================================== */

/* Small phones (portrait) - 2 columns */
@media (max-width: 374px) {
    .pokemon-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        padding: 0.75rem;
    }
}

/* Standard phones (portrait) - 2 columns */
@media (min-width: 375px) and (max-width: 479px) {
    .pokemon-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
        padding: 0.8rem;
    }
}

/* Large phones (portrait) - 2 columns */
@media (min-width: 480px) and (max-width: 599px) {
    .pokemon-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        padding: 1rem;
    }
}

/* Phones (landscape) and small tablets (portrait) - 3 columns */
@media (min-width: 600px) and (max-width: 767px) {
    .pokemon-list {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
        padding: 1rem;
    }
}

/* Tablets (portrait) - 3 columns */
@media (min-width: 768px) and (max-width: 1023px) {
    .pokemon-list {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.25rem;
        padding: 1.25rem;
    }
}

/* Tablets (landscape) and small desktops - 4 columns */
@media (min-width: 1024px) and (max-width: 1279px) {
    .pokemon-list {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem;
        padding: 1.5rem;
    }
}

/* Desktops - 5 columns */
@media (min-width: 1280px) and (max-width: 1679px) {
    .pokemon-list {
        grid-template-columns: repeat(5, 1fr);
        gap: 1.5rem;
        padding: 1.5rem;
    }
}

/* Large desktops - 6 columns */
@media (min-width: 1680px) {
    .pokemon-list {
        grid-template-columns: repeat(6, 1fr);
        gap: 2rem;
        padding: 2rem;
    }
}

/* Orientation-specific overrides for tablets */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    .pokemon-list {
        grid-template-columns: repeat(4, 1fr);
        gap: 1rem;
    }
}

@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    .pokemon-list {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.25rem;
    }
}

@media (min-width: 769px) {
    .app-container {
        margin-top: 2rem;
        border-radius: 20px;
        max-height: 95vh;
    }

    .app-header {
        border-radius: 20px 20px 0 0;
    }
}

/* Smooth Scrolling */
.pokemon-list,
.pokemon-detail {
    scroll-behavior: smooth;
}

/* Selection Styling */
::selection {
    background: #DC0A2D;
    color: white;
}
