/**
 * Pokemon Encyclopedia - Custom Styles
 *
 * Cải thiện giao diện với CSS tùy chỉnh
 * - Fixed image sizing
 * - Better card styling
 * - Smooth animations
 * - Improved responsiveness
 */

/* ============================================================================
   ROOT VARIABLES
   ============================================================================ */
:root {
    /* Colors */
    --pokemon-red: #EE1515;
    --pokemon-blue: #3B4CCA;
    --pokemon-yellow: #FFDE00;
    --pokemon-gold: #B3A125;

    /* Card sizing */
    --card-image-size: 180px;
    --card-image-size-sm: 140px;
    --card-image-size-xs: 100px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
    --transition-slow: 500ms ease;
}

/* ============================================================================
   GLOBAL IMPROVEMENTS
   ============================================================================ */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Better font rendering */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Selection color */
::selection {
    background-color: var(--pokemon-blue);
    color: white;
}

/* Link reset - no underline by default */
.no-underline {
    text-decoration: none !important;
}

.no-underline:hover {
    text-decoration: none !important;
}

/* Header and Footer links should not have default blue color */
header a,
nav a,
footer a {
    text-decoration: none;
}

header a:hover,
nav a:hover {
    text-decoration: none;
}

footer a:hover {
    text-decoration: none;
}

/* ============================================================================
   DROPDOWN MENU - Stats Rankings Dropdown
   ============================================================================ */

/* Dropdown container */
.dropdown-container {
    position: relative;
    z-index: 100;
}

/* Dropdown menu - hidden by default */
.dropdown-menu {
    position: absolute;
    left: 0;
    top: 100%;
    margin-top: 0;
    min-width: 13rem;
    background-color: #ffffff;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25),
                0 8px 10px -6px rgba(0, 0, 0, 0.15);
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    z-index: 9999 !important;
    list-style: none !important;
    margin: 0;
}

/* Show dropdown on hover or focus */
.dropdown-container:hover .dropdown-menu,
.dropdown-container:focus-within .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Dropdown menu list items */
.dropdown-menu li {
    list-style: none !important;
    margin: 0;
    padding: 0;
}

/* Dropdown menu links */
.dropdown-menu a {
    display: block;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    color: #374151;
    text-decoration: none !important;
    transition: background-color 0.1s ease, color 0.1s ease;
    white-space: nowrap;
}

.dropdown-menu a:hover {
    background-color: #3b82f6;
    color: #ffffff;
}

/* Dropdown arrow rotation on hover */
.dropdown-container:hover .dropdown-arrow,
.dropdown-container:focus-within .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-arrow {
    transition: transform 0.2s ease;
}

/* Ensure navigation has visible overflow */
nav[role="navigation"] {
    overflow: visible !important;
}

nav[role="navigation"] > div {
    overflow: visible !important;
}

/* Header should not clip dropdown */
header[role="banner"] {
    overflow: visible !important;
}

/* ============================================================================
   POKEMON CARD STYLING
   ============================================================================ */

/* Pokemon card container */
.pokemon-card {
    position: relative;
    overflow: hidden;
    transition: transform var(--transition-normal),
                box-shadow var(--transition-normal);
    border-radius: 16px;
    background: white;
}

.pokemon-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Pokemon image container - FIXED SIZE */
.pokemon-image-container {
    width: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    overflow: hidden;
    position: relative;
}

/* Pokemon image - consistent sizing */
.pokemon-image {
    width: 75%;
    height: 75%;
    object-fit: contain;
    transition: transform var(--transition-normal);
}

.pokemon-card:hover .pokemon-image {
    transform: scale(1.15);
}

/* Pokemon image with fixed dimensions */
.pokemon-img-fixed {
    width: var(--card-image-size);
    height: var(--card-image-size);
    object-fit: contain;
    padding: 12px;
}

@media (max-width: 768px) {
    .pokemon-img-fixed {
        width: var(--card-image-size-sm);
        height: var(--card-image-size-sm);
    }
}

