/* Dota 2 Heroes Gallery Page Styles */

/* Hero Section */
.dota-hero-section {
    position: relative;
    min-height: 20vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem 2rem;
    background: linear-gradient(to bottom, var(--background-dark), rgba(10, 10, 10, 0.9));
    overflow: hidden;
    text-align: center;
}

.dota-hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('https://cdn.cloudflare.steamstatic.com/apps/dota2/images/dota_react/backgrounds/greyfade.jpg') no-repeat center center;
    background-size: cover;
    opacity: 0.2;
    z-index: -1;
}

.dota-hero-content {
    max-width: 1200px;
    width: 95%;
    position: relative;
    z-index: 2;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 255, 140, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.dota-hero-content h1 {
    font-size: 2.2rem;
    margin-bottom: 0.8rem;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 15px rgba(0, 255, 140, 0.5);
}

.dota-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* Main Content */
.dota-heroes-container {
    max-width: 1400px;
    margin: 4rem auto;
    padding: 0 2rem;
}

/* Filters */
.filters {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: rgba(15, 15, 20, 0.7);
    border-radius: 8px;
    padding: 1.5rem;
    max-width: 1300px;
    margin: 0 auto 2rem;
    border: 1px solid rgba(50, 50, 70, 0.3);
}

.search-container {
    position: relative;
    width: 100%;
    margin: 0;
}

#heroSearch {
    width: 100%;
    padding: 0.8rem 3rem 0.8rem 1rem;
    border-radius: 4px;
    border: none;
    background: rgba(20, 20, 30, 0.8);
    color: var(--text-primary);
    font-size: 0.9rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(80, 80, 120, 0.2);
    transition: all 0.3s ease;
}

#heroSearch:focus {
    outline: none;
    box-shadow: 0 4px 20px rgba(0, 255, 140, 0.2);
    border: 1px solid rgba(0, 255, 140, 0.3);
}

.search-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
    font-size: 1rem;
}

.filter-section {
    margin-top: 1.5rem;
}

.filter-label {
    display: block;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 0.8rem;
    font-weight: 600;
    letter-spacing: 1px;
}

.attribute-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border-radius: 4px;
    background: rgba(30, 32, 41, 0.7);
    color: var(--text-secondary);
    border: 1px solid rgba(50, 50, 70, 0.3);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Orbitron', sans-serif;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.attribute-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
}

