/* Genshin Modding App - Cleaned CSS */
:root {
    --primary: #9c88ff;
    --secondary: #8c7ae6;
    --dark: #1e1e2e;
    --darker: #181825;
    --light: #f5f6fa;
    --accent: #ff9f43;
    --danger: #ff6b6b;
    --danger-rgb: 255, 107, 107;
    --success: #1dd1a1;
    --card-bg: rgba(30, 30, 46, 0.7);
    --sidebar-width: 260px;
    --accent-rgb: 255, 159, 67;

    /* Element colors */
    --electro: #a757cb;
    --pyro: #ff7a3d;
    --cryo: #99d8f0;
    --hydro: #4cc2f1;
    --anemo: #75c4a9;
    --geo: #f8b63e;
    --dendro: #a0d73c;

    /* ZZZ Attribute Colors */
    --zzz-electric: #a176e7;
    --zzz-fire: #ff7a3d;
    --zzz-ice: #99d8f0;
    --zzz-ether: #d17df5;
    --zzz-physical: #c2c8ce;

    /* Wuwa Attribute Colors */
    --wuwa-aero: #2bc99e;
    --wuwa-electro: #ab32b6;
    --wuwa-fusion: #c42a4e;
    --wuwa-glacio: #37b1d1;
    --wuwa-havoc: #971654;
    --wuwa-spectro: #bba81e;
}

/* Base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

body {
    background-color: var(--darker);
    color: var(--light);
}

.app-container {
    display: flex;
    height: 100vh;
    background-color: rgba(24, 24, 37, 0.6);
}

/* Animation definitions */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

    100% {
        background-position: 0 50%;
    }
}

.fadeIn {
    animation: fadeIn 0.4s ease forwards;
}

/* Scrollbar styles */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background-color: rgba(156, 136, 255, 0.4);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background-color: rgba(156, 136, 255, 0.6);
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--dark);
    height: 100%;
    padding: 20px;
    transition: width 0.3s ease;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow-y: auto;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary);
    text-align: center;
    margin-bottom: 30px;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo span {
    background: linear-gradient(45deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.logo svg {
    margin-right: 10px;
    fill: url(#logo-gradient);
}

.nav-items {
    list-style: none;
    flex-grow: 1;
}

.nav-item {
    padding: 12px 15px;
    margin-bottom: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    color: var(--light);
    text-decoration: none;
}

.nav-item:hover {
    background-color: rgba(156, 136, 255, 0.1);
}

.nav-item.active {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 5px 15px rgba(156, 136, 255, 0.4);
}

.nav-item i {
    margin-right: 12px;
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.separator {
    height: 1px;
    background-color: rgba(255, 255, 255, 0.1);
    margin: 15px 0;
    flex-shrink: 0;
}

/* Preset Section */
.preset-section {
    padding: 15px 0;
    flex-shrink: 0;
}

.preset-header {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.preset-header button {
    background-color: var(--primary);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.preset-header button:hover {
    background-color: var(--secondary);
}

.preset {
    padding: 10px;
    background-color: rgba(156, 136, 255, 0.1);
    border-radius: 6px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.preset:hover {
    background-color: rgba(156, 136, 255, 0.2);
}

.preset.active {
    border-left: 3px solid var(--primary);
    padding-left: 7px;
}

.preset-actions {
    display: flex;
    gap: 8px;
}

.preset-actions i {
    opacity: 0.6;
    transition: all 0.2s ease;
    font-size: 14px;
}

.preset-actions i:hover {
    opacity: 1;
    color: var(--primary);
}

/* Main Content */
.main-content {
    flex: 1;
    /* Take remaining space */
    padding: 25px;
    overflow-y: auto;
    /* THIS should be the primary scrollbar */
    position: relative;
    /* Needed for potential absolutely positioned children */
    height: 100%;
    /* Fill the flex parent height */
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-wrap: wrap;
    gap: 20px;
}

.page-title {
    font-size: 28px;
    font-weight: 600;
    display: flex;
    align-items: center;
    margin-right: auto;
    flex-shrink: 0;
}

.page-title i {
    margin-right: 15px;
    cursor: pointer;
    font-size: 20px;
    opacity: 0.7;
    transition: all 0.2s ease;
}

.page-title i:hover {
    opacity: 1;
    color: var(--primary);
}

/* Navigation Tabs */
.tab-navigation {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
    flex-wrap: wrap;
}

.tab {
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 6px;
    white-space: nowrap;
}

.tab:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.tab.active {
    background-color: var(--primary);
    color: white;
}

/* Search Bar */
.search-bar-container {
    flex-shrink: 0;
    width: 100%;
    max-width: 300px;
}

.search-bar {
    position: relative;
    width: 100%;
}

.search-bar input {
    width: 100%;
    padding: 12px 20px 12px 45px;
    background-color: var(--dark);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--light);
    font-size: 15px;
    transition: all 0.2s ease;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(156, 136, 255, 0.3);
}

.search-bar i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.5);
    font-size: 16px;
}

@media (min-width: 992px) {
    .search-bar-container {
        width: auto;
    }
}

/* Element Filters */
.element-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.element-filter-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    background-color: transparent;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    white-space: nowrap;
}

.element-filter-button i {
    font-size: 14px;
    color: var(--element-color, var(--light));
}

.element-filter-button:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.4);
    color: rgba(255, 255, 255, 0.9);
}

.element-filter-button.active {
    background-color: var(--element-color, var(--primary));
    border-color: var(--element-color, var(--primary));
    color: var(--darker);
    font-weight: 600;
    box-shadow: 0 0 10px rgba(156, 136, 255, 0.3);
}

.element-filter-button.active i {
    color: inherit;
}

.filter-button-name {
    display: none;
}

@media (min-width: 768px) {
    .filter-button-name {
        display: inline;
    }

    .element-filter-button {
        padding: 6px 14px;
    }
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 25px;
    padding-bottom: 30px;
}

/* Character/Entity Card */
.character-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    text-decoration: none;
    color: var(--light);
    display: flex;
    flex-direction: column;
}

