:root {
    --bg-dark: #0a0a0f;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --accent-primary: #8a2be2;
    /* BlueViolet */
    --accent-secondary: #00ffff;
    /* Cyan */
    --glass-bg: rgba(20, 20, 30, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
    --card-hover: rgba(138, 43, 226, 0.2);
    --font-main: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-main);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Background Effects */
.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 10s infinite alternate;
}

.orb-1 {
    width: 300px;
    height: 300px;
    background: var(--accent-primary);
    top: -50px;
    left: -50px;
    animation-delay: 0s;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: var(--accent-secondary);
    bottom: -100px;
    right: -100px;
    animation-delay: -5s;
}

@keyframes float {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(30px, 50px);
    }
}

/* Glassmorphism Classes */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid var(--glass-border);
}

/* Header */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    padding: 20px;
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    border-radius: 50px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.highlight {
    color: var(--accent-secondary);
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    margin-left: 30px;
    transition: color 0.3s;
    font-weight: 600;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
}

/* Main */
main {
    padding-top: 100px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 60px 20px;
    max-width: 800px;
    width: 100%;
}

.hero h1 {
    font-size: 4rem;
    margin-bottom: 20px;
    line-height: 1.1;
}

.text-gradient {
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 50px;
}

/* Genre Filters */
.genre-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 30px;
    padding: 0 10px;
}

.genre-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: var(--font-main);
    font-size: 0.9rem;
}

.genre-btn:hover,
.genre-btn.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(138, 43, 226, 0.3);
}

/* Search Box */
.search-container {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-box {
    display: flex;
    align-items: center;
    padding: 8px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.search-box:focus-within {
    border-color: var(--accent-secondary);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.2);
}

.search-icon {
    margin-left: 15px;
    color: var(--text-secondary);
}

input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
    outline: none;
    font-family: var(--font-main);
}

input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.glow-button {
    background: linear-gradient(90deg, var(--accent-primary), #6a0dad);
    border: none;
    color: white;
    padding: 12px 30px;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: var(--font-main);
}

.glow-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 15px var(--accent-primary);
}

.lucky-button {
    background: transparent;
    border: 1px solid var(--accent-secondary);
    color: var(--accent-secondary);
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: var(--font-main);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.lucky-button:hover {
    background: rgba(0, 255, 255, 0.1);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.4);
    transform: scale(1.05);
}

/* Search Dropdown Results */
.search-results {
    position: absolute;
    top: 110%;
    left: 0;
    width: 100%;
    background: rgba(15, 15, 25, 0.95);
    border-radius: 15px;
    border: 1px solid var(--glass-border);
    max-height: 300px;
    overflow-y: auto;
    z-index: 50;
    backdrop-filter: blur(20px);
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.search-result-item img {
    width: 40px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 15px;
}

.search-result-info h4 {
    font-size: 1rem;
    margin-bottom: 2px;
}

.search-result-info span {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Grids Sections */
.results-section,
.trending-section {
    width: 100%;
    max-width: 1200px;
    padding: 40px 20px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.text-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.9rem;
    font-family: var(--font-main);
}

.text-btn:hover {
    color: var(--accent-secondary);
}

.anime-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 30px;
}

/* Anime Card */
.anime-card {
    background: var(--glass-bg);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid transparent;
    cursor: pointer;
    position: relative;
    height: 350px;
}

.anime-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-color: var(--accent-primary);
}

.card-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.anime-card:hover .card-image img {
    transform: scale(1.05);
}

.card-content {
    padding: 15px;
    position: relative;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
}

.rating-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #ffd700;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: bold;
    backdrop-filter: blur(4px);
}

/* Footer */
footer {
    width: 100%;
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
    margin-top: auto;
    font-size: 0.9rem;
}

/* Utilities */
.hidden {
    display: none !important;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    .anime-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 15px;
    }

    .anime-card {
        height: 260px;
    }

    .card-image {
        height: 180px;
    }
}