/* RESET & VARIABLES */
:root {
    --primary: #8a2be2;
    --primary-dark: #6a1cb0;
    --secondary: #ff6b9d;
    --accent: #00d4ff;
    --dark: #121212;
    --darker: #0a0a0a;
    --light: #f8f8f8;
    --gray: #2a2a2a;
    --gray-light: #444;
    --transition: all 0.3s ease;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    --radius: 12px;
    --gradient: linear-gradient(135deg, var(--primary), var(--secondary));
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--darker);
    color: var(--light);
    line-height: 1.6;
    overflow-x: hidden;
}

/* TYPOGRAPHY */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: 3.5rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 2.5rem;
    color: var(--light);
    position: relative;
    display: inline-block;
    margin-bottom: 2rem;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--gradient);
    border-radius: 2px;
}

h3 {
    font-size: 1.8rem;
    color: var(--light);
}

p {
    margin-bottom: 1.5rem;
    color: #ccc;
}

a {
    text-decoration: none;
    color: var(--accent);
    transition: var(--transition);
}

a:hover {
    color: var(--secondary);
}

/* LAYOUT */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

section {
    padding: 100px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

/* BUTTONS */
.btn {
    display: inline-block;
    padding: 14px 32px;
    border-radius: 50px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

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

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(138, 43, 226, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--light);
    border: 2px solid var(--gray-light);
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-outline {
    background: transparent;
    color: var(--light);
    border: 2px solid var(--primary);
}

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

/* HEADER & NAVIGATION */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
}

header.scrolled {
    padding: 10px 0;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--light);
    display: flex;
    align-items: center;
}

.logo span {
    color: var(--primary);
}

.logo i {
    margin-right: 10px;
    color: var(--primary);
}

/* HERO SECTION */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(18, 18, 18, 0.9), rgba(10, 10, 10, 0.9)), url('https://images.unsplash.com/photo-1634017839464-5c339ebe3cb4?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1935&q=80');
    background-size: cover;
    background-position: center;
}

.hero-content {
    max-width: 700px;
    position: relative;
    z-index: 2;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: #ddd;
}

.hero-btns {
    display: flex;
    gap: 20px;
}

.hero-image {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 50%;
    max-width: 700px;
    z-index: 1;
    opacity: 0.8;
}

/* SEARCH SECTION */
.search-section {
    background: var(--dark);
    padding: 80px 0;
}

.search-container {
    max-width: 800px;
    margin: 0 auto;
}

.search-box {
    position: relative;
    margin-bottom: 40px;
}

.search-input {
    width: 100%;
    padding: 18px 25px;
    border-radius: 50px;
    background: var(--gray);
    border: 2px solid var(--gray-light);
    color: var(--light);
    font-size: 1rem;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(138, 43, 226, 0.2);
}

.search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 12px 25px;
    cursor: pointer;
    transition: var(--transition);
}

.search-btn:hover {
    transform: translateY(-50%) scale(1.05);
}

/* GALLERY SECTION */
.gallery {
    padding: 100px 0;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.character-card {
    background: var(--gray);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    position: relative;
    box-shadow: var(--shadow);
}

.character-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.character-img {
    width: 100%;
    height: 350px;
    object-fit: cover;
    transition: var(--transition);
}

.character-card:hover .character-img {
    transform: scale(1.05);
}

.character-info {
    padding: 20px;
}

.character-name {
    font-size: 1.4rem;
    margin-bottom: 10px;
    color: var(--light);
}

.character-anime {
    color: var(--secondary);
    font-weight: 500;
    margin-bottom: 20px;
    display: block;
}

.character-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.view-btn {
    background: var(--gradient);
    color: white;
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.view-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(138, 43, 226, 0.4);
}

.favorite-btn {
    background: transparent;
    border: none;
    color: #bbb;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
}

.favorite-btn:hover {
    color: var(--secondary);
}

/* PAGINATION */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 50px;
}

.page-btn {
    background: var(--gray);
    color: var(--light);
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
}

.page-btn:hover:not(:disabled) {
    background: var(--primary);
    transform: translateY(-2px);
}

.page-btn.active {
    background: var(--gradient);
    color: white;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    color: #bbb;
    font-size: 0.9rem;
    margin: 0 10px;
}

/* LOADING & ERROR STATES */
.loading-state {
    text-align: center;
    padding: 60px 0;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--gray);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.error-state {
    text-align: center;
    padding: 60px 0;
    color: var(--secondary);
}

.error-state i {
    font-size: 3rem;
    margin-bottom: 20px;
}

/* ANIMATIONS */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.fade-in {
    animation: fadeIn 0.8s ease forwards;
}

.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }
.delay-3 { animation-delay: 0.6s; }

/* RESPONSIVE DESIGN */
@media (max-width: 1200px) {
    .hero-image {
        width: 45%;
    }
}

@media (max-width: 992px) {
    h1 {
        font-size: 3rem;
    }
    
    h2 {
        font-size: 2.2rem;
    }
    
    .hero-image {
        display: none;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 15px 0;
    }
    
    .hero-btns {
        flex-direction: column;
        gap: 15px;
    }
    
    .btn {
        width: 100%;
        text-align: center;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    .pagination {
        flex-wrap: wrap;
        gap: 10px;
    }
}

@media (max-width: 576px) {
    h1 {
        font-size: 2.5rem;
    }
    
    h2 {
        font-size: 2rem;
    }
    
    section {
        padding: 60px 0;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .page-btn {
        width: 40px;
        height: 40px;
        font-size: 0.8rem;
    }
}

/* UTILITY CLASSES */
.text-center {
    text-align: center;
}

.mb-0 {
    margin-bottom: 0;
}

.mt-0 {
    margin-top: 0;
}

.hidden {
    display: none;
}

.visible {
    display: block;
}