.character-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    border-color: rgba(156, 136, 255, 0.3);
}

.card-image {
    height: 220px;
    background-size: cover;
    background-position: center top;
    position: relative;
    flex-shrink: 0;
}

.card-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: linear-gradient(to top, rgba(30, 30, 46, 0.95), transparent);
}

.card-content {
    padding: 15px;
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card-name {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 8px;
}

.card-element {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.card-element i {
    font-size: 16px;
}

/* Card badges */
.card-badges-container {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    z-index: 2;
}

.card-badge {
    color: white;
    font-size: 11px;
    padding: 3px 7px;
    border-radius: 6px;
    font-weight: 600;
    letter-spacing: 0.5px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.card-badge.total-badge {
    background-color: rgba(156, 136, 255, 0.85);
}

.card-badge.enabled-badge {
    background-color: rgba(29, 209, 161, 0.9);
}

.card-badge i {
    vertical-align: middle;
    font-size: 1em;
}

/* Character Profile */
.character-profile {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.character-avatar {
    width: 260px;
    height: 400px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background-color: var(--card-bg);
    background-image: url('/images/placeholder.jpg');
    background-size: cover;
    background-position: center top;
    flex-shrink: 0;
}

.character-avatar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to top, rgba(30, 30, 46, 0.9), transparent);
    pointer-events: none;
}

.character-info {
    flex: 1;
    min-width: 300px;
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.character-name {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.character-name .element-icon {
    font-size: 28px;
}

.character-details {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.character-detail {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.character-detail i {
    opacity: 0.8;
    font-size: 15px;
}

.character-description {
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 25px;
    font-size: 15px;
}

/* Mods Section */
.mods-section {
    margin-top: 30px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.section-title {
    font-size: 24px;
    font-weight: 600;
    margin-right: auto;
}

.mods-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

/* Mod List */
.mods-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Mod Card (Grid view) */
.mod-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.mod-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border-color: rgba(156, 136, 255, 0.3);
}

/* Mod Card List View */
.mod-card-list {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 15px;
    background-color: var(--card-bg);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    min-height: 50px;
    transition: background-color 0.2s ease;
}

.mod-card-list:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.mod-card-list .compact-toggle {
    flex-shrink: 0;
    margin-right: 5px;
}

.mod-list-name {
    flex-grow: 1;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 15px;
    color: var(--light);
}

.mod-list-author {
    flex-shrink: 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
    margin-left: auto;
    margin-right: 10px;
}

.mod-list-error {
    flex-shrink: 0;
    color: var(--danger);
    margin-left: 10px;
    font-size: 14px;
}

.mod-list-error i {
    vertical-align: middle;
}

.mod-list-actions {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    margin-left: 5px;
}

.mod-list-actions .compact-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    padding: 4px;
    font-size: 14px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.mod-list-actions .compact-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

.mod-list-actions .compact-btn.danger:hover {
    background-color: rgba(var(--danger-rgb), 0.15);
    color: var(--danger);
}

.mod-list-actions .compact-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Disabled Visual Style */
.mod-disabled-visual {
    opacity: 0.65;
}

.mod-disabled-visual:hover {
    opacity: 0.8;
}

.mod-card-list.mod-disabled-visual {
    opacity: 0.65;
}

/* Mod Card Header */
.mod-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    gap: 15px;
    flex-shrink: 0;
}

.mod-title {
    font-weight: 600;
    font-size: 17px;
    flex-grow: 1;
    word-break: break-word;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #34495e;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--success);
}

input:focus+.slider {
    box-shadow: 0 0 1px var(--success);
}

input:checked+.slider:before {
    transform: translateX(22px);
}

input:disabled+.slider {
    cursor: not-allowed;
    background-color: #7f8c8d;
}

/* Mod Category */
.mod-category {
    display: inline-block;
    padding: 4px 10px;
    background-color: rgba(156, 136, 255, 0.15);
    color: var(--primary);
    border-radius: 6px;
    font-size: 12px;
    margin-bottom: 12px;
    font-weight: 500;
    align-self: flex-start;
}

.mod-description {
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    line-height: 1.6;
    flex-grow: 1;
}

.mod-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    gap: 15px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.mod-author {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
}

/* Key Binding */
.key-binding {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    background-color: rgba(0, 0, 0, 0.25);
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 13px;
    gap: 6px;
}

.key-binding i {
    opacity: 0.7;
}

.key {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 3px 8px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-weight: 600;
    font-size: 12px;
    transition: all 0.2s ease;
    display: inline-block;
}

.key:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

/* View Mode Toggle */
.view-mode-toggle {
    display: inline-flex;
    border-radius: 8px;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.view-mode-toggle .btn-icon {
    appearance: none;
    background: transparent;
    border: none;
    padding: 6px 12px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    line-height: 1;
}

.view-mode-toggle .btn-icon:not(.active):hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

.view-mode-toggle .btn-icon.active {
    background-color: var(--primary);
    color: white;
    cursor: default;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.view-mode-toggle .btn-icon:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
    z-index: 1;
}

/* Button Styles */
.btn {
    padding: 9px 18px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    text-decoration: none;
    gap: 8px;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--secondary);
    box-shadow: 0 5px 15px rgba(156, 136, 255, 0.4);
}

.btn-outline {
    background-color: transparent;
    color: var(--light);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-outline:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.5);
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}

.btn-danger:hover {
    background-color: #d63031;
    box-shadow: 0 5px 15px rgba(var(--danger-rgb), 0.4);
}

.btn i {
    font-size: 1em;
}

/* Enhanced Stats Styles */
.enhanced-stats-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    animation: fadeIn 0.5s ease-out;
}

.stats-overview {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.stat-card {
    display: flex;
    align-items: center;
    padding: 16px;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 8px;
    border-left: 4px solid transparent;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

.stat-card.total-mods {
    border-left-color: #3b82f6;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12) 0%, rgba(15, 23, 42, 0.6) 100%);
}

.stat-card.enabled {
    border-left-color: #4ade80;
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.12) 0%, rgba(15, 23, 42, 0.6) 100%);
}

.stat-card.disabled {
    border-left-color: #64748b;
    background: linear-gradient(135deg, rgba(100, 116, 139, 0.12) 0%, rgba(15, 23, 42, 0.6) 100%);
}

.stat-card.uncategorized {
    border-left-color: #f97316;
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.12) 0%, rgba(15, 23, 42, 0.6) 100%);
}

.stat-icon {
    font-size: 22px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-right: 12px;
}

.total-mods .stat-icon {
    color: #3b82f6;
}

.enabled .stat-icon {
    color: #4ade80;
}

.disabled .stat-icon {
    color: #64748b;
}

.uncategorized .stat-icon {
    color: #f97316;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 20px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
}

.animated-counter {
    display: inline-block;
    min-width: 30px;
}

/* Charts Section */
.stats-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 10px;
}

