/* Wiki Sidebar */
.wiki-sidebar {
    background: linear-gradient(135deg, var(--tg-common-color-black-2) 0%, var(--tg-common-color-black-4) 100%);
    border-radius: 15px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 25px;
    margin-bottom: 30px;
    position: sticky;
    top: 100px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.wiki-sidebar-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.wiki-sidebar-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--tg-heading-color);
    margin: 0;
    text-shadow: 0 0 10px rgba(0, 217, 255, 0.3);
}

.wiki-sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wiki-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--tg-body-color);
    transition: all 0.3s ease;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.wiki-menu-item i {
    font-size: 18px;
    width: 20px;
    text-align: center;
    color: var(--tg-theme-primary);
}

.wiki-menu-item:hover {
    background: rgba(0, 217, 255, 0.1);
    color: var(--tg-theme-primary);
    border-color: rgba(0, 217, 255, 0.3);
    transform: translateX(-5px);
}

.wiki-menu-item.active {
    background: linear-gradient(135deg, var(--tg-theme-primary) 0%, var(--tg-common-color-cyan) 100%);
    color: var(--tg-common-color-black);
    border-color: var(--tg-theme-primary);
    box-shadow: 0 0 20px rgba(0, 217, 255, 0.4);
    font-weight: 600;
}

/* Wiki Content */
.wiki-content {
    background: linear-gradient(135deg, var(--tg-common-color-black-2) 0%, var(--tg-common-color-black-4) 100%);
    border-radius: 15px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 30px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.wiki-content-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-direction: row-reverse;
}

.wiki-content-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--tg-heading-color);
    margin: 0;
    text-shadow: 0 0 10px rgba(0, 217, 255, 0.3);
}

/* Filters */
.wiki-filters-container {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex-wrap: wrap;
    visibility: visible !important;
    opacity: 1 !important;
}

.filter-icons {
    display: flex !important;
    gap: 10px;
    flex-wrap: wrap;
    visibility: visible !important;
    opacity: 1 !important;
}

.filter-label {
    font-weight: 600;
    color: var(--tg-heading-color);
    font-size: 14px;
    min-width: 80px;
}

.filter-icon-btn {
    width: 50px !important;
    height: 50px !important;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 0;
    position: relative;
    visibility: visible !important;
    opacity: 1 !important;
}

.filter-icon-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.filter-icon-btn i {
    font-size: 24px;
    color: var(--tg-body-color);
}

.filter-icon-btn .element-icon-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

.filter-icon-btn:hover {
    border-color: var(--tg-theme-primary);
    background: rgba(0, 217, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 217, 255, 0.2);
}

.filter-icon-btn.active {
    border-color: var(--tg-theme-primary);
    background: rgba(0, 217, 255, 0.2);
    box-shadow: 0 0 15px rgba(0, 217, 255, 0.4);
}

.filter-icon-btn.active::after {
    content: '✓';
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: var(--tg-theme-primary);
    color: var(--tg-common-color-black);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    border: 2px solid var(--tg-common-color-black);
}

.filter-buttons {
    display: flex;
    gap: 10px;
}

.filter-btn {
    padding: 8px 20px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--tg-body-color);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 600;
}

.filter-btn:hover {
    border-color: var(--tg-theme-primary);
    background: rgba(0, 217, 255, 0.1);
    color: var(--tg-theme-primary);
    transform: translateY(-2px);
}

.filter-btn.active {
    border-color: var(--tg-theme-primary);
    background: rgba(0, 217, 255, 0.2);
    color: var(--tg-theme-primary);
    box-shadow: 0 0 15px rgba(0, 217, 255, 0.3);
}

.clear-filters-btn {
    padding: 8px 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 0, 110, 0.1);
    color: var(--tg-theme-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.clear-filters-btn:hover {
    background: rgba(255, 0, 110, 0.2);
    border-color: var(--tg-theme-secondary);
    transform: translateY(-2px);
}

.clear-filters-btn i {
    margin-left: 5px;
}

.no-characters-message {
    padding: 40px;
    text-align: center;
}

/* Characters Grid */
.characters-grid-container {
    margin-top: 30px;
}

.characters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.character-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    position: relative;
}

