* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #0f0f1e 0%, #1a1a2e 50%, #16213e 100%);
    color: #e0e0e0;
    min-height: 100vh;
    padding: 20px;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px 0;
}

h1 {
    font-size: 3rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    text-shadow: 0 0 30px rgba(102, 126, 234, 0.3);
}

.subtitle {
    color: #8a8aa0;
    font-size: 1.1rem;
}

.filters {
    background: rgba(26, 26, 46, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 40px;
    border: 1px solid rgba(102, 126, 234, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.filter-group {
    flex: 1;
    min-width: 150px;
}

.filter-group label {
    display: block;
    margin-bottom: 5px;
    color: #a0a0b0;
    font-size: 0.9rem;
    font-weight: 500;
}

.filter-group select,
.filter-group input {
    width: 100%;
    padding: 10px 15px;
    background: rgba(15, 15, 30, 0.8);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 10px;
    color: #e0e0e0;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.4);
}

.filter-group select option {
    background: #1a1a2e;
    color: #e0e0e0;
}

.search-bar {
    flex: 2;
}

button {
    padding: 10px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

button:active {
    transform: translateY(0);
}

.loading {
    text-align: center;
    padding: 40px;
    font-size: 1.2rem;
    color: #667eea;
}

.anime-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.anime-card {
    position: relative;
    background: rgba(26, 26, 46, 0.6);
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(102, 126, 234, 0.2);
    transform-style: preserve-3d;
    perspective: 1000px;
}

.anime-card:hover {
    transform: translateY(-10px) rotateX(5deg);
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.3);
    border-color: rgba(102, 126, 234, 0.5);
}

.anime-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.05) 50%,
        transparent 100%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 2;
}

.anime-card:hover::before {
    opacity: 1;
}

.anime-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 70%
    );
    transform: rotate(45deg);
    transition: all 0.6s ease;
    opacity: 0;
    pointer-events: none;
    z-index: 3;
}

.anime-card:hover::after {
    opacity: 1;
    transform: rotate(45deg) translate(50%, 50%);
}

.anime-thumbnail {
    width: 100%;
    height: 350px;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.anime-card:hover .anime-thumbnail {
    transform: scale(1.05);
}

.anime-info {
    padding: 20px;
    position: relative;
    z-index: 1;
}

.anime-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #ffffff;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.anime-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #a0a0b0;
}

.anime-year {
    color: #8a8aa0;
}

.anime-rating {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #1a1a2e;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.95rem;
    box-shadow: 0 2px 10px rgba(255, 215, 0, 0.3);
}

.anime-type {
    display: inline-block;
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-top: 8px;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #8a8aa0;
    font-size: 1.2rem;
}

.stats {
    text-align: center;
    margin-bottom: 20px;
    color: #a0a0b0;
    font-size: 1rem;
}

.load-more {
    text-align: center;
    margin: 40px 0;
}

@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    .anime-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 20px;
    }

    .filter-row {
        flex-direction: column;
    }

    .anime-thumbnail {
        height: 250px;
    }

    .anime-card:hover {
        transform: translateY(-5px) rotateX(2deg);
    }
}

/* Smooth fade-in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.anime-card {
    animation: fadeIn 0.5s ease forwards;
}

.anime-card:nth-child(odd) {
    animation-delay: 0.05s;
}

.anime-card:nth-child(even) {
    animation-delay: 0.1s;
}
