@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #6366f1;
    --secondary: #ec4899;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: #0f172a;
    color: #f8fafc;
    overflow-x: hidden;
    width: 100%;
}

.glass-panel {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.text-gradient {
    background: linear-gradient(to right, #6366f1, #ec4899);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #0f172a;
}

::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

.anime-card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Skeleton Loading Animation */
@keyframes skeleton-shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
}

/* Lazy Image Loading */
.lazy-image {
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.lazy-image.loaded {
    opacity: 1;
}

/* Table of Contents */
.toc-link {
    position: relative;
    padding-left: 1rem;
    transition: all 0.3s ease;
}

.toc-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: linear-gradient(to bottom, var(--primary), var(--secondary));
    border-radius: 3px;
    transition: height 0.3s ease;
}

.toc-link.active {
    color: white;
}

.toc-link.active::before {
    height: 100%;
}

.toc-link:hover {
    color: white;
    padding-left: 1.25rem;
}

/* Carousel */
.carousel-container {
    position: relative;
}

.carousel-scroll {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 0.5rem 0;
}

.carousel-scroll::-webkit-scrollbar {
    display: none;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.9);
    border: none;
    color: white;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.carousel-btn:hover {
    background: var(--primary);
    transform: translateY(-50%) scale(1.1);
}

.carousel-btn.prev {
    left: -12px;
}

.carousel-btn.next {
    right: -12px;
}

@media (min-width: 768px) {
    .carousel-btn.prev {
        left: -24px;
    }

    .carousel-btn.next {
        right: -24px;
    }
}

.carousel-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Hero Slider */
.hero-slider {
    position: relative;
}

.hero-slide {
    will-change: opacity;
}

.slide-bg-image {
    transition: opacity 0.5s ease-in-out;
}

.slider-btn {
    opacity: 0;
    transform: translateY(-50%) scale(0.8);
    transition: all 0.3s ease;
}

.hero-slider:hover .slider-btn {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

.slider-btn:hover {
    background: var(--primary) !important;
    transform: translateY(-50%) scale(1.1) !important;
}

.slider-dot {
    cursor: pointer;
    transition: all 0.3s ease;
}

.slider-progress {
    width: 0%;
    animation: progressFill 20000ms linear forwards;
}

@keyframes progressFill {
    from {
        width: 0%;
    }

    to {
        width: 100%;
    }
}

/* Slide content animations */
.hero-slide.opacity-100 .max-w-3xl>* {
    animation: slideUp 0.6s ease forwards;
}

.hero-slide.opacity-100 .max-w-3xl>*:nth-child(1) {
    animation-delay: 0.1s;
}

.hero-slide.opacity-100 .max-w-3xl>*:nth-child(2) {
    animation-delay: 0.2s;
}

.hero-slide.opacity-100 .max-w-3xl>*:nth-child(3) {
    animation-delay: 0.3s;
}

.hero-slide.opacity-100 .max-w-3xl>*:nth-child(4) {
    animation-delay: 0.4s;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Search Box */
.search-box:hover input,
.search-box:focus-within input {
    width: 100%;
    opacity: 1;
}

.search-result-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

#search-results::-webkit-scrollbar {
    width: 4px;
}

#search-results::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}