:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --primary: #f97316; /* Overwatch Orange */
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --tank-color: #3b82f6;
    --damage-color: #ef4444;
    --support-color: #10b981;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Noto Sans SC', sans-serif;
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(249, 115, 22, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(59, 130, 246, 0.15), transparent 25%);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    padding: 1.5rem;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border-radius: 1rem;
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.logo {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: 2px;
    color: var(--text-main);
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(249, 115, 22, 0.5);
}

.controls {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

#searchInput {
    padding: 0.75rem 1.5rem;
    border-radius: 2rem;
    border: 1px solid var(--glass-border);
    background: rgba(15, 23, 42, 0.5);
    color: var(--text-main);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    width: 250px;
}

#searchInput:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.2);
    width: 300px;
}

.filter-box {
    display: flex;
    gap: 0.5rem;
}

.filter-btn {
    padding: 0.5rem 1.2rem;
    border-radius: 2rem;
    border: 1px solid var(--glass-border);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(249, 115, 22, 0.4);
}

.heroes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 2rem;
}

.hero-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 1rem;
    border: 1px solid var(--glass-border);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.hero-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 35px rgba(0,0,0,0.4), 0 0 15px rgba(249, 115, 22, 0.2);
    border-color: rgba(249, 115, 22, 0.3);
}

.hero-avatar-wrapper {
    width: 100%;
    aspect-ratio: 1/1;
    overflow: hidden;
    position: relative;
    background: #000;
}

.hero-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.hero-card:hover .hero-avatar {
    transform: scale(1.1);
}

.hero-info {
    padding: 1.2rem;
    text-align: center;
}

.hero-name {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.hero-type-badge {
    display: inline-block;
    padding: 0.2rem 0.8rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(255,255,255,0.1);
}

.type-tank { color: var(--tank-color); background: rgba(59, 130, 246, 0.15); }
.type-damage { color: var(--damage-color); background: rgba(239, 68, 68, 0.15); }
.type-support { color: var(--support-color); background: rgba(16, 185, 129, 0.15); }

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--bg-color);
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    border-radius: 1.5rem;
    border: 1px solid var(--glass-border);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    overflow: hidden;
    position: relative;
    transform: translateY(20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
}

.modal.active .modal-content {
    transform: translateY(0) scale(1);
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0,0,0,0.5);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.modal-layout {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    height: 100%;
}

.modal-layout::-webkit-scrollbar {
    width: 8px;
}
.modal-layout::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
}

.modal-gallery {
    width: 100%;
    background: #000;
    position: relative;
}

#modalMainImage {
    width: 100%;
    height: 400px;
    object-fit: contain;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    transition: opacity 0.4s ease;
}

#modalMainImage.loaded {
    opacity: 1;
}

.gallery-thumbnails {
    display: flex;
    gap: 10px;
    padding: 10px;
    overflow-x: auto;
    background: rgba(0,0,0,0.6);
    justify-content: center;
}

.gallery-thumbnails::-webkit-scrollbar {
    height: 6px;
}
.gallery-thumbnails::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
}

.thumb-img {
    width: 80px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.6;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.thumb-img:hover, .thumb-img.active {
    opacity: 1;
    border-color: var(--primary);
}

.modal-details {
    padding: 2.5rem;
}

.hero-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.hero-title h1 {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.hero-type {
    font-size: 1rem;
    padding: 0.3rem 1rem;
    border-radius: 20px;
    background: rgba(255,255,255,0.1);
}

.info-section {
    margin-bottom: 2rem;
}

.info-section h3 {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.story-text {
    line-height: 1.8;
    color: #cbd5e1;
    font-size: 1.05rem;
}

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

.skill-item {
    display: flex;
    gap: 1rem;
    background: rgba(255,255,255,0.03);
    padding: 1rem;
    border-radius: 0.8rem;
    border: 1px solid rgba(255,255,255,0.05);
    transition: transform 0.2s, background 0.2s;
}

.skill-item:hover {
    transform: translateY(-3px);
    background: rgba(255,255,255,0.08);
}

.skill-icon {
    width: 50px;
    height: 50px;
    background: #000;
    border-radius: 8px;
    padding: 5px;
    object-fit: contain;
}

.skill-info h4 {
    margin-bottom: 0.3rem;
    color: var(--text-main);
}

.skill-info p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.4;
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 1rem;
    }
    #searchInput { width: 100%; }
    #searchInput:focus { width: 100%; }
    .filter-box { flex-wrap: wrap; justify-content: center; }
    
    #modalMainImage { height: 250px; }
    .hero-header { flex-direction: column; align-items: flex-start; gap: 1rem; }
}
