/* Base Styles */
:root {
    --primary-color: #5b2a8a;
    --secondary-color: #8e44ad;
    --accent-color: #f39c12;
    --text-color: #333;
    --text-light: #777;
    --bg-color: #f9f9f9;
    --card-bg: #fff;
    --header-bg: #2c1447;
    --footer-bg: #1a0c2e;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}


.character-sprite {
    width: 128px;
    height: 128px;
    background-position: 0 0;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    image-rendering: pixelated;
    flex-shrink: 0;
    margin-right: 3rem;
} 

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header */
header {
    background-color: var(--header-bg);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

header h1 {
    font-size: 1.8rem;
}

nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    margin-top: 1rem;
}

nav ul li {
    margin-right: 1.5rem;
}

nav ul li a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
}

nav ul li a:after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--accent-color);
    transition: width 0.3s;
}

nav ul li a:hover:after,
nav ul li a.active:after {
    width: 100%;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 3rem 1rem;
    border-radius: var(--border-radius);
    margin: 2rem 0;
    text-align: center;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto;
}

/* Category Cards */
.categories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.category-card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
}

.category-card:hover {
    transform: translateY(-5px);
}

.category-card img {
    width: 100%;
    height: 180px;
    object-fit: contain;
    background-color: rgba(0,0,0,0.05);
    padding: 1rem;
}

.category-card h3 {
    color: var(--primary-color);
    padding: 1rem 1rem 0.5rem;
}

.category-card p {
    padding: 0 1rem 1rem;
    color: var(--text-light);
    flex-grow: 1;
}

.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    text-decoration: none;
    border-radius: 4px;
    text-align: center;
    margin: 0 1rem 1rem;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: var(--secondary-color);
}

/* Footer */
footer {
    background-color: var(--footer-bg);
    color: white;
    padding: 1.5rem 0;
    margin-top: 3rem;
    text-align: center;
}

/* Data Grid and Cards */
.data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.data-card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    display: flex;
    flex-direction: column;
}

.data-card-header {
    display: flex;
    padding: 1rem;
    border-bottom: 1px solid #eee;
    align-items: center;
}

.data-card-header img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-right: 1rem;
}

.data-card-header h3 {
    flex-grow: 1;
    color: var(--primary-color);
}

.data-card-body {
    padding: 1rem;
    flex-grow: 1;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.stat {
    display: flex;
    align-items: center;
}

.stat-label {
    font-weight: bold;
    margin-right: 0.5rem;
    color: var(--text-light);
}

.stat-value {
    color: var(--text-color);
}

.data-card-footer {
    padding: 1rem;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
}

/* Tabs */
.tab-container {
    margin: 2rem 0;
}

.tab-buttons {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    scrollbar-width: thin;
}

.tab-button {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    font-weight: 500;
    position: relative;
    white-space: nowrap;
}

.tab-button.active {
    color: var(--primary-color);
}

.tab-button.active:after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Detail View */
.detail-view {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 2rem;
    margin: 2rem 0;
}

.detail-header {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
}

.detail-header img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin-right: 2rem;
    background-color: rgba(0,0,0,0.05);
    padding: 1rem;
    border-radius: var(--border-radius);
}

.detail-title h2 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.detail-title p {
    color: var(--text-light);
}

.detail-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.detail-stat {
    background-color: #f5f5f5;
    padding: 1rem;
    border-radius: var(--border-radius);
}