.chart-container {
    background: rgba(15, 23, 42, 0.6);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.chart-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
}

.chart-title {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.85);
    text-align: center;
    position: relative;
}

.chart-title::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 2px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.chart-legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    font-size: 12px;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    margin-right: 6px;
}

/* Loading Placeholders */
.stats-loading-placeholder {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
}

.skeleton-line {
    height: 16px;
    width: 100%;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.1) 37%, rgba(255, 255, 255, 0.05) 63%);
    background-size: 400% 100%;
    animation: skeleton-loading 1.4s ease infinite;
    border-radius: 4px;
}

.skeleton-circle {
    height: 100px;
    width: 100px;
    border-radius: 50%;
    margin: 10px auto;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.1) 37%, rgba(255, 255, 255, 0.05) 63%);
    background-size: 400% 100%;
    animation: skeleton-loading 1.4s ease infinite;
}

/* Error state */
.stats-error {
    text-align: center;
    padding: 30px 20px;
    color: var(--danger);
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Placeholder text */
.placeholder-text {
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.placeholder-text[style*="grid-column"] {
    width: 100%;
    text-align: center;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .stats-charts {
        grid-template-columns: 1fr;
    }
}

/* Style for the keybind button in the grid view */
.mod-card-grid .keybind-button {
    /* Inherits base styles from gridButtonBase via inline style */
}

.mod-card-grid .keybind-button:hover {
    opacity: 1;
    color: var(--primary);
    /* Optional: change color on hover */
}

.mod-card-grid .keybind-button:disabled,
.mod-card-list .keybind-button:disabled {
    /* Add list view disabled style too */
    opacity: 0.4;
    cursor: not-allowed;
}

/* Add hover for list view compact buttons if not already defined */
.mod-list-actions .compact-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

.mod-list-actions .compact-btn.danger:hover {
    background-color: rgba(var(--danger-rgb), 0.15);
    color: var(--danger);
}

.modal-overlay-style {
    /* Example class, apply to inline style or add class */
    position: fixed;
    /* Fixed relative to viewport */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    /* Center horizontally */
    align-items: center;
    /* Center vertically */
    z-index: 1050;
    /* Ensure high z-index */
    backdrop-filter: blur(5px);
    padding: 20px;
    /* Add padding for smaller viewports */
}

/* Ensure modals themselves don't cause overflow issues initially */
.modal-content-style {
    /* Example class, apply to the actual modal box */
    background: var(--dark);
    padding: 30px 40px;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.4);
    color: var(--light);
    min-width: 350px;
    /* Example minimum */
    max-width: 90%;
    /* Max width relative to viewport */
    max-height: 90%;
    /* Max height relative to viewport */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Prevent modal box itself from overflowing initially */
}

/* Make the *content area* within the modal scrollable if needed */
.modal-scrollable-content {
    overflow-y: auto;
    flex-grow: 1;
    /* Allow content to take space */
    padding-right: 10px;
    /* Space for scrollbar if it appears */
    margin-bottom: 15px;
    /* Space before footer */
}

/* Sidebar Drag Feedback */
.sidebar.dragging-over {
    outline: 3px dashed var(--primary);
    outline-offset: -4px;
    /* Inside the element */
    background-color: rgba(156, 136, 255, 0.05);
    /* Subtle background change */
}

/* Enhanced Entity Page Styles */

/* Animation for section transitions */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

/* Base styles for the enhanced entity page */
.enhanced-entity-page {
    height: 100vh;
    overflow: hidden;
    position: relative;
}

/* Fixed header */
.enhanced-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: var(--darker);
    padding: 15px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Container for both entity info and mods sections */
.sections-container {
    height: calc(100vh - 70px);
    position: relative;
}

/* Styles for each section */
.entity-section,
.mods-section {
    height: 100%;
    padding: 0 25px;
    position: absolute;
    width: 100%;
    top: 0;
    left: 0;
    overflow-y: auto;
}

/* Scroll indicator */
.scroll-indicator {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
}

.scroll-indicator p {
    margin-bottom: 15px;
}

.scroll-indicator .arrow-down {
    font-size: 24px;
    animation: bounce 2s infinite;
    color: var(--primary);
}

/* Navigation button to switch between sections */
.section-nav-button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: var(--primary);
    opacity: 0.8;
    transition: all 0.2s ease;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.2);
    width: 40px;
    height: 40px;
}