@media (max-width: 480px) {
    .pokemon-img-fixed {
        width: var(--card-image-size-xs);
        height: var(--card-image-size-xs);
    }
}

/* ============================================================================
   POKEMON GRID IMPROVEMENTS
   ============================================================================ */

/* Grid layout */
.pokemon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 24px;
}

@media (max-width: 768px) {
    .pokemon-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .pokemon-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

/* ============================================================================
   STAT BARS STYLING
   ============================================================================ */

/* Stat bar container */
.stat-bar {
    height: 24px;
    background: linear-gradient(90deg, #f1f5f9 0%, #e2e8f0 100%);
    border-radius: 12px;
    overflow: visible;
    position: relative;
    display: flex;
    align-items: center;
}

/* Stat bar fill */
.stat-bar-fill {
    height: 100%;
    border-radius: 12px;
    transition: width var(--transition-slow);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
}

/* Stat value text inside bar */
.stat-value {
    font-size: 11px;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
    padding: 0 8px;
}

/* Large stat value for total */
.stat-value-lg {
    font-size: 14px;
}

/* Total stat bar (larger) */
.stat-bar-total {
    height: 32px;
}

.stat-bar-total .stat-bar-fill {
    min-width: 60px;
}

/* Shimmer effect on stat bars */
.stat-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    100% {
        left: 100%;
    }
}

/* Stat colors */
.stat-hp { background: linear-gradient(90deg, #ef4444 0%, #f87171 100%); }
.stat-attack { background: linear-gradient(90deg, #f97316 0%, #fb923c 100%); }
.stat-defense { background: linear-gradient(90deg, #eab308 0%, #facc15 100%); }
.stat-sp-attack { background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%); }
.stat-sp-defense { background: linear-gradient(90deg, #22c55e 0%, #4ade80 100%); }
.stat-speed { background: linear-gradient(90deg, #ec4899 0%, #f472b6 100%); }
.stat-total { background: linear-gradient(90deg, #8b5cf6 0%, #a78bfa 100%); }

/* ============================================================================
   TIER BADGES
   ============================================================================ */

.tier-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 14px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.tier-s { background: linear-gradient(135deg, #7c3aed, #a855f7); color: white; }
.tier-a { background: linear-gradient(135deg, #dc2626, #ef4444); color: white; }
.tier-b { background: linear-gradient(135deg, #ea580c, #f97316); color: white; }
.tier-c { background: linear-gradient(135deg, #ca8a04, #eab308); color: #1f2937; }
.tier-d { background: linear-gradient(135deg, #16a34a, #22c55e); color: white; }
.tier-f { background: linear-gradient(135deg, #4b5563, #6b7280); color: white; }

/* ============================================================================
   BUTTONS
   ============================================================================ */

.btn-pokemon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-weight: 600;
    border-radius: 12px;
    transition: all var(--transition-fast);
    cursor: pointer;
    border: none;
    text-decoration: none;
}

.btn-pokemon:hover {
    transform: translateY(-2px);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--pokemon-blue), #5b6ee1);
    color: white;
    box-shadow: 0 4px 14px rgba(59, 76, 202, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(59, 76, 202, 0.4);
}

.btn-yellow {
    background: linear-gradient(135deg, var(--pokemon-yellow), #ffe066);
    color: #1f2937;
    box-shadow: 0 4px 14px rgba(255, 222, 0, 0.3);
}

.btn-yellow:hover {
    box-shadow: 0 6px 20px rgba(255, 222, 0, 0.4);
}

/* ============================================================================
   HERO SECTION
   ============================================================================ */

.hero-section {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #1e3a8a 100%);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='30' cy='30' r='20' fill='none' stroke='%23ffffff' stroke-width='1' opacity='0.1'/%3E%3C/svg%3E");
    background-size: 60px 60px;
    opacity: 0.5;
}

/* ============================================================================
   IMAGE GALLERY
   ============================================================================ */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
}

.gallery-item {
    aspect-ratio: 1 / 1;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.gallery-item:hover {
    transform: scale(1.05);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}

/* ============================================================================
   COMPARISON PAGE
   ============================================================================ */

.vs-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--pokemon-yellow), #ffe066);
    color: #1f2937;
    font-weight: 800;
    font-size: 24px;
    padding: 16px 32px;
    border-radius: 50px;
    box-shadow: 0 8px 24px rgba(255, 222, 0, 0.4);
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 8px 24px rgba(255, 222, 0, 0.4);
    }
    50% {
        box-shadow: 0 8px 40px rgba(255, 222, 0, 0.6);
    }
}

.winner-highlight {
    position: relative;
}

.winner-highlight::before {
    content: '';
    position: absolute;
    inset: -4px;
    background: linear-gradient(135deg, var(--pokemon-yellow), #ffe066);
    border-radius: 20px;
    z-index: -1;
    animation: winner-glow 1.5s infinite;
}

@keyframes winner-glow {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* ============================================================================
   SIDEBAR CARDS
   ============================================================================ */

.sidebar-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: box-shadow var(--transition-normal);
}

.sidebar-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.sidebar-card-gradient {
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    color: white;
}

/* ============================================================================
   QUICK STATS DISPLAY
   ============================================================================ */

.quick-stat {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.quick-stat-hp {
    background: #fef2f2;
    color: #dc2626;
}

.quick-stat-atk {
    background: #fff7ed;
    color: #ea580c;
}

.quick-stat-def {
    background: #fefce8;
    color: #ca8a04;
}

.quick-stat-total {
    background: #f5f3ff;
    color: #7c3aed;
}

/* ============================================================================
   SEARCH BOX
   ============================================================================ */

.search-box {
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 14px 20px 14px 48px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    transition: all var(--transition-fast);
    background: white;
}

.search-box input:focus {
    outline: none;
    border-color: var(--pokemon-blue);
    box-shadow: 0 0 0 4px rgba(59, 76, 202, 0.1);
}

.search-box svg {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

/* ============================================================================
   PAGINATION
   ============================================================================ */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 16px;
    border-radius: 10px;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.pagination a {
    background: white;
    color: #4b5563;
    border: 1px solid #e5e7eb;
}

.pagination a:hover {
    background: var(--pokemon-blue);
    color: white;
    border-color: var(--pokemon-blue);
    text-decoration: none;
}

.pagination .active {
    background: var(--pokemon-blue);
    color: white;
}

/* ============================================================================
   LOADING & ANIMATIONS
   ============================================================================ */

/* Skeleton loading */
.skeleton {
    background: linear-gradient(
        90deg,
        #f1f5f9 25%,
        #e2e8f0 50%,
        #f1f5f9 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Fade in animation */
.fade-in {
    animation: fadeIn var(--transition-normal) ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger animation for grid items */
.pokemon-grid > * {
    animation: slideUp 0.4s ease-out backwards;
}

.pokemon-grid > *:nth-child(1) { animation-delay: 0.05s; }
.pokemon-grid > *:nth-child(2) { animation-delay: 0.1s; }
.pokemon-grid > *:nth-child(3) { animation-delay: 0.15s; }
.pokemon-grid > *:nth-child(4) { animation-delay: 0.2s; }
.pokemon-grid > *:nth-child(5) { animation-delay: 0.25s; }
.pokemon-grid > *:nth-child(6) { animation-delay: 0.3s; }
.pokemon-grid > *:nth-child(7) { animation-delay: 0.35s; }
.pokemon-grid > *:nth-child(8) { animation-delay: 0.4s; }

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================================
   HEADER IMPROVEMENTS
   ============================================================================ */

.site-header {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.nav-link {
    position: relative;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all var(--transition-fast);
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--pokemon-yellow);
    transition: all var(--transition-fast);
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 80%;
}

/* ============================================================================
   FOOTER IMPROVEMENTS
   ============================================================================ */

.site-footer {
    background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
}

.footer-link {
    transition: color var(--transition-fast), transform var(--transition-fast);
    display: inline-block;
}

.footer-link:hover {
    color: white;
    transform: translateX(4px);
}

/* ============================================================================
   RESPONSIVE IMAGE FIXES
   ============================================================================ */

/* Ensure all Pokemon images maintain aspect ratio */
img[alt*="Pokemon"],
img[alt*="pokemon"],
.pokemon-card img,
.gallery-item img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

/* Fixed size containers for consistent layout */
.img-container-sm {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.img-container-md {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
}

.img-container-lg {
    width: 128px;
    height: 128px;
    flex-shrink: 0;
}

.img-container-xl {
    width: 200px;
    height: 200px;
    flex-shrink: 0;
}

.img-container-sm img,
.img-container-md img,
.img-container-lg img,
.img-container-xl img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ============================================================================
   SCROLLBAR STYLING
   ============================================================================ */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--pokemon-blue), #5b6ee1);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #1e40af, var(--pokemon-blue));
}

/* ============================================================================
   SVG BACKGROUNDS & PATTERNS
   ============================================================================ */

/* Pokeball Pattern - Subtle background */
.bg-pokeball-pattern {
    background-color: #1e40af;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Ccircle stroke='%23ffffff' stroke-opacity='0.08' cx='30' cy='30' r='20' stroke-width='2'/%3E%3Ccircle fill='%23ffffff' fill-opacity='0.05' cx='30' cy='30' r='6'/%3E%3Cpath d='M10 30h14M36 30h14' stroke='%23ffffff' stroke-opacity='0.08' stroke-width='2'/%3E%3C/g%3E%3C/svg%3E");
}

/* Pokeball Pattern - Dark variant for footer */
.bg-pokeball-pattern-dark {
    background-color: #1f2937;
    background-image: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Ccircle stroke='%23ffffff' stroke-opacity='0.03' cx='40' cy='40' r='25' stroke-width='2'/%3E%3Ccircle fill='%23ffffff' fill-opacity='0.02' cx='40' cy='40' r='8'/%3E%3Cpath d='M15 40h17M48 40h17' stroke='%23ffffff' stroke-opacity='0.03' stroke-width='2'/%3E%3C/g%3E%3C/svg%3E");
}

/* Floating Pokeballs Pattern */
.bg-floating-pokeballs {
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3Cpattern id='pokeball' x='0' y='0' width='100' height='100' patternUnits='userSpaceOnUse'%3E%3Ccircle cx='25' cy='25' r='12' fill='none' stroke='%23ffffff' stroke-opacity='0.1' stroke-width='1.5'/%3E%3Cpath d='M13 25h9M28 25h9' stroke='%23ffffff' stroke-opacity='0.1' stroke-width='1.5'/%3E%3Ccircle cx='25' cy='25' r='3' fill='%23ffffff' fill-opacity='0.08'/%3E%3Ccircle cx='75' cy='75' r='8' fill='none' stroke='%23ffffff' stroke-opacity='0.06' stroke-width='1'/%3E%3Cpath d='M67 75h5M78 75h5' stroke='%23ffffff' stroke-opacity='0.06' stroke-width='1'/%3E%3Ccircle cx='75' cy='75' r='2' fill='%23ffffff' fill-opacity='0.05'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='100' height='100' fill='url(%23pokeball)'/%3E%3C/svg%3E");
}

/* Hero gradient with Pokeball overlay */
.hero-pokemon-bg {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #1e3a8a 100%);
    position: relative;
}

.hero-pokemon-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='120' height='120' viewBox='0 0 120 120' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none'%3E%3Ccircle cx='60' cy='60' r='35' stroke='%23ffffff' stroke-opacity='0.07' stroke-width='2'/%3E%3Ccircle cx='60' cy='60' r='10' fill='%23ffffff' fill-opacity='0.05'/%3E%3Cpath d='M25 60h25M70 60h25' stroke='%23ffffff' stroke-opacity='0.07' stroke-width='2'/%3E%3Ccircle cx='15' cy='15' r='8' stroke='%23ffffff' stroke-opacity='0.04' stroke-width='1'/%3E%3Ccircle cx='105' cy='105' r='12' stroke='%23ffffff' stroke-opacity='0.04' stroke-width='1'/%3E%3Ccircle cx='105' cy='20' r='6' stroke='%23ffffff' stroke-opacity='0.03' stroke-width='1'/%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

/* Wave SVG Top */
.wave-top {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
}

.wave-top svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 50px;
}

/* Wave SVG Bottom */
.wave-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
    transform: rotate(180deg);
}

.wave-bottom svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 50px;
}

/* Diagonal stripes pattern */
.bg-diagonal-stripes {
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 40L40 0H20L0 20M40 40V20L20 40' fill='%23ffffff' fill-opacity='0.03'/%3E%3C/svg%3E");
}

/* Dots pattern */
.bg-dots-pattern {
    background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='2' cy='2' r='1' fill='%23ffffff' fill-opacity='0.1'/%3E%3C/svg%3E");
}

/* Grid pattern */
.bg-grid-pattern {
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h40v40H0V0zm1 1v38h38V1H1z' fill='%23ffffff' fill-opacity='0.03'/%3E%3C/svg%3E");
}

/* Circuit/Tech pattern */
.bg-circuit-pattern {
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='0.05'%3E%3Cpath d='M30 0v15M30 45v15M0 30h15M45 30h15'/%3E%3Ccircle cx='30' cy='30' r='3'/%3E%3Ccircle cx='30' cy='15' r='2'/%3E%3Ccircle cx='30' cy='45' r='2'/%3E%3Ccircle cx='15' cy='30' r='2'/%3E%3Ccircle cx='45' cy='30' r='2'/%3E%3C/g%3E%3C/svg%3E");
}

/* Stars/sparkle pattern */
.bg-sparkle-pattern {
    background-image: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.08'%3E%3Cpath d='M20 20l2-6 2 6 6 2-6 2-2 6-2-6-6-2z'/%3E%3Cpath d='M60 55l1.5-4.5 1.5 4.5 4.5 1.5-4.5 1.5-1.5 4.5-1.5-4.5-4.5-1.5z' fill-opacity='0.05'/%3E%3Ccircle cx='65' cy='20' r='1' fill-opacity='0.1'/%3E%3Ccircle cx='15' cy='60' r='1.5' fill-opacity='0.06'/%3E%3C/g%3E%3C/svg%3E");
}

/* Pokemon Stats Hexagon Background */
.bg-hexagon-pattern {
    background-image: url("data:image/svg+xml,%3Csvg width='50' height='43.4' viewBox='0 0 50 43.4' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M25 0l25 14.4v14.4L25 43.4 0 28.8V14.4z' fill='none' stroke='%23ffffff' stroke-opacity='0.05' stroke-width='1'/%3E%3C/svg%3E");
}

/* Decorative corner SVGs */
.corner-decoration-tl::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 150px;
    height: 150px;
    background-image: url("data:image/svg+xml,%3Csvg width='150' height='150' viewBox='0 0 150 150' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='0' cy='0' r='100' fill='none' stroke='%23ffffff' stroke-opacity='0.1' stroke-width='2'/%3E%3Ccircle cx='0' cy='0' r='60' fill='none' stroke='%23ffffff' stroke-opacity='0.05' stroke-width='1'/%3E%3C/svg%3E");
    pointer-events: none;
}

.corner-decoration-br::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 200px;
    height: 200px;
    background-image: url("data:image/svg+xml,%3Csvg width='200' height='200' viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='200' cy='200' r='120' fill='none' stroke='%23ffffff' stroke-opacity='0.08' stroke-width='2'/%3E%3Ccircle cx='200' cy='200' r='80' fill='none' stroke='%23ffffff' stroke-opacity='0.04' stroke-width='1'/%3E%3C/svg%3E");
    pointer-events: none;
}

/* Animated floating Pokeball */
@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(5deg); }
}

.floating-pokeball {
    animation: float 4s ease-in-out infinite;
}

/* Large decorative Pokeball SVG */
.pokeball-decoration {
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='50' cy='50' r='45' fill='none' stroke='%23ffffff' stroke-opacity='0.1' stroke-width='3'/%3E%3Cpath d='M5 50h35M60 50h35' stroke='%23ffffff' stroke-opacity='0.1' stroke-width='3'/%3E%3Ccircle cx='50' cy='50' r='12' fill='none' stroke='%23ffffff' stroke-opacity='0.15' stroke-width='3'/%3E%3Ccircle cx='50' cy='50' r='6' fill='%23ffffff' fill-opacity='0.1'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
}

/* Thunder/Electric pattern for special sections */
.bg-electric-pattern {
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 5l5 15h-4l6 20-12-15h5l-6-20h6z' fill='%23fbbf24' fill-opacity='0.1'/%3E%3C/svg%3E");
}

/* Fire pattern */
.bg-fire-pattern {
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 5c0 8-6 12-6 18 0 4 3 7 6 7s6-3 6-7c0-6-6-10-6-18z' fill='%23ef4444' fill-opacity='0.08'/%3E%3C/svg%3E");
}

/* Water pattern */
.bg-water-pattern {
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cellipse cx='20' cy='25' rx='8' ry='10' fill='%233b82f6' fill-opacity='0.08'/%3E%3Cpath d='M20 5c-5 8-8 12-8 20' fill='none' stroke='%233b82f6' stroke-opacity='0.06' stroke-width='2'/%3E%3C/svg%3E");
}

/* Grass pattern */
.bg-grass-pattern {
    background-image: url("data:image/svg+xml,%3Csvg width='30' height='30' viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M15 25c-3-5-3-15 0-20M10 25c-1-4 0-10 3-15M20 25c1-4 0-10-3-15' fill='none' stroke='%2322c55e' stroke-opacity='0.1' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* Header gradient with pattern */
.header-pokemon-gradient {
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 50%, #1d4ed8 100%);
    position: relative;
}

.header-pokemon-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='40' cy='40' r='25' fill='none' stroke='%23ffffff' stroke-opacity='0.06' stroke-width='1.5'/%3E%3Cpath d='M15 40h17M48 40h17' stroke='%23ffffff' stroke-opacity='0.06' stroke-width='1.5'/%3E%3Ccircle cx='40' cy='40' r='7' fill='%23ffffff' fill-opacity='0.04'/%3E%3C/svg%3E");
    pointer-events: none;
}

/* Footer gradient with pattern */
.footer-pokemon-gradient {
    background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
    position: relative;
}

.footer-pokemon-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='50' cy='50' r='30' fill='none' stroke='%23ffffff' stroke-opacity='0.02' stroke-width='1'/%3E%3Cpath d='M20 50h22M58 50h22' stroke='%23ffffff' stroke-opacity='0.02' stroke-width='1'/%3E%3Ccircle cx='50' cy='50' r='8' fill='%23ffffff' fill-opacity='0.015'/%3E%3Ccircle cx='10' cy='10' r='15' fill='none' stroke='%23ffffff' stroke-opacity='0.015'/%3E%3Ccircle cx='90' cy='90' r='20' fill='none' stroke='%23ffffff' stroke-opacity='0.015'/%3E%3C/svg%3E");
    pointer-events: none;
}

/* Navigation bar gradient */
.nav-pokemon-gradient {
    background: linear-gradient(90deg, #1e3a8a 0%, #1e40af 50%, #1e3a8a 100%);
}

/* Card hover decoration */
.pokemon-card-decorated {
    position: relative;
    overflow: hidden;
}

.pokemon-card-decorated::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='50' cy='50' r='40' fill='none' stroke='%233b82f6' stroke-opacity='0.1' stroke-width='1'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.pokemon-card-decorated:hover::before {
    opacity: 1;
}

/* Battle VS section background */
.battle-arena-bg {
    background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 50%, #6366f1 100%);
    position: relative;
}

.battle-arena-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='0.08'%3E%3Cpath d='M0 50h100M50 0v100'/%3E%3Ccircle cx='50' cy='50' r='30'/%3E%3Ccircle cx='50' cy='50' r='15'/%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

/* Stats section background */
.stats-section-bg {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    position: relative;
}

.stats-section-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='5' y='5' width='50' height='50' rx='5' fill='none' stroke='%233b82f6' stroke-opacity='0.05' stroke-width='1'/%3E%3C/svg%3E");
    pointer-events: none;
}

/* ============================================================================
   ACCESSIBILITY
   ============================================================================ */

/* Focus styles */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 3px solid var(--pokemon-yellow);
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .pokemon-card {
        border: 2px solid #000;
    }

    .stat-bar {
        border: 1px solid #000;
    }
}

/* ============================================================================
   LEGAL PAGES - Terms of Service & Privacy Policy
   ============================================================================ */

/* Page Header */
.legal-page-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.legal-page-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: #1f2937;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.legal-page-header h1::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--pokemon-blue), var(--pokemon-red));
    border-radius: 2px;
}

/* Prose/Content Styling for Legal Pages */
.prose-legal {
    color: #374151;
    line-height: 1.8;
}

/* H2 - Main Sections */
.prose-legal h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e40af;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e5e7eb;
    position: relative;
}

.prose-legal h2::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, var(--pokemon-blue), #60a5fa);
}

/* Section numbers in H2 */
.prose-legal h2:first-of-type {
    margin-top: 0;
}

/* H3 - Subsections */
.prose-legal h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #374151;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    padding-left: 1rem;
    border-left: 3px solid var(--pokemon-blue);
}

/* H4 - Sub-subsections */
.prose-legal h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #4b5563;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    padding-left: 0.75rem;
    border-left: 2px solid #9ca3af;
}

/* Paragraphs */
.prose-legal p {
    margin-bottom: 1rem;
}

/* Lists */
.prose-legal ul,
.prose-legal ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.prose-legal li {
    margin-bottom: 0.5rem;
    position: relative;
}

.prose-legal ul li::marker {
    color: var(--pokemon-blue);
}

.prose-legal ol li::marker {
    color: var(--pokemon-blue);
    font-weight: 600;
}

/* Links */
.prose-legal a {
    color: var(--pokemon-blue);
    text-decoration: underline;
    text-decoration-color: #93c5fd;
    text-underline-offset: 2px;
    transition: all 0.2s ease;
}

.prose-legal a:hover {
    color: #1e40af;
    text-decoration-color: var(--pokemon-blue);
}

/* Strong/Bold text */
.prose-legal strong {
    color: #1f2937;
    font-weight: 600;
}

/* Horizontal Rule */
.prose-legal hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, #d1d5db, transparent);
    margin: 2.5rem 0;
}

/* Section styling */
.prose-legal section {
    margin-bottom: 2rem;
}

/* Legal notice boxes */
.prose-legal .legal-notice {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-left: 4px solid #f59e0b;
    padding: 1rem 1.25rem;
    border-radius: 0 0.5rem 0.5rem 0;
    margin: 1.5rem 0;
}

.prose-legal .legal-notice p {
    margin: 0;
    color: #92400e;
    font-size: 0.875rem;
}

/* Important text (ALL CAPS sections) */
.prose-legal p:has(strong:only-child),
.prose-legal p:where(:contains("SHALL")) {
    background: #f9fafb;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    font-size: 0.875rem;
}

/* Table of Contents style navigation */
.legal-nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.legal-nav a {
    color: var(--pokemon-blue);
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    background: #eff6ff;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
}

.legal-nav a:hover {
    background: var(--pokemon-blue);
    color: white;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .legal-page-header h1 {
        font-size: 1.875rem;
    }

    .prose-legal h2 {
        font-size: 1.25rem;
    }

    .prose-legal h3 {
        font-size: 1rem;
    }

    .prose-legal h4 {
        font-size: 0.9375rem;
    }
}