.detail-stat h4 {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.detail-stat .value {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.detail-description {
    margin-bottom: 2rem;
}

.detail-section {
    margin-bottom: 2rem;
}

.detail-section h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

/* Upgrade Level Chart */
.level-chart {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
}

.level-chart th, .level-chart td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.level-chart th {
    background-color: #f5f5f5;
    color: var(--text-light);
    font-weight: 500;
}

/* Search and Filter */
.search-bar {
    margin: 2rem 0;
    display: flex;
    gap: 1rem;
}

.search-input {
    flex-grow: 1;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
}

.filter-select {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
    min-width: 150px;
}

/* Progress Bar */
.progress-container {
    background-color: #eee;
    border-radius: 4px;
    height: 8px;
    width: 100%;
    margin-top: 0.25rem;
}

.progress-bar {
    height: 100%;
    border-radius: 4px;
    background-color: var(--primary-color);
}

/* Sprite Animation */
.sprite {
    display: inline-block;
    background-repeat: no-repeat;
    background-size: cover;
    image-rendering: pixelated;
}

/* Responsive Design */
@media (max-width: 768px) {
    .data-grid {
        grid-template-columns: 1fr;
    }
    
    .detail-header {
        flex-direction: column;
        text-align: center;
    }
    
    .detail-header img {
        margin-right: 0;
        margin-bottom: 1rem;
    }
    
    .detail-stats {
        grid-template-columns: 1fr 1fr;
    }
    
    nav ul {
        justify-content: space-between;
    }
    
    nav ul li {
        margin-right: 0;
    }
}

@media (min-width: 768px) {
    header .container {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    nav ul {
        margin-top: 0;
    }
}

/* Improved Ability Detail Styling */

/* Main ability detail container */
.ability-detail {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 2rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Ability header section */
.ability-header {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #f0f0f0;
    background: linear-gradient(to right, #f9f9f9, white);
}

.ability-icon {
    width: 80px;
    height: 80px;
    background-color: #f5f5f5;
    border-radius: 12px;
    padding: 0.5rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-right: 1.5rem;
    flex-shrink: 0;
}

.ability-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ability-title-section {
    flex-grow: 1;
}

.ability-title {
    font-size: 1.8rem;
    margin: 0 0 0.5rem 0;
    color: var(--primary-color);
    font-weight: 700;
}

/* Type badge */
.ability-type {
    display: inline-block;
    padding: 0.4rem 1rem;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ability-type.active {
    background-color: #3498db;
    color: white;
}

.ability-type.passive {
    background-color: #2ecc71;
    color: white;
}

.ability-type.evolution {
    background-color: #9b59b6;
    color: white;
}

/* Description section */
.ability-description {
    padding: 1.5rem;
    font-size: 1.1rem;
    line-height: 1.6;
    border-bottom: 1px solid #f0f0f0;
    color: #444;
}

/* Section headers */
.ability-section-title {
    padding: 1rem 1.5rem;
    margin: 0;
    font-size: 1.3rem;
    color: var(--primary-color);
    background-color: #f9f9f9;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
}

.ability-section-title:before {
    content: "";
    width: 4px;
    height: 1.3rem;
    background-color: var(--primary-color);
    margin-right: 0.75rem;
    border-radius: 4px;
    display: inline-block;
}

/* Evolution requirements */
.evolution-requirements {
    padding: 1.5rem;
    background-color: #faf7fd;
}

.evolution-req-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.evolution-req-item {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    padding: 1rem;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.evolution-req-item:last-child {
    margin-bottom: 0;
}

.req-ability {
    font-weight: 600;
    color: var(--primary-color);
    margin-right: 0.5rem;
}

.req-level {
    background-color: var(--primary-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.85rem;
    margin: 0 0.5rem;
}

.req-remove {
    margin-left: auto;
    background-color: #fd7272;
    color: white;
    padding: 0.2rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Level progression styling */
.level-progression {
    padding: 0 1.5rem 1.5rem;
}

/* Level tabs */
.level-tabs {
    display: flex;
    overflow-x: auto;
    padding: 0 1rem;
    margin: 0 -1.5rem;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.level-tabs::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.level-tab {
    flex: 0 0 auto;
    padding: 0.75rem 1.25rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 600;
    color: #777;
    transition: all 0.2s;
    position: relative;
}

.level-tab.active {
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
}

.level-tab:hover:not(.active) {
    background-color: #f9f9f9;
    color: #555;
}

/* Level content */
.level-content {
    display: none;
    padding: 1.5rem 0;
}

.level-content.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

/* Passive ability specific */
.passive-ability-levels {
    padding: 1.5rem;
}

.passive-level-row {
    display: flex;
    margin-bottom: 1rem;
    padding: 1rem;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    align-items: center;
}

.passive-level-badge {
    background-color: var(--primary-color);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-right: 1.5rem;
    flex-shrink: 0;
}

.passive-level-data {
    display: flex;
    flex-grow: 1;
    flex-wrap: wrap;
    gap: 1rem;
}

.passive-stat {
    display: flex;
    align-items: center;
}

.passive-stat-label {
    font-weight: 500;
    color: #777;
    margin-right: 0.5rem;
}

.passive-stat-value {
    font-weight: 600;
    color: var(--primary-color);
}

/* Active ability stats grid */
.ability-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.ability-stat-card {
    background-color: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s;
}

.ability-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.ability-stat-label {
    color: #777;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.ability-stat-value {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.2rem;
}

/* Close button */
.ability-close-btn {
    display: block;
    margin: 1.5rem auto;
    padding: 0.75rem 2rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.ability-close-btn:hover {
    background-color: var(--secondary-color);
}

/* Charts and visualizations */
.level-comparison-chart {
    margin-top: 2rem;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    padding: 1rem;
}

/* Progress bar for stats */
.stat-progress {
    height: 6px;
    background-color: #f0f0f0;
    border-radius: 3px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.stat-progress-bar {
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 3px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