.section-nav-button:hover {
    opacity: 1;
    transform: scale(1.1);
    background-color: rgba(0, 0, 0, 0.3);
}

/* Mods section specific styles */
.mods-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.mods-header {
    flex-shrink: 0;
}

.mods-content {
    flex: 1;
    overflow: hidden;
    margin-top: 10px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .entity-section .character-profile {
        flex-direction: column;
    }

    .character-avatar {
        width: 100%;
        height: 300px;
        margin-bottom: 20px;
    }
}

/* Transitions for section switching */
.fade-enter {
    opacity: 0;
    transform: translateY(30px);
}

.fade-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 300ms, transform 300ms;
}

.fade-exit {
    opacity: 1;
    transform: translateY(0);
}

.fade-exit-active {
    opacity: 0;
    transform: translateY(-30px);
    transition: opacity 300ms, transform 300ms;
}

/* Pulsing effect for the "View Mods" button */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(156, 136, 255, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(156, 136, 255, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(156, 136, 255, 0);
    }
}

.view-mods-button {
    animation: pulse 2s infinite;
}

/* Floating back to top button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 99;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

@keyframes floatText {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

@keyframes pulseButton {
    0% {
        box-shadow: 0 0 0 0 rgba(156, 136, 255, 0.6);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(156, 136, 255, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(156, 136, 255, 0);
    }
}

.view-mods-button {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.view-mods-button:hover {
    transform: translateY(-2px);
}

.view-mods-button::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.1) 50%,
            rgba(255, 255, 255, 0) 100%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.view-mods-button:hover::after {
    transform: translateX(100%);
}

/* Attribute Filters Styling */
.attribute-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.attribute-filter-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    background-color: transparent;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    white-space: nowrap;
}