.character-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 217, 255, 0.3);
    border-color: var(--tg-theme-primary);
}

.character-card-link {
    text-decoration: none;
    display: block;
    color: inherit;
}

.character-card-image {
    position: relative;
    width: 100%;
    padding-top: 100%; /* 1:1 Aspect Ratio */
    overflow: hidden;
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.1) 0%, rgba(0, 255, 212, 0.1) 100%);
}

.character-background-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.character-main-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 2;
}

.no-character-icon {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: var(--tg-body-color);
    background: rgba(255, 255, 255, 0.05);
}

.character-element-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(5px);
}

.character-element-badge img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.element-icon-small {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.character-weapon-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(5px);
}

.character-weapon-badge img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.character-weapon-badge i {
    color: var(--tg-body-color);
    font-size: 16px;
}

.character-rarity-badge {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 2px;
    background: rgba(0, 0, 0, 0.6);
    padding: 4px 8px;
    border-radius: 12px;
    backdrop-filter: blur(5px);
}

.character-rarity-badge .star {
    color: #ffd700;
    font-size: 12px;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

.character-card-name {
    padding: 12px;
    text-align: center;
    font-weight: 500;
    color: var(--tg-heading-color);
    font-size: 14px;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.no-characters-found {
    grid-column: 1 / -1;
    padding: 40px;
    text-align: center;
}

/* Characters Table (Legacy - keeping for compatibility) */
.wiki-characters-table {
    overflow-x: auto;
}

.characters-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.characters-table thead {
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.1) 0%, rgba(0, 255, 212, 0.1) 100%);
    border-bottom: 2px solid rgba(0, 217, 255, 0.3);
}

.characters-table th {
    padding: 15px;
    text-align: right;
    font-weight: 600;
    color: var(--tg-heading-color);
    border-bottom: 2px solid rgba(0, 217, 255, 0.3);
    text-shadow: 0 0 5px rgba(0, 217, 255, 0.3);
}

.characters-table td {
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    vertical-align: middle;
    color: var(--tg-body-color);
}

.characters-table tbody tr {
    transition: all 0.3s ease;
}

.characters-table tbody tr:hover {
    background: rgba(0, 217, 255, 0.05);
    box-shadow: 0 0 15px rgba(0, 217, 255, 0.1);
}

.character-icon {
    width: 60px;
}

.character-icon img {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
}

.character-icon .no-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--tg-body-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.character-name {
    font-weight: 500;
    color: var(--tg-heading-color);
}

.character-rarity {
    white-space: nowrap;
}

.character-rarity .star {
    color: #ffd700;
    font-size: 18px;
    margin: 0 2px;
}

.character-rarity .star.empty {
    color: rgba(255, 255, 255, 0.2);
}

.character-weapon img,
.character-element img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    vertical-align: middle;
}

.character-materials {
    min-width: 200px;
}

.materials-list {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    align-items: center;
}

.materials-list img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    border-radius: 4px;
}

.material-placeholder {
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--tg-body-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Wiki Grid (for weapons, materials, elements) */
.wiki-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
}

.wiki-item {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.wiki-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 217, 255, 0.3);
    border-color: rgba(0, 217, 255, 0.5);
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.1) 0%, rgba(0, 255, 212, 0.1) 100%);
}

.wiki-item img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 15px;
}

.wiki-item .element-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    color: #fff;
    font-size: 32px;
    font-weight: bold;
}

.wiki-item h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--tg-heading-color);
    margin-bottom: 10px;
}

.wiki-item p {
    font-size: 14px;
    color: var(--tg-body-color);
    margin: 5px 0;
}

.wiki-item .material-type {
    font-size: 12px;
    color: var(--tg-theme-primary);
    font-style: italic;
}

/* Character Actions */
.character-actions {
    display: flex;
    gap: 10px;
    margin-top: 5px;
}

