/* academia.css */

/* Hero Section */
.academia-hero {
    position: relative;
    height: 40vh;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(to bottom, rgba(17, 24, 39, 0.8), rgba(17, 24, 39, 1));
    overflow: hidden;
    padding-top: 80px;
}

#particles-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-content h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(2rem, 5vw, 4rem);
    color: var(--color-text);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.hero-content .subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 1.2rem;
    color: var(--color-text-muted);
}

/* Filter Section */
.filter-section {
    padding: 2rem;
    background-color: var(--color-bg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 70px; /* Below navbar */
    z-index: 10;
    backdrop-filter: blur(10px);
}

.filter-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: center;
    justify-content: center;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 250px;
    max-width: 400px;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
}

.search-box input {
    width: 100%;
    padding: 12px 15px 12px 40px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    color: var(--color-text);
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: all 0.3s ease;
}

.search-box input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-family: 'Orbitron', sans-serif;
    color: var(--color-primary);
    font-size: 0.9rem;
}

.filter-group select {
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: var(--color-text);
    font-family: 'Inter', sans-serif;
    outline: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-group select:hover {
    border-color: var(--color-primary);
}

/* Grid Section */
.grid-section {
    padding: 4rem 2rem;
    background-color: var(--color-bg);
    min-height: 500px;
}

.heroes-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    justify-items: center;
}

@media (max-width: 1024px) {
    .heroes-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .heroes-grid {
        grid-template-columns: 1fr;
    }
}

/* 3D Popout Card Effect */
.hero-card {
    position: relative;
    width: 300px;
    height: 420px;
    margin: 0 auto;
    cursor: pointer;
    transform-style: preserve-3d;
    transform: perspective(900px);
}

.wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.5s;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.wrapper::before,
.wrapper::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    z-index: 1;
    transition: all 0.5s;
    opacity: 0;
}

.wrapper::before {
    top: 0;
    height: 100%;
    background: linear-gradient(to bottom, transparent 40%, rgba(0, 0, 0, 0.7) 100%);
}

.wrapper::after {
    bottom: 0;
    height: 80px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
}

.cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.5s;
}

.character {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateZ(0px);
    width: 90%;
    max-height: 100%;
    object-fit: contain;
    object-position: bottom;
    opacity: 0;
    z-index: 2;
    transition: all 0.5s;
    pointer-events: none;
}

.card-overlay {
    position: absolute;
    bottom: 15px;
    left: 20px;
    width: 100%;
    z-index: 3;
    transition: all 0.5s;
}

/* ===== HOVER STATES ===== */
.hero-card:hover .wrapper {
    transform: translateY(-5%) rotateX(25deg) translateZ(0);
    box-shadow: 2px 35px 32px -8px rgba(0, 0, 0, 0.75);
    border-color: rgba(16, 185, 129, 0.4);
}

.hero-card:hover .wrapper::before,
.hero-card:hover .wrapper::after {
    opacity: 1;
}

.hero-card:hover .wrapper::after {
    height: 120px;
}

.hero-card:hover .cover-image {
    transform: scale(1.05);
}

.hero-card:hover .character {
    opacity: 1;
    transform: translateX(-50%) translate3d(0%, -30%, 100px);
}

.hero-card:hover .card-overlay {
    transform: translate3d(0%, -50px, 100px);
}

.card-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0;
}

.rank-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    font-weight: bold;
    margin-top: 5px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid currentColor;
}

/* Rank Colors */
.rank-s-plus { color: #F59E0B; text-shadow: 0 0 5px #F59E0B; }
.rank-s { color: #10B981; text-shadow: 0 0 5px #10B981; }
.rank-a-plus { color: #06B6D4; text-shadow: 0 0 5px #06B6D4; }
.rank-a { color: #FFFFFF; text-shadow: 0 0 5px #FFFFFF; }
.rank-b { color: #6B7280; }
.rank-c { color: #EF4444; }

/* Detail Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.modal-backdrop {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    background: rgba(17, 24, 39, 0.95);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 20px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8), inset 0 0 20px rgba(16, 185, 129, 0.05);
    z-index: 1001;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal:not(.hidden) .modal-content {
    transform: scale(1);
}

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

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

.modal-body {
    display: flex;
    flex-direction: row;
    padding: 40px;
    gap: 40px;
}

@media (max-width: 768px) {
    .modal-body {
        flex-direction: column;
        padding: 20px;
    }
}

.modal-left {
    flex: 1;
    min-width: 300px;
}

.modal-image-container {
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-image-container img {
    width: 100%;
    height: auto;
    display: block;
}

.modal-right {
    flex: 2;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-header h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    color: var(--color-primary);
    margin: 0 0 10px 0;
}

.roles-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.role-tag {
    padding: 5px 12px;
    background: rgba(139, 92, 246, 0.2); /* secondary color */
    border: 1px solid var(--color-secondary);
    border-radius: 15px;
    font-size: 0.8rem;
    color: var(--color-text);
}

/* Stat Bars */
.stats-container {
    background: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.stat-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-label {
    width: 100px;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.stat-bar {
    flex: 1;
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.stat-fill {
    height: 100%;
    background: var(--color-primary);
    width: 0%; /* Animated via JS */
    border-radius: 6px;
    box-shadow: 0 0 10px var(--color-primary);
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    background-image: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.15) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.15) 50%,
        rgba(255, 255, 255, 0.15) 75%,
        transparent 75%,
        transparent
    );
    background-size: 20px 20px;
}

.build-section h3, .emblems-section h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    color: var(--color-text);
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 5px;
}

.items-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.item-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: #000;
    object-fit: cover;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.item-icon:hover {
    transform: scale(1.1);
    border-color: var(--color-primary);
}

.video-container {
    margin-top: 20px;
}

.skeleton-loader {
    width: 300px;
    height: 420px;
    background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.05) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 16px;
}

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