.attribute-filter-button i {
    font-size: 14px;
    color: var(--attribute-color, var(--light));
}

.attribute-filter-button:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.4);
    color: rgba(255, 255, 255, 0.9);
}

.attribute-filter-button.active {
    background-color: var(--attribute-color, var(--primary));
    border-color: var(--attribute-color, var(--primary));
    color: var(--darker);
    font-weight: 600;
    box-shadow: 0 0 10px rgba(var(--attribute-color, 156, 136, 255), 0.3);
}

.attribute-filter-button.active i {
    color: inherit;
}

/* Animation for filtering */
@keyframes filterFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Apply animation to entities when filter changes */
.cards-grid .character-card {
    animation: filterFadeIn 0.4s ease-out;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .attribute-filters {
        padding: 0 5px;
        gap: 5px;
    }

    .attribute-filter-button {
        padding: 5px 10px;
    }

    .filter-button-name {
        display: none;
        /* Hide text on small screens, show only icon */
    }

    .attribute-filter-button i {
        font-size: 16px;
        /* Slightly larger icons on mobile */
    }
}

@media (min-width: 769px) {
    .filter-button-name {
        display: inline;
        /* Show text on larger screens */
    }
}

/* Specific color highlights for entity cards based on attribute */
.character-card[data-attribute="Electric"] {
    border-left: 3px solid var(--zzz-electric);
}

.character-card[data-attribute="Fire"] {
    border-left: 3px solid var(--zzz-fire);
}

.character-card[data-attribute="Ice"],
.character-card[data-attribute="Frost"] {
    border-left: 3px solid var(--zzz-ice);
}

.character-card[data-attribute="Ether"] {
    border-left: 3px solid var(--zzz-ether);
}

.character-card[data-attribute="Physical"] {
    border-left: 3px solid var(--zzz-physical);
}

.character-card[data-attribute="AuricInk"] {
    border-left: 3px solid var(--zzz-auric-ink);
}

/* Specific color highlights for entity cards based on resonator attribute */
.character-card[data-attribute="Aero"] {
    border-left: 3px solid var(--wuwa-aero);
}

.character-card[data-attribute="Electro"] {
    border-left: 3px solid var(--wuwa-electro);
}

.character-card[data-attribute="Fusion"] {
    border-left: 3px solid var(--wuwa-fusion);
}

.character-card[data-attribute="Glacio"] {
    border-left: 3px solid var(--wuwa-glacio);
}

.character-card[data-attribute="Havoc"] {
    border-left: 3px solid var(--wuwa-havoc);
}

.character-card[data-attribute="Spectro"] {
    border-left: 3px solid var(--wuwa-spectro);
}