.attribute-icon.strength {
    background: linear-gradient(to bottom right, #FF3C3C, #A91E1E);
    box-shadow: 0 0 5px rgba(255, 60, 60, 0.7);
}

.attribute-icon.agility {
    background: linear-gradient(to bottom right, #48FF48, #0D8D0D);
    box-shadow: 0 0 5px rgba(72, 255, 72, 0.7);
}

.attribute-icon.intelligence {
    background: linear-gradient(to bottom right, #3C99FF, #1A5DA0);
    box-shadow: 0 0 5px rgba(60, 153, 255, 0.7);
}

.attribute-icon.universal {
    background: linear-gradient(to bottom right, #C044FF, #7000A0);
    box-shadow: 0 0 5px rgba(192, 68, 255, 0.7);
}

.filter-btn:hover {
    background: rgba(50, 50, 70, 0.5);
    color: var(--text-primary);
    border-color: rgba(80, 80, 120, 0.5);
}

.filter-btn.active {
    background: rgba(0, 255, 140, 0.15);
    color: var(--primary-color);
    border-color: rgba(0, 255, 140, 0.3);
    font-weight: 600;
    box-shadow: 0 0 10px rgba(0, 255, 140, 0.2);
}

/* Heroes Grid */
.heroes-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.2rem;
    margin-top: 2rem;
    max-width: 1300px;
    margin-left: auto;
    margin-right: auto;
}

.hero-card {
    background: transparent;
    overflow: hidden;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    border: none;
    box-shadow: none;
}

.hero-card:hover {
    transform: scale(1.12);
    z-index: 3;
}

.hero-card:hover .hero-img {
    filter: brightness(1.2);
    transform: scale(1.05);
}

.hero-img-container {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/9;
}

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: all 0.3s ease;
}

.hero-attribute {
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    width: 0.8rem;
    height: 0.8rem;
    border-radius: 50%;
    z-index: 1;
}

.hero-attribute.strength {
    background: linear-gradient(to bottom right, #FF3C3C, #A91E1E);
    box-shadow: 0 0 5px rgba(255, 60, 60, 0.7);
}

.hero-attribute.agility {
    background: linear-gradient(to bottom right, #48FF48, #0D8D0D);
    box-shadow: 0 0 5px rgba(72, 255, 72, 0.7);
}

.hero-attribute.intelligence {
    background: linear-gradient(to bottom right, #3C99FF, #1A5DA0);
    box-shadow: 0 0 5px rgba(60, 153, 255, 0.7);
}

.hero-attribute.universal {
    background: linear-gradient(to bottom right, #C044FF, #7000A0);
    box-shadow: 0 0 5px rgba(192, 68, 255, 0.7);
}

.hero-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    padding: 0.6rem 0.5rem;
    text-align: center;
    transform: translateY(100%);
    transition: transform 0.2s ease;
}

.hero-card:hover .hero-info {
    transform: translateY(0);
}

.hero-name {
    font-size: 0.9rem;
    margin: 0;
    font-family: 'Orbitron', sans-serif;
    color: var(--text-primary);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    grid-column: 1 / -1;
    padding: 3rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(0, 255, 140, 0.1);
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

/* Lore Modal */
.lore-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2rem 0;
    -webkit-overflow-scrolling: touch; /* For smoother scrolling on iOS */
}

.lore-modal-content {
    background: rgba(26, 26, 36, 0.95);
    margin: 0 auto;
    max-width: 1200px;
    width: 95%;
    border-radius: 15px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.5);
    position: relative;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(108, 99, 255, 0.2);
    overflow: hidden;
    animation: modalFadeIn 0.3s ease forwards;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lore-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    color: var(--text-secondary);
    font-size: 2rem;
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s ease;
}

.lore-close:hover {
    color: var(--primary-color);
    transform: rotate(90deg);
}

.lore-header {
    padding: 2.5rem;
    display: flex;
    align-items: center;
    gap: 3rem;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.8), transparent);
    position: relative;
    border-bottom: 1px solid rgba(0, 255, 140, 0.2);
}

.lore-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('https://cdn.cloudflare.steamstatic.com/apps/dota2/images/dota_react/backgrounds/greyfade.jpg') no-repeat center center;
    background-size: cover;
    opacity: 0.1;
    z-index: -1;
}

.lore-header img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 10px;
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 20px rgba(0, 255, 140, 0.3);
}

.lore-hero-info h2 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    font-family: 'Orbitron', sans-serif;
    color: var(--text-primary);
    text-shadow: 0 0 10px rgba(0, 255, 140, 0.5);
}

.lore-hero-info p {
    display: inline-block;
    padding: 0.4rem 1rem;
    border-radius: 5px;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
}

.lore-body {
    padding: 2.5rem 3.5rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.8;
    max-height: 65vh;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
}

.lore-body::-webkit-scrollbar {
    width: 8px;
}

.lore-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.lore-body::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.lore-body p {
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Markdown Styling */
.lore-body h1, .lore-body h2, .lore-body h3 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.lore-body ul, .lore-body ol {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.lore-body li {
    margin-bottom: 0.5rem;
}

.lore-body hr {
    border: 0;
    height: 1px;
    background: rgba(108, 99, 255, 0.3);
    margin: 1.5rem 0;
}

.lore-body strong, .lore-body b {
    color: var(--primary-color);
    font-weight: bold;
}

.lore-body em, .lore-body i {
    font-style: italic;
    color: #ccc;
}

.lore-body .chapter-title {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-top: 2rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lore-body .chapter-divider {
    display: block;
    font-size: 1.5rem;
    text-align: center;
    margin: 1.5rem 0;
    color: var(--secondary-color);
}

/* Responsive Styles */
@media (max-width: 768px) {
    .dota-hero-content h1 {
        font-size: 2.2rem;
    }
    
    .lore-modal-content {
        width: 95%;
        max-width: 95%;
    }
    
    .lore-body {
        padding: 1.5rem;
    }
    
    .lore-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        padding: 1.5rem;
    }
    
    .dota-subtitle {
        font-size: 1rem;
    }
    
    .heroes-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
    
    .lore-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .lore-hero-info h2 {
        font-size: 1.8rem;
    }
    
    .hero-name {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .dota-hero-content h1 {
        font-size: 1.8rem;
    }
    
    .heroes-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
    
    .hero-info {
        padding: 0.5rem;
    }
    
    .hero-name {
        font-size: 0.75rem;
    }
    
    .filter-btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    .hero-attribute {
        width: 0.8rem;
        height: 0.8rem;
        top: 0.3rem;
        right: 0.3rem;
    }
}