.btn-suggest-edit-small {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: rgba(0, 217, 255, 0.1);
    color: var(--tg-theme-primary);
    text-decoration: none;
    border-radius: 5px;
    font-size: 12px;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 217, 255, 0.2);
}

.btn-suggest-edit-small:hover {
    background: rgba(0, 217, 255, 0.2);
    border-color: rgba(0, 217, 255, 0.4);
    transform: translateY(-1px);
}

.btn-suggest-edit-small i {
    font-size: 11px;
}

/* Additional Dark Theme Enhancements */
.shop-area {
    background: var(--tg-common-color-black);
}

.product-type-title {
    margin-bottom: 30px;
}

.product-type-title__text {
    color: var(--tg-heading-color);
    text-shadow: 0 0 10px rgba(0, 217, 255, 0.3);
}

/* Scrollbar Styling for Dark Theme */
.wiki-characters-table::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.wiki-characters-table::-webkit-scrollbar-track {
    background: var(--tg-common-color-black-2);
    border-radius: 10px;
}

.wiki-characters-table::-webkit-scrollbar-thumb {
    background: var(--tg-theme-primary);
    border-radius: 10px;
}

.wiki-characters-table::-webkit-scrollbar-thumb:hover {
    background: var(--tg-common-color-cyan);
}

/* Responsive */
@media (max-width: 768px) {
    .wiki-sidebar {
        position: static;
        margin-bottom: 20px;
    }
    
    .wiki-content {
        padding: 20px;
    }
    
    .wiki-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group select {
        width: 100%;
    }
    
    .characters-table {
        font-size: 12px;
    }
    
    .characters-table th,
    .characters-table td {
        padding: 10px 5px;
    }
    
    .character-icon img {
        width: 40px;
        height: 40px;
    }
    
    .wiki-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 15px;
    }
}

/* Teams Section */
.teams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.team-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    direction: rtl;
    text-align: right;
}

.team-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.team-header {
    margin-bottom: 15px;
}

.team-name {
    color: var(--tg-heading-color);
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.team-description {
    color: var(--tg-body-color);
    font-size: 14px;
    margin: 0;
    opacity: 0.8;
}

.team-members {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.team-member {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.team-member.main-character {
    border-color: var(--tg-theme-primary);
    box-shadow: 0 0 10px rgba(0, 217, 255, 0.3);
}

.team-member a {
    display: block;
    width: 100%;
    height: 100%;
}

.team-member-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.main-badge {
    position: absolute;
    top: 5px;
    left: 5px;
    background: var(--tg-theme-primary);
    color: var(--tg-common-color-black);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.team-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-direction: row-reverse;
}

.team-creator {
    color: var(--tg-body-color);
    font-size: 12px;
    opacity: 0.7;
}

.team-actions {
    display: flex;
    gap: 10px;
    flex-direction: row-reverse;
}

.team-stats {
    display: flex;
    gap: 15px;
    flex-direction: row-reverse;
    color: var(--tg-body-color);
    font-size: 14px;
}

.team-stats span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-team-like,
.btn-team-dislike {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--tg-body-color);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-team-like:hover {
    background: rgba(0, 255, 0, 0.1);
    border-color: rgba(0, 255, 0, 0.3);
    color: #4ade80;
}

.btn-team-dislike:hover {
    background: rgba(255, 0, 0, 0.1);
    border-color: rgba(255, 0, 0, 0.3);
    color: #f87171;
}

.btn-team-like.active {
    background: rgba(0, 255, 0, 0.2);
    border-color: rgba(0, 255, 0, 0.5);
    color: #4ade80;
}

.btn-team-dislike.active {
    background: rgba(255, 0, 0, 0.2);
    border-color: rgba(255, 0, 0, 0.5);
    color: #f87171;
}

.btn-team-like i,
.btn-team-dislike i {
    font-size: 14px;
}

.like-count,
.dislike-count {
    font-weight: 600;
}

.no-teams-found {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
}

@media (max-width: 768px) {
    .teams-grid {
        grid-template-columns: 1fr;
    }
    
    .team-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .wiki-content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}

