@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Global smooth transitions */
*, *::before, *::after {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition: none !important;
        animation: none !important;
    }
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    color: #ffffff;
    line-height: 1.6;
    overflow-x: hidden;
    animation: fadeInBody 0.8s ease-out;
}

@keyframes fadeInBody {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Navigation */
.navbar {
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    animation: slideInFromTop 0.6s ease-out;
    transition: all 0.3s ease;
}

.navbar:hover {
    background: rgba(0, 0, 0, 0.98);
    backdrop-filter: blur(15px);
}

@keyframes slideInFromTop {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
}

/* Compact Logo Design */
.logo-container {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.logo-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon i {
    font-size: 1.8rem;
    color: #ff6b35;
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 8px rgba(255, 107, 53, 0.3));
    animation: logoGlow 2s ease-in-out infinite alternate;
}

@keyframes logoGlow {
    0% { filter: drop-shadow(0 0 10px rgba(255, 107, 53, 0.3)); }
    100% { filter: drop-shadow(0 0 20px rgba(255, 107, 53, 0.6)); }
}

.logo-sparkles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.sparkle {
    position: absolute;
    font-size: 0.6rem;
    animation: sparkleFloat 3s ease-in-out infinite;
}

.sparkle-1 {
    top: -3px;
    right: -3px;
    animation-delay: 0s;
}

.sparkle-2 {
    bottom: -3px;
    left: -3px;
    animation-delay: 1s;
}

.sparkle-3 {
    top: 50%;
    right: -6px;
    animation-delay: 2s;
}

@keyframes sparkleFloat {
    0%, 100% { 
        opacity: 0.4;
        transform: translateY(0px) scale(0.8);
    }
    50% { 
        opacity: 1;
        transform: translateY(-3px) scale(1.2);
    }
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 1.6rem;
    font-weight: 800;
    margin: 0;
    display: flex;
    align-items: center;
    line-height: 1;
}

.letter {
    display: inline-block;
    transition: all 0.3s ease;
    cursor: pointer;
}

.letter-a {
    background: linear-gradient(135deg, #ff6b35, #ff8c42);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.letter-n {
    background: linear-gradient(135deg, #f7931e, #ffb347);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.letter-i {
    background: linear-gradient(135deg, #ff6b35, #ff4757);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.letter-u {
    background: linear-gradient(135deg, #f7931e, #ff6b35);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.letter:hover {
    transform: translateY(-2px) scale(1.1);
    filter: drop-shadow(0 4px 8px rgba(255, 107, 53, 0.4));
}

/* Compact Tagline Design */
.brand-tagline {
    display: flex;
    align-items: center;
    margin-top: 2px;
    gap: 3px;
}

.tagline-word {
    display: flex;
    align-items: center;
}

.tagline-space {
    width: 4px;
}

.tag-letter {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    letter-spacing: 0.2px;
}

/* Individual letter gradients for "Kiss it Real" */
.tag-k {
    background: linear-gradient(135deg, #ff6b35, #ff8c42);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tag-i1, .tag-i2 {
    background: linear-gradient(135deg, #f7931e, #ffb347);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tag-s1, .tag-s2 {
    background: linear-gradient(135deg, #ff6b35, #ff4757);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tag-t {
    background: linear-gradient(135deg, #f7931e, #ff6b35);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tag-r {
    background: linear-gradient(135deg, #ff4757, #ff6b35);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tag-e {
    background: linear-gradient(135deg, #ffb347, #f7931e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tag-a {
    background: linear-gradient(135deg, #ff6b35, #ff8c42);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tag-l {
    background: linear-gradient(135deg, #f7931e, #ff4757);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tag-letter:hover {
    transform: translateY(-1px) scale(1.05);
    filter: drop-shadow(0 2px 4px rgba(255, 107, 53, 0.3));
}

/* Staggered animation for tagline letters */
.tag-letter:nth-child(1) { animation-delay: 0.1s; }
.tag-letter:nth-child(2) { animation-delay: 0.2s; }
.tag-letter:nth-child(3) { animation-delay: 0.3s; }
.tag-letter:nth-child(4) { animation-delay: 0.4s; }

@keyframes taglineGlow {
    0%, 100% { 
        filter: drop-shadow(0 0 2px rgba(255, 107, 53, 0.2));
    }
    50% { 
        filter: drop-shadow(0 0 6px rgba(255, 107, 53, 0.4));
    }
}

.brand-tagline:hover .tag-letter {
    animation: taglineGlow 1.5s ease-in-out infinite;
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: #ccc;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: #ff6b35;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: 0;
    height: 2px;
    background: #ff6b35;
    border-radius: 1px;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: #ff6b35;
    border-radius: 1px;
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    padding: 0.5rem;
    backdrop-filter: blur(10px);
}

#searchInput {
    background: transparent;
    border: none;
    color: #fff;
    padding: 0.5rem 1rem;
    width: 300px;
    outline: none;
    font-size: 0.9rem;
}

#searchInput::placeholder {
    color: #888;
}

#searchButton {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

#searchButton:hover {
    transform: scale(1.05);
}

/* Search Dropdown */
.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(20, 20, 20, 0.98);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 107, 53, 0.4);
    border-radius: 16px;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 8px 16px rgba(255, 107, 53, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    z-index: 1000;
    max-height: 75vh;
    overflow: hidden;
    transform: translateY(-20px) scale(0.9) rotateX(-10deg);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    margin-top: 12px;
    transform-origin: top center;
    perspective: 1000px;
}

.search-dropdown:not(.hidden) {
    transform: translateY(0) scale(1) rotateX(0deg);
    opacity: 1;
}

.search-dropdown:not(.hidden) .search-dropdown-header {
    animation: slideInFromTop 0.6s ease-out 0.1s both;
}

.search-dropdown:not(.hidden) .anime-card {
    animation: fadeInUp 0.6s ease-out forwards;
}

.search-dropdown:not(.hidden) .anime-card:nth-child(1) { animation-delay: 0.2s; }
.search-dropdown:not(.hidden) .anime-card:nth-child(2) { animation-delay: 0.25s; }
.search-dropdown:not(.hidden) .anime-card:nth-child(3) { animation-delay: 0.3s; }
.search-dropdown:not(.hidden) .anime-card:nth-child(4) { animation-delay: 0.35s; }
.search-dropdown:not(.hidden) .anime-card:nth-child(5) { animation-delay: 0.4s; }
.search-dropdown:not(.hidden) .anime-card:nth-child(n+6) { animation-delay: 0.45s; }

.search-dropdown-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid rgba(255, 107, 53, 0.25);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.15), rgba(255, 107, 53, 0.08));
    position: sticky;
    top: 0;
    z-index: 10;
}

.search-dropdown-header span {
    color: #ff6b35;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.search-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 8px;
    position: relative;
}

.search-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid rgba(255, 107, 53, 0.2);
    border-radius: 50%;
    border-top-color: #ff6b35;
    border-right-color: #ff6b35;
    animation: spinFast 0.6s linear infinite, breathe 2s ease-in-out infinite;
}

.search-loading::after {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border: 1px solid transparent;
    border-top-color: rgba(255, 107, 53, 0.6);
    border-bottom-color: rgba(255, 107, 53, 0.3);
    border-radius: 50%;
    animation: spinSlow 1.8s linear infinite reverse, glow 2s ease-in-out infinite;
}

@keyframes spinFast {
    to { transform: rotate(360deg); }
}

@keyframes spinSlow {
    to { transform: rotate(360deg); }
}

@keyframes breathe {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: 0.8; }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px rgba(255, 107, 53, 0.3); }
    50% { box-shadow: 0 0 15px rgba(255, 107, 53, 0.6), 0 0 25px rgba(255, 107, 53, 0.3); }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.search-hint {
    color: #999;
    font-style: italic;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-hint::before {
    content: 'ℹ️';
    font-style: normal;
}

/* Empty state styling */
.search-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: #888;
}

.search-empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.6;
}

.search-empty-state .empty-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #ccc;
}

.search-empty-state .empty-subtitle {
    font-size: 0.9rem;
    opacity: 0.8;
    line-height: 1.4;
}

/* Search suggestions */
.search-suggestions {
    padding: 16px 24px;
    border-top: 1px solid rgba(255, 107, 53, 0.15);
    background: rgba(255, 107, 53, 0.05);
}

.search-suggestions-title {
    font-size: 0.85rem;
    color: #ff6b35;
    font-weight: 600;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-suggestions-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.search-suggestion-tag {
    background: rgba(255, 107, 53, 0.15);
    border: 1px solid rgba(255, 107, 53, 0.3);
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 0.8rem;
    color: #ff6b35;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.search-suggestion-tag:hover {
    background: rgba(255, 107, 53, 0.25);
    border-color: rgba(255, 107, 53, 0.5);
    transform: translateY(-1px);
}

.search-dropdown-close {
    background: rgba(255, 107, 53, 0.15);
    border: 1px solid rgba(255, 107, 53, 0.3);
    border-radius: 10px;
    color: #ff6b35;
    cursor: pointer;
    padding: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
}

.search-dropdown-close:hover {
    background: rgba(255, 107, 53, 0.25);
    border-color: rgba(255, 107, 53, 0.5);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.2);
}

.search-dropdown-close:active {
    transform: scale(0.95);
}

.search-dropdown-content {
    padding: 0;
    max-height: calc(75vh - 80px);
    overflow-y: auto;
    overflow-x: hidden;
}

.search-dropdown-content::-webkit-scrollbar {
    width: 6px;
}

.search-dropdown-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    margin: 8px 0;
}

.search-dropdown-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.search-dropdown-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #f7931e, #ff6b35);
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
}

/* Search dropdown anime grid */
.search-dropdown .anime-grid,
.search-dropdown #search-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1rem !important;
    padding: 1rem 1.5rem;
    max-height: calc(70vh - 120px);
    overflow-y: auto;
}

.search-dropdown .anime-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 107, 53, 0.15);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    backdrop-filter: blur(10px);
}

.search-dropdown .anime-card:hover {
    background: rgba(255, 107, 53, 0.08);
    border-color: rgba(255, 107, 53, 0.4);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 
        0 12px 24px rgba(0, 0, 0, 0.3),
        0 4px 8px rgba(255, 107, 53, 0.2);
}

.search-dropdown .anime-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.search-dropdown .anime-card:hover::before {
    opacity: 1;
}

.search-dropdown .anime-card img,
.search-dropdown #search-grid .anime-card img {
    width: 100% !important;
    height: 200px !important; /* Optimal height for 2-column layout */
    object-fit: cover !important;
    display: block !important;
    border-radius: 12px !important;
}

.search-dropdown .pagination {
    justify-content: center;
    margin-top: 1rem;
}

/* Search grid loading animation */
.search-grid-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
    min-height: 200px;
    grid-column: 1 / -1; /* Span full width in grid */
}

.search-loading-spinner {
    width: 50px;
    height: 50px;
    margin-bottom: 1.5rem;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-loading-spinner::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid rgba(255, 107, 53, 0.15);
    border-radius: 50%;
    border-top: 3px solid #ff6b35;
    border-right: 3px solid #ff8c42;
    animation: spinOrbit 1s linear infinite, expandContract 3s ease-in-out infinite;
}

.search-loading-spinner::after {
    content: '';
    position: absolute;
    width: 70%;
    height: 70%;
    border: 2px solid transparent;
    border-top: 2px solid rgba(255, 107, 53, 0.8);
    border-left: 2px solid rgba(255, 107, 53, 0.5);
    border-radius: 50%;
    animation: spinReverse 0.7s linear infinite reverse, pulse 2s ease-in-out infinite;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Add floating particles around the spinner */
.search-grid-loading::before {
    content: '✨';
    position: absolute;
    top: 20%;
    left: 20%;
    font-size: 12px;
    animation: floatParticle1 3s ease-in-out infinite;
    opacity: 0.7;
}

.search-grid-loading::after {
    content: '⭐';
    position: absolute;
    top: 30%;
    right: 25%;
    font-size: 10px;
    animation: floatParticle2 2.5s ease-in-out infinite 0.5s;
    opacity: 0.6;
}

@keyframes spinOrbit {
    to { transform: rotate(360deg); }
}

@keyframes spinReverse {
    to { transform: translate(-50%, -50%) rotate(-360deg); }
}

@keyframes expandContract {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes floatParticle1 {
    0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.7; }
    33% { transform: translateY(-10px) rotate(120deg); opacity: 1; }
    66% { transform: translateY(5px) rotate(240deg); opacity: 0.5; }
}

@keyframes floatParticle2 {
    0%, 100% { transform: translateX(0) rotate(0deg); opacity: 0.6; }
    50% { transform: translateX(15px) rotate(180deg); opacity: 1; }
}

.search-loading-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0;
    animation: fadeInUp 0.6s ease-out 0.3s forwards;
}

/* Search suggestions styles */
.search-suggestions {
    padding: 20px 24px;
    animation: fadeInUp 0.4s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes staggerIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.search-suggestions-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #ff6b35;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-suggestions-title::before {
    content: "🔥";
    font-size: 1rem;
}

.search-suggestions-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.search-suggestion-tag {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.1), rgba(255, 107, 53, 0.2));
    border: 1px solid rgba(255, 107, 53, 0.3);
    color: #ff6b35;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateY(10px) scale(0.9);
}

.search-suggestion-tag.animate-in {
    animation: staggerIn 0.4s ease-out forwards;
}

.search-suggestion-tag:hover,
.search-suggestion-tag:focus {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.2), rgba(255, 107, 53, 0.3));
    border-color: rgba(255, 107, 53, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.2);
    outline: none;
}

.search-suggestion-tag:focus {
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3), 0 0 0 2px rgba(255, 107, 53, 0.4);
}

.search-suggestion-tag:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(255, 107, 53, 0.2);
}

/* Search empty state styles */
.search-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.7);
}

.search-empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.6;
}

.search-empty-state .empty-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
}

.search-empty-state .empty-subtitle {
    font-size: 0.9rem;
    line-height: 1.5;
    opacity: 0.8;
    margin-bottom: 20px;
}

.search-empty-state .anime-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #f0f0f0;
    margin: 0;
    line-height: 1.4;
    white-space: nowrap; /* Prevent wrapping */
    overflow: hidden; /* Hide overflow */
    text-overflow: ellipsis; /* Add ellipsis for long titles */
}

/* Search dropdown responsive styles */
@media (max-width: 768px) {
    .search-dropdown {
        margin-top: 8px;
        border-radius: 12px;
        max-height: 80vh;
    }
    
    .search-dropdown-header {
        padding: 16px 20px 12px;
    }
    
    .search-dropdown-header span {
        font-size: 0.9rem;
    }
    
    .search-dropdown-close {
        width: 32px;
        height: 32px;
        padding: 8px;
    }
    
    .search-dropdown .anime-grid,
    .search-dropdown #search-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
        padding: 16px 20px;
    }
    
    .search-dropdown .anime-card img,
    .search-dropdown #search-grid .anime-card img {
        height: 180px !important; /* Smaller height for tablet */
    }
    
    .search-suggestions {
        padding: 12px 20px;
    }
    
    .search-suggestion-tag {
        padding: 8px 12px;
        font-size: 0.75rem;
    }
    
    .search-empty-state {
        padding: 30px 16px;
    }
    
    .search-empty-state .empty-icon {
        font-size: 2.5rem;
        padding: 0.8rem;
    }
}

@media (max-width: 480px) {
    .search-dropdown {
        margin-top: 6px;
        border-radius: 10px;
        max-height: 85vh;
    }
    
    .search-dropdown-header {
        padding: 12px 16px 10px;
    }
    
    .search-dropdown-header span {
        font-size: 0.85rem;
    }
    
    .search-dropdown-close {
        width: 28px;
        height: 28px;
        padding: 6px;
        font-size: 0.8rem;
    }
    
    .search-dropdown .anime-grid,
    .search-dropdown #search-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        padding: 12px 16px;
    }
    
    .search-dropdown .anime-card img,
    .search-dropdown #search-grid .anime-card img {
        height: 160px !important; /* Smaller height for mobile */
    }
    
    .search-suggestions {
        padding: 10px 16px;
    }
    
    .search-suggestions-title {
        font-size: 0.8rem;
        margin-bottom: 10px;
    }
    
    .search-suggestion-tag {
        padding: 6px 10px;
        font-size: 0.7rem;
        border-radius: 16px;
    }
    
    .search-empty-state {
        padding: 24px 12px;
    }
    
    .search-empty-state .empty-icon {
        font-size: 2rem;
        margin-bottom: 12px;
    }
    
    .search-empty-state .empty-title {
        font-size: 1rem;
    }
    
    .search-empty-state .empty-subtitle {
        font-size: 0.8rem;
    }
}

/* Hero Banner */
.hero-banner {
    height: 70vh;
    position: relative;
    overflow: hidden;
    background: #000;
}

.banner-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.banner-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    display: flex;
    align-items: center;
}

.banner-slide.active {
    opacity: 1;
}

.banner-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: brightness(0.4);
    transition: transform 7s ease-out;
}

.banner-slide.active .banner-background {
    transform: scale(1.1);
}

.banner-content {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: 0 4rem;
}

.banner-info {
    max-width: 600px;
    color: white;
}

.banner-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    line-height: 1.1;
}

.banner-description {
    font-size: 1.2rem;
    color: #e0e0e0;
    margin-bottom: 1.5rem;
    line-height: 1.6;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
}

.banner-meta {
    display: flex;
    flex-direction: column; /* Stack items vertically */
    align-items: center; /* Center items horizontally */
    gap: 0.75rem; /* Adjust gap for vertical stacking */
    margin-bottom: 2rem;
    width: 100%;
}

.banner-meta-top {
    display: flex;
    align-items: center;
    gap: 1.5rem; /* Keep original gap for horizontal items */
}

.banner-year {
    background: rgba(255, 107, 53, 0.2);
    color: #ff6b35;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    border: 1px solid rgba(255, 107, 53, 0.3);
}

.banner-rating {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: #ffd700;
    font-weight: 600;
}

.banner-genre {
    color: #ccc;
    font-size: 0.9rem;
}

.banner-buttons {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.banner-indicators {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.8rem;
    z-index: 3;
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator.active {
    background: #ff6b35;
    transform: scale(1.2);
}

.indicator:hover {
    background: rgba(255, 107, 53, 0.7);
}

.banner-navigation {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 3;
    pointer-events: none;
}

.nav-btn {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: all;
    backdrop-filter: blur(10px);
}

.nav-btn:hover {
    background: rgba(255, 107, 53, 0.8);
    border-color: #ff6b35;
    transform: scale(1.1);
}

.nav-btn i {
    font-size: 1.2rem;
}

.btn-primary, .btn-secondary {
    padding: 12px 24px; /* Standardized padding */
    border: none;
    border-radius: 50px; /* Fully rounded for a modern look */
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex; /* Use inline-flex for better alignment */
    align-items: center;
    justify-content: center; /* Center content */
    gap: 0.5rem;
    font-size: 1rem;
    position: relative;
    overflow: hidden;
    transform: translateZ(0); /* Hardware acceleration */
    text-decoration: none; /* Remove underline from links styled as buttons */
}





.btn-primary {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: white;
}





.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-primary:hover, .btn-secondary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2), 0 8px 10px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    box-shadow: 0 15px 35px rgba(255, 107, 53, 0.4), 0 0 25px rgba(255, 107, 53, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-primary:active, .btn-secondary:active {
    transform: translateY(-1px) scale(0.98);
    transition: all 0.1s ease;
}

/* Content Sections */
.content-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 2rem;
    opacity: 0;
    transform: translateY(40px);
    animation: fadeInUp 0.8s ease-out forwards;
}

.content-section:nth-child(1) { animation-delay: 0.2s; }
.content-section:nth-child(2) { animation-delay: 0.4s; }
.content-section:nth-child(3) { animation-delay: 0.6s; }
.content-section:nth-child(4) { animation-delay: 0.8s; }

.section-header {
    margin-bottom: 2rem;
    opacity: 0;
    transform: translateX(-30px);
    animation: slideInFromLeft 0.6s ease-out forwards;
}

@keyframes slideInFromLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.section-header h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-header h2 i {
    color: #ff6b35;
}

.section-subtitle {
    color: #888;
    font-size: 1rem;
    font-weight: 300;
}

/* Anime Grid */
.anime-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
}

.anime-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease-out forwards;
    display: flex; /* Use flexbox for layout */
    flex-direction: column; /* Stack items vertically */
}

/* Staggered animation for cards */
.anime-card:nth-child(1) { animation-delay: 0.1s; }
.anime-card:nth-child(2) { animation-delay: 0.2s; }
.anime-card:nth-child(3) { animation-delay: 0.3s; }
.anime-card:nth-child(4) { animation-delay: 0.4s; }
.anime-card:nth-child(5) { animation-delay: 0.5s; }
.anime-card:nth-child(6) { animation-delay: 0.6s; }
.anime-card:nth-child(n+7) { animation-delay: 0.7s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.anime-card img {
    width: 100% !important;
    height: auto !important; /* Let aspect-ratio control the height */
    aspect-ratio: 2 / 3 !important; /* Enforce a standard aspect ratio */
    object-fit: cover !important; /* Ensure image covers the area */
    transition: transform 0.4s ease;
}

.anime-card-info {
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    flex-grow: 1; /* Allow info to fill remaining space */
    display: flex;
    flex-direction: column;
    justify-content: center; /* Center content vertically */
    height: 80px; /* Enforce a fixed height for the info section */
}

.anime-card .episode-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: white;
    padding: 4px 8px;
    border-radius: 6px; /* Add curved edges */
    font-size: 0.75rem; /* Refine font size */
    font-weight: 600; /* Add font weight */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); /* Add subtle shadow */
}

.anime-card .episode-badge.loading {
background: linear-gradient(90deg, 
    rgba(51, 51, 51, 0.8) 0%, 
    rgba(68, 68, 68, 0.9) 25%, 
    rgba(85, 85, 85, 1) 50%, 
    rgba(68, 68, 68, 0.9) 75%, 
    rgba(51, 51, 51, 0.8) 100%
);
background-size: 300% 100%;
animation: advancedShimmer 2s ease-in-out infinite, loadingPulse 3s ease-in-out infinite;
color: transparent !important;
position: relative;
overflow: hidden;
}

.loading::before {
content: '';
position: absolute;
top: 0;
left: -100%;
width: 100%;
height: 100%;
background: linear-gradient(90deg, 
    transparent, 
    rgba(255, 107, 53, 0.3), 
    transparent
);
animation: loadingWave 2.5s ease-in-out infinite;
}

.loading::after {
content: '';
position: absolute;
top: 0;
right: -2px;
width: 2px;
height: 100%;
background: linear-gradient(180deg, 
    transparent, 
    rgba(255, 107, 53, 0.8), 
    transparent
);
animation: loadingScan 3s ease-in-out infinite;
}

.loading {
border-radius: 6px;
min-height: 20px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

@keyframes advancedShimmer {
0% { background-position: -300% 0; }
100% { background-position: 300% 0; }
}

@keyframes loadingPulse {
0%, 100% { opacity: 0.8; transform: scale(1); }
50% { opacity: 1; transform: scale(1.02); }
}

@keyframes loadingWave {
0% { left: -100%; opacity: 0; }
50% { left: 0%; opacity: 1; }
100% { left: 100%; opacity: 0; }
}

@keyframes loadingScan {
0%, 100% { opacity: 0; transform: scaleY(0.5); }
50% { opacity: 1; transform: scaleY(1); }
}

.anime-card:hover {
    transform: translateY(-12px) scale(1.03);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4), 0 0 30px rgba(255, 107, 53, 0.3);
    border-color: #ff6b35;
    background: rgba(255, 255, 255, 0.08);
}

.anime-card:hover .anime-card-title {
    color: #ff6b35;
    transform: translateY(-2px);
}

.anime-card:hover .episode-badge {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
}



.anime-card:hover img {
    transform: scale(1.08);
    filter: brightness(1.1) contrast(1.05);
}

/* Universal rule to ensure all anime card images follow standard sizing */
.anime-grid .anime-card img,
.anime-card img[src*="myanimelist"],
.anime-card img[src*="cdn"],
#trending-anime-grid .anime-card img,
#new-anime-grid .anime-card img,
#search-grid .anime-card img,
.modal-body .anime-grid .anime-card img,
.anime-card img[loading="lazy"],
.anime-card img[alt] {
    width: 100% !important;
    height: 286px !important;
    object-fit: cover !important;
    display: block !important;
    border-radius: 12px;
}

.anime-card-title {
    padding: 1rem 1rem 0.5rem 1rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: white;
    line-height: 1.3;
    min-height: 2.6rem;
    display: flex;
    align-items: center;
    white-space: nowrap; /* Prevent wrapping */
    overflow: hidden; /* Hide overflow */
    text-overflow: ellipsis; /* Add ellipsis for long titles */
}

.anime-card-meta {
    padding: 0 1rem 1rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #ccc;
}

.anime-card-meta .year {
    background: rgba(255, 107, 53, 0.2);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
}

.anime-card-meta .rating {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    color: #ffd700;
}

/* Modern Details Section */
.details-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(15, 15, 15, 0.95) 0%, rgba(26, 26, 26, 0.95) 100%);
    border-radius: 24px;
    backdrop-filter: blur(20px) saturate(1.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.4),
        0 10px 20px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.details-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 107, 53, 0.6) 25%, 
        rgba(255, 107, 53, 0.8) 50%, 
        rgba(255, 107, 53, 0.6) 75%, 
        transparent 100%);
    z-index: 1;
}

.back-btn {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.06) 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #e0e0e0;
    padding: 1rem 2rem;
    border-radius: 16px;
    cursor: pointer;
    margin-bottom: 2.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px) saturate(1.2);
    position: relative;
    overflow: hidden;
    z-index: 2;
}

.back-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s ease;
}

.back-btn:hover::before {
    left: 100%;
}

.back-btn:hover {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.2) 0%, rgba(255, 107, 53, 0.1) 100%);
    border-color: rgba(255, 107, 53, 0.4);
    color: #ff6b35;
    transform: translateY(-2px);
    box-shadow: 
        0 15px 35px rgba(255, 107, 53, 0.2),
        0 5px 15px rgba(255, 107, 53, 0.1);
}

.back-btn:active {
    transform: translateY(-1px) scale(0.98);
    transition: all 0.1s ease;
}

.details-container {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 3rem;
    margin-bottom: 3rem;
    position: relative;
    z-index: 2;
}

.details-content {
    display: flex;
    gap: 2.5rem;
    align-items: flex-start; /* Align items to the top */
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(10px);
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.2),
        0 5px 15px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.details-content img {
    flex-shrink: 0; /* Prevent the image from shrinking */
    width: 100%;
    max-width: 220px; /* Set a max-width for the poster */
    height: auto; /* Let aspect-ratio control the height */
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 16px;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.5),
        0 10px 25px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.details-content img:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 35px 70px rgba(0, 0, 0, 0.6),
        0 15px 35px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 107, 53, 0.2);
}

.anime-info h1 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: white;
    background: linear-gradient(135deg, #ffffff 0%, #e0e0e0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
    line-height: 1.2;
    position: relative;
}

.anime-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: center;
}

.year-badge, .rating-badge {
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    backdrop-filter: blur(10px) saturate(1.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.year-badge {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.25) 0%, rgba(255, 107, 53, 0.15) 100%);
    color: #ff6b35;
    border: 1px solid rgba(255, 107, 53, 0.4);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.2);
}

.year-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.3);
}

.rating-badge {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.25) 0%, rgba(255, 215, 0, 0.15) 100%);
    color: #ffd700;
    border: 1px solid rgba(255, 215, 0, 0.4);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.2);
}

.rating-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.3);
}

.genre-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.genre-tag {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.06) 100%);
    color: #e0e0e0;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px) saturate(1.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.genre-tag::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s ease;
}

.genre-tag:hover::before {
    left: 100%;
}

.genre-tag:hover {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.2) 0%, rgba(255, 107, 53, 0.1) 100%);
    border-color: rgba(255, 107, 53, 0.3);
    color: #ff6b35;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 107, 53, 0.2);
}

.description {
    color: #d0d0d0;
    line-height: 1.7;
    margin-bottom: 2.5rem;
    font-size: 1.05rem;
    font-weight: 400;
    text-align: justify;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.02) 0%, rgba(255, 255, 255, 0.01) 100%);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.action-buttons {
    display: flex;
    gap: 1rem;
}

.episodes-list-sidebar {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    max-height: 650px;
    overflow-y: auto;
    backdrop-filter: blur(15px) saturate(1.2);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 8px 16px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    /* Firefox scrollbar styling */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 107, 53, 0.6) rgba(255, 255, 255, 0.08);
}

.episodes-list-sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 107, 53, 0.5) 25%, 
        rgba(255, 107, 53, 0.7) 50%, 
        rgba(255, 107, 53, 0.5) 75%, 
        transparent 100%);
    z-index: 1;
}

.episodes-list-sidebar::-webkit-scrollbar {
    width: 8px;
}

.episodes-list-sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    margin: 4px;
}

.episodes-list-sidebar::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.6) 0%, rgba(255, 107, 53, 0.4) 100%);
    border-radius: 4px;
    border: 1px solid rgba(255, 107, 53, 0.2);
    transition: all 0.3s ease;
}

.episodes-list-sidebar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.8) 0%, rgba(255, 107, 53, 0.6) 100%);
    border-color: rgba(255, 107, 53, 0.4);
    transform: scaleX(1.2);
}

.episodes-list-sidebar::-webkit-scrollbar-thumb:active {
    background: linear-gradient(135deg, rgba(255, 107, 53, 1) 0%, rgba(255, 107, 53, 0.8) 100%);
}

.media-info {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(15px) saturate(1.2);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 8px 16px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
    margin-top: 2rem;
}

.media-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 107, 53, 0.5) 25%, 
        rgba(255, 107, 53, 0.7) 50%, 
        rgba(255, 107, 53, 0.5) 75%, 
        transparent 100%);
    z-index: 1;
}

.episodes-list-sidebar h3 {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    color: white;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, #ffffff 0%, #e0e0e0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    z-index: 2;
}

.media-info h3 {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    color: white;
    font-weight: 600;
    background: linear-gradient(135deg, #ffffff 0%, #e0e0e0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    z-index: 2;
}

.info-item {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.info-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.info-item .label {
    display: block;
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.info-item .value {
    color: white;
    font-weight: 600;
}

.genre-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.genre-pill {
    background: rgba(255, 107, 53, 0.2);
    color: #ff6b35;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    border: 1px solid rgba(255, 107, 53, 0.3);
}

.episodes-section h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.episodes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.episodes-list-sidebar .episodes-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    margin-top: 0;
}

.episodes-list-sidebar .episode-button {
    padding: 0.8rem;
    font-size: 0.9rem;
    flex-direction: row;
    justify-content: flex-start;
    text-align: left;
}

.episodes-list-sidebar .episode-number {
    font-size: 1rem;
    margin-right: 0.5rem;
    min-width: 2rem;
}

.episodes-list-sidebar .episode-title {
    font-size: 0.85rem;
    color: #ccc;
}

.episode-button {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.episode-number {
    font-size: 1.2rem;
    font-weight: 700;
    color: #ff6b35;
}

.episode-title {
    font-size: 0.9rem;
    color: #ccc;
}

.episode-button:hover {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.3);
}

/* Latest Episode Section */
.latest-episode-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.latest-episode-title {
    color: #ff6b35;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
}

.latest-episode-title::before {
    content: "🆕";
    margin-right: 8px;
}

.latest-episode-button.btn-primary {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    position: relative;
}

.latest-episode-button {
    display: inline-block;
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    padding: 8px 16px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: all 0.3s ease;
}

.latest-episode-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

.latest-episode-section {
    text-align: center; /* Center the button */
    margin-bottom: 1.5rem; /* Add some space below */
}

.latest-episode-number {
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    text-align: center;
}

/* Episodes List Section */
.episodes-section {
    margin-top: 20px;
}

.episodes-title {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
}

.episodes-title::before {
    content: "📺";
    margin-right: 8px;
}

.episodes-container {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 8px;
}

.episodes-container::-webkit-scrollbar {
    width: 6px;
}

.episodes-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.episodes-container::-webkit-scrollbar-thumb {
    background: rgba(255, 107, 53, 0.6);
    border-radius: 3px;
}

.episodes-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 107, 53, 0.8);
}

.episode-list-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    margin-bottom: 6px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.episode-list-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-left-color: #ff6b35;
    transform: translateX(3px);
}

.episode-list-number {
    color: #ff6b35;
    font-weight: 600;
    margin-right: 12px;
    min-width: 24px;
}

.episode-list-title {
    color: #fff;
    font-weight: 400;
    flex: 1;
}

/* Player Section */
.player-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.player-info h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.server-label {
    color: #888;
    font-weight: 500;
}

.server-buttons {
    display: flex;
    gap: 0.5rem;
}

.server-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.server-btn.active,
.server-btn:hover {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    border-color: #ff6b35;
}

.player-container {
    width: 100%;
    height: 70vh;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.player-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.player-features {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #ccc;
    font-size: 0.9rem;
}

.feature-item i {
    color: #ff6b35;
}

/* Pagination */
.pagination {
    text-align: center;
    margin-top: 3rem;
}

.load-more-button {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    border: none;
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.load-more-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 107, 53, 0.3);
}

.load-more-button:disabled {
    background: #555;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(0px);
}

.modal.show {
    opacity: 1;
    visibility: visible;
    backdrop-filter: blur(8px);
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    animation: fadeInOverlay 0.4s ease-out;
}

@keyframes fadeInOverlay {
    from {
        background: rgba(0, 0, 0, 0);
        backdrop-filter: blur(0px);
    }
    to {
        background: rgba(0, 0, 0, 0.8);
        backdrop-filter: blur(8px);
    }
}

.modal-content {
    position: relative;
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    border-radius: 16px;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: scale(0.8) translateY(50px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}

.modal.show .modal-content {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #ff6b35;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-close {
    background: transparent;
    border: none;
    color: #ccc;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ff6b35;
    transform: rotate(90deg);
}

.modal-body {
    padding: 2rem;
    max-height: calc(90vh - 120px);
    overflow-y: auto;
}

.modal-body .section-subtitle {
    margin-bottom: 1.5rem;
    color: #888;
    font-size: 0.9rem;
}

.modal-body .anime-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.modal-body .anime-card img {
    width: 100% !important;
    height: 286px !important;
    object-fit: cover !important;
    display: block;
    border-radius: 12px;
}

/* Player Modal Styles */
.player-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.player-modal.show {
    opacity: 1;
    visibility: visible;
}

.player-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.95) 100%);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
}

.player-modal-content {
    position: relative;
    background: linear-gradient(145deg, #0f0f0f 0%, #1a1a1a 50%, #0a0a0a 100%);
    border-radius: 16px;
    width: 70%;
    max-width: 900px;
    height: 80vh;
    overflow: hidden;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.8),
        0 10px 20px rgba(0, 0, 0, 0.6);
    border-left: 2px solid rgba(255, 107, 53, 0.3);
    border-right: 2px solid rgba(255, 107, 53, 0.3);
    border-bottom: 2px solid rgba(255, 107, 53, 0.3);
    border-top: none;
    transform: scale(0.9) translateY(40px) rotateX(3deg);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px);
    position: relative;
}

.player-modal.show .player-modal-content {
    transform: scale(1) translateY(0) rotateX(0deg);
    opacity: 1;
}

/* Theater Mode Styles */
.player-modal-content.theater-mode {
    width: 98vw !important;
    height: 98vh !important;
    max-width: none !important;
    border-radius: 8px !important;
    transform: scale(1) translateY(0) rotateX(0deg) !important;
}

.player-modal-content.theater-mode .player-modal-body {
    padding: 1.5rem !important;
}

.player-modal-content.theater-mode .player-container {
    min-height: 85vh !important;
    border-radius: 8px !important;
}

.player-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2rem 2.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
    backdrop-filter: blur(30px) saturate(1.5);
    position: relative;
    z-index: 2;
}

.player-modal-header::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 2.5rem;
    right: 2.5rem;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 107, 53, 0.3), transparent);
}

.player-modal-info h3 {
    font-size: 1.6rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ff6b35 0%, #ff8c42 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.3rem;
    text-shadow: 0 2px 10px rgba(255, 107, 53, 0.3);
}

.player-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.anime-title {
    color: #ccc;
    font-size: 0.9rem;
    font-weight: 500;
}

.episode-info {
    color: #888;
    font-size: 0.8rem;
    padding: 0.2rem 0.8rem;
    background: rgba(255, 107, 53, 0.2);
    border-radius: 12px;
    border: 1px solid rgba(255, 107, 53, 0.3);
}

.player-modal-controls {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.player-control-btn,
.player-modal-close {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.06) 100%);
    border: none;
    color: #e0e0e0;
    width: 48px;
    height: 48px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    backdrop-filter: blur(20px) saturate(1.2);
    border: 1px solid rgba(255, 255, 255, 0.15);
    position: relative;
    overflow: hidden;
}

.player-control-btn::before,
.player-modal-close::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s ease;
}

.player-control-btn:hover::before,
.player-modal-close:hover::before {
    left: 100%;
}

.player-control-btn:hover,
.player-modal-close:hover {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.25) 0%, rgba(255, 107, 53, 0.15) 100%);
    color: #ff6b35;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 
        0 12px 30px rgba(255, 107, 53, 0.4),
        0 4px 15px rgba(255, 107, 53, 0.2);
    border-color: rgba(255, 107, 53, 0.6);
}

.player-modal-close:hover {
    background: linear-gradient(135deg, rgba(255, 77, 77, 0.25) 0%, rgba(255, 77, 77, 0.15) 100%);
    color: #ff4d4d;
    border-color: rgba(255, 77, 77, 0.6);
    box-shadow: 
        0 12px 30px rgba(255, 77, 77, 0.4),
        0 4px 15px rgba(255, 77, 77, 0.2);
}

.player-control-btn:active,
.player-modal-close:active {
    transform: translateY(-1px) scale(0.98);
    transition: all 0.1s ease;
}

.player-modal-body {
    flex: 1;
    display: flex;
    gap: 2rem;
    padding: 2rem 2.5rem;
    overflow: hidden;
    min-height: 0;
    height: 100%;
}

.player-container {
    flex: 1;
    background: linear-gradient(145deg, #000000 0%, #0a0a0a 100%);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    min-height: 400px;
    height: 100%;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.8),
        0 10px 25px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
}

.player-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 107, 53, 0.6) 25%, 
        rgba(255, 107, 53, 0.8) 50%, 
        rgba(255, 107, 53, 0.6) 75%, 
        transparent 100%);
    z-index: 1;
}

.player-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 20px;
}

.player-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #ff6b35;
    font-size: 1.3rem;
    z-index: 2;
    padding: 2rem;
    border-radius: 20px;
    background: radial-gradient(circle, rgba(255, 107, 53, 0.1) 0%, transparent 70%);
    backdrop-filter: blur(10px);
    animation: loadingContainer 3s ease-in-out infinite;
}

@keyframes loadingContainer {
    0%, 100% { 
        background: radial-gradient(circle, rgba(255, 107, 53, 0.1) 0%, transparent 70%);
        transform: translate(-50%, -50%) scale(1);
    }
    50% { 
        background: radial-gradient(circle, rgba(255, 107, 53, 0.2) 0%, transparent 80%);
        transform: translate(-50%, -50%) scale(1.02);
    }
}

.player-loading i {
    font-size: 5rem;
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
    animation: advancedPulse 2.5s ease-in-out infinite, rotateGlow 4s linear infinite;
    background: linear-gradient(45deg, #ff6b35 0%, #ff8c42 25%, #ffb347 50%, #ff8c42 75%, #ff6b35 100%);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 6px 20px rgba(255, 107, 53, 0.6));
}

.player-loading i::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: conic-gradient(from 0deg, transparent, rgba(255, 107, 53, 0.3), transparent);
    border-radius: 50%;
    animation: spinHalo 3s linear infinite;
    z-index: -1;
}

.player-loading i::after {
    content: '✨';
    position: absolute;
    top: -20px;
    right: -15px;
    font-size: 1rem;
    animation: twinkle 2s ease-in-out infinite;
    filter: none;
    background: none;
    -webkit-text-fill-color: #ff6b35;
}

@keyframes advancedPulse {
    0%, 100% {
        transform: scale(1) rotateY(0deg);
        filter: drop-shadow(0 6px 20px rgba(255, 107, 53, 0.6));
    }
    25% {
        transform: scale(1.1) rotateY(90deg);
        filter: drop-shadow(0 8px 25px rgba(255, 107, 53, 0.8));
    }
    50% {
        transform: scale(1.15) rotateY(180deg);
        filter: drop-shadow(0 10px 30px rgba(255, 107, 53, 1));
    }
    75% {
        transform: scale(1.1) rotateY(270deg);
        filter: drop-shadow(0 8px 25px rgba(255, 107, 53, 0.8));
    }
}

@keyframes rotateGlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes spinHalo {
    to { transform: rotate(360deg); }
}

@keyframes twinkle {
    0%, 100% { opacity: 0.4; transform: scale(0.8) rotate(0deg); }
    50% { opacity: 1; transform: scale(1.2) rotate(180deg); }
}

.player-loading span {
    display: block;
    font-weight: 600;
    letter-spacing: 0.5px;
    background: linear-gradient(90deg, #ffffff 0%, #ff6b35 25%, #ffffff 50%, #ff8c42 75%, #ffffff 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmerText 3s ease-in-out infinite, typeWriter 4s ease-in-out infinite;
    position: relative;
}

.player-loading span::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #ff6b35, transparent);
    animation: expandLine 2s ease-in-out infinite;
    transform: translateX(-50%);
}

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

@keyframes expandLine {
    0%, 100% { width: 0; opacity: 0; }
    50% { width: 80%; opacity: 1; }
}

@keyframes typeWriter {
    0%, 90%, 100% { transform: translateY(0); }
    5% { transform: translateY(-2px); }
    10% { transform: translateY(0); }
}

@keyframes modernPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.player-sidebar {
    width: 320px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    overflow-y: auto;
}

.server-selection,
.episode-navigation {
    margin-bottom: 2rem;
}

.server-selection h4,
.episode-navigation h4 {
    color: #ff6b35;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.server-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.server-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ccc;
    padding: 0.7rem 1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.server-btn.active,
.server-btn:hover {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    border-color: #ff6b35;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 107, 53, 0.4);
}

.episode-list {
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.episode-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.episode-item:hover {
    background: rgba(255, 107, 53, 0.2);
    border-color: rgba(255, 107, 53, 0.5);
    transform: translateX(5px) scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.episode-item.active {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.2), rgba(247, 147, 30, 0.2));
    border-color: #ff6b35;
}

.episode-item .episode-number {
    font-weight: 700;
    color: #ff6b35;
    font-size: 1rem;
    margin-bottom: 0.2rem;
}

.episode-item .episode-title {
    color: #ccc;
    font-size: 0.85rem;
    line-height: 1.3;
}

/* Theater Mode */
.player-modal.theater-mode .player-modal-content {
    width: 100%;
    height: 100%;
    border-radius: 0;
    max-width: none;
}

.player-modal.theater-mode .player-sidebar {
    display: none;
}

/* Modern Responsive Design */
@media (max-width: 1200px) {
    .player-modal-content {
        width: 75%;
        height: 82vh;
        max-width: 800px;
    }
    
    .player-modal-header {
        padding: 1.8rem 2rem;
    }
    
    .player-modal-body {
        padding: 1.8rem 2rem;
        gap: 1.5rem;
    }
}

@media (max-width: 1024px) {
    .player-modal-content {
        width: 85%;
        height: 85vh;
        max-width: 700px;
    }
    
    .player-modal-body {
        flex-direction: column;
    }
    
    .player-sidebar {
        width: 100%;
        height: 200px;
        border-radius: 16px;
        backdrop-filter: blur(20px) saturate(1.2);
    }
    
    .episode-list {
        max-height: 120px;
    }
    
    .player-modal-controls {
        gap: 0.5rem;
    }
    
    .player-control-btn,
    .player-modal-close {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) {
    .player-modal-content {
        width: 92%;
        height: 88vh;
        border-radius: 16px;
        max-width: none;
    }
    
    .player-modal.show .player-modal-content {
        transform: scale(1) translateY(0) rotateX(0deg);
    }
    
    .player-modal-header {
        padding: 1.5rem 1.5rem;
    }
    
    .player-modal-header::before {
        left: 1.5rem;
        right: 1.5rem;
    }
    
    .player-modal-info h3 {
        font-size: 1.3rem;
    }
    
    .player-modal-body {
        padding: 1.5rem;
        gap: 1rem;
    }
    
    .player-control-btn,
    .player-modal-close {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }
    
    .player-container {
        border-radius: 16px;
        min-height: 300px;
    }
}

@media (max-width: 480px) {
    .player-modal-header {
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .player-modal-controls {
        align-self: flex-end;
    }
    
    .player-modal-info h3 {
        font-size: 1.1rem;
        margin-bottom: 0;
    }
    
    .player-modal-body {
        padding: 1rem;
    }
    
    .player-container {
        min-height: 250px;
    }
    
    .player-control-btn,
    .player-modal-close {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .player-loading i {
        font-size: 3rem;
    }
    
    .player-loading {
        font-size: 1.1rem;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .player-control-btn,
    .player-modal-close {
        min-height: 48px;
        min-width: 48px;
    }
    
    .episode-item {
        padding: 1rem;
        min-height: 48px;
    }
    
    .server-btn {
        min-height: 44px;
        padding: 0.8rem 1.2rem;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.loading,
.error {
    text-align: center;
    padding: 3rem;
    font-size: 1.2rem;
}

.loading {
    color: #ff6b35;
}

.error {
    color: #ff4757;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-menu {
        order: 3;
    }
    
    .search-container {
        order: 2;
    }
    
    #searchInput {
        width: 250px;
    }
    
    .details-section {
        padding: 1.5rem;
        margin: 1rem;
        border-radius: 20px;
    }
    
    .details-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .details-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 1.5rem;
        gap: 2rem;
    }
    
    .details-content img {
        width: 160px;
        height: 229px;
    }
    
    .anime-info h1 {
        font-size: 2.2rem;
        text-align: center;
    }
    
    .anime-meta {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .genre-tags {
        justify-content: center;
    }
    
    .description {
        text-align: left;
        padding: 1.2rem;
    }
    
    .episodes-list-sidebar,
    .media-info {
        padding: 1.5rem;
        margin-top: 1rem;
    }
    
    .anime-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
    

    

    

    

    
    .episodes-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .player-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .player-container {
        height: 50vh;
    }
    
    .action-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
    .details-section {
        padding: 1rem;
        margin: 0.5rem;
        border-radius: 16px;
    }
    
    .back-btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }
    
    .details-content {
        padding: 1rem;
        gap: 1.5rem;
    }
    
    .details-content img {
        width: 140px;
        height: 200px;
    }
    
    .anime-info h1 {
        font-size: 1.8rem;
        margin-bottom: 1rem;
    }
    
    .year-badge, .rating-badge {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .genre-tag {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .description {
        font-size: 0.95rem;
        padding: 1rem;
    }
    
    .episodes-list-sidebar {
        padding: 1rem;
        border-radius: 16px;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .media-info {
        padding: 1rem;
        border-radius: 16px;
    }
    
    .episodes-list-sidebar h3 {
        text-align: center;
    }

    .episodes-list-sidebar h3,
    .media-info h3 {
        font-size: 1.1rem;
        margin-bottom: 1.5rem;
    }
    
    .anime-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
    
    .anime-card img {
        width: 100% !important;
        height: 200px !important;
        object-fit: cover !important;
    }
    
    .modal-body .anime-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
    
    .modal-body .anime-card img {
        width: 100% !important;
        height: 200px !important;
        object-fit: cover !important;
    }
    
    /* Universal mobile rule */
    .anime-grid .anime-card img,
    .anime-card img[src*="myanimelist"],
    .anime-card img[src*="cdn"] {
        width: 100% !important;
        height: 200px !important;
        object-fit: cover !important;
    }
}

/* Tablet Landscape */
@media (min-width: 769px) and (max-width: 1024px) {
    .details-section {
        padding: 1.8rem;
    }
    
    .details-container {
        grid-template-columns: 1fr 280px;
        gap: 2.5rem;
    }
    
    .details-content {
        gap: 2rem;
        padding: 1.8rem;
    }
    
    .anime-info h1 {
        font-size: 2.4rem;
    }
    
    .episodes-list-sidebar,
    .media-info {
        padding: 1.8rem;
    }
}

/* Additional utility styles */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.page-button {
    padding: 0.5rem 1rem;
    margin: 0 0.2rem;
    border-radius: 5px;
    border: 1px solid #333;
    background-color: #222;
    color: #fff;
    cursor: pointer;
}

.page-button.active {
    background-color: #e50914;
}

/* FINAL CATCH-ALL RULE - Ensures ALL anime poster images are standardized */
/* This rule has maximum specificity and will override any conflicting styles */
body .anime-card img,
body #trending-anime-grid .anime-card img,
body #new-anime-grid .anime-card img,
body #search-grid .anime-card img,
body .modal-body .anime-grid .anime-card img,
body .anime-grid .anime-card img {
    width: 100% !important;
    height: 286px !important;
    object-fit: cover !important;
    display: block !important;
    border-radius: 12px !important;
    max-width: none !important;
    max-height: none !important;
    min-width: auto !important;
    min-height: auto !important;
}

/* Responsive catch-all rules */
@media (max-width: 768px) {
    body .anime-card img,
    body #trending-anime-grid .anime-card img,
    body #new-anime-grid .anime-card img,
    body #search-grid .anime-card img,
    body .modal-body .anime-grid .anime-card img,
    body .anime-grid .anime-card img {
        height: 229px !important;
    }
}

@media (max-width: 480px) {
    body .anime-card img,
    body #trending-anime-grid .anime-card img,
    body #new-anime-grid .anime-card img,
    body #search-grid .anime-card img,
    body .modal-body .anime-grid .anime-card img,
    body .anime-grid .anime-card img {
        height: 200px !important;
    }
}

/* Trailer Modal Styles */
.trailer-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.trailer-modal.show {
    opacity: 1;
    visibility: visible;
}

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

.trailer-modal-content {
    position: relative;
    width: 90%;
    max-width: 1000px;
    height: 80%;
    max-height: 600px;
    background: var(--card-bg);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.trailer-modal.show .trailer-modal-content {
    transform: scale(1);
}

.trailer-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.trailer-modal-header h3 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
}

.trailer-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.trailer-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.trailer-modal-body {
    height: calc(100% - 80px);
    padding: 0;
}

#trailer-container {
    width: 100%;
    height: 100%;
    position: relative;
}

#trailer-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Responsive trailer modal */
@media (max-width: 768px) {
    .trailer-modal-content {
        width: 95%;
        height: 70%;
        max-height: 400px;
    }
    
    .trailer-modal-header {
        padding: 1rem 1.5rem;
    }
    
    .trailer-modal-header h3 {
        font-size: 1.2rem;
    }
    
    .trailer-modal-close {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .trailer-modal-content {
        width: 98%;
        height: 60%;
        max-height: 350px;
    }
    
    .trailer-modal-header {
        padding: 0.8rem 1rem;
    }
    
    .trailer-modal-header h3 {
        font-size: 1.1rem;
    }
}

/* --- Enhanced Mobile & Tablet Responsiveness --- */

/* General improvements for smaller screens */
@media (max-width: 768px) {
    body {
        -webkit-text-size-adjust: 100%; /* Prevent font scaling in landscape mode */
    }

    .container {
        padding-left: 15px;
        padding-right: 15px;
    }

    h1, .h1 {
        font-size: 2.2rem;
    }

    h2, .h2 {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }

    h1, .h1 {
        font-size: 1.8rem;
    }

    h2, .h2 {
        font-size: 1.5rem;
    }
}

/* --- Touch-Friendly Controls --- */
@media (hover: none) and (pointer: coarse) {
    .button, button, [role="button"], .search-suggestion-tag, .episode-item {
        min-height: 44px; 
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .modal-close, .player-modal-close {
        transform: scale(1.2);
    }
}

/* --- Responsive Grids --- */
.anime-grid, #search-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

@media (max-width: 480px) {
    .anime-grid, #search-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
}

/* --- Player and Modal Enhancements --- */
@media (max-width: 768px) {
    #player-modal .modal-content {
        width: 95%;
        height: auto;
        max-height: 90vh;
    }

    #player-container {
        height: 50vw; 
    }

    .search-container {
        width: 60%; /* Allow search to take more space on tablets */
    }

    #details-content {
        flex-direction: column;
        align-items: center;
    }

    .details-info {
        padding-left: 0;
        padding-top: 20px;
        text-align: center;
    }
}

/* --- Mobile Banner Enhancements --- */
@media (max-width: 768px) {
    .banner-title {
        font-size: 2.0rem; /* Final reduction for tablets */
    }

    .banner-description {
        display: none; /* Hide description on mobile views */
    }

    .btn-primary.banner-watch-btn {
        padding: 8px 18px; /* Final reduction */
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .banner-content {
        padding: 10px; /* Final padding reduction */
        justify-content: center; /* Center content on mobile */
    }

    .banner-info {
        display: flex; /* Use flexbox for robust centering */
        flex-direction: column; /* Stack items vertically */
        align-items: center; /* Center items horizontally */
        text-align: center; /* Ensure text within items is centered */
        background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%); /* Add gradient for readability */
        padding: 10px; /* Final padding reduction */
        border-radius: 8px;
    }

    .banner-title {
        font-size: 1.4rem; /* Final title reduction */
        margin-bottom: 5px;
    }

    .banner-description {
        display: none; /* Hide description on very small screens to save space */
    }

    .banner-meta {
        margin-bottom: 10px;
    }

    .banner-meta span {
        font-size: 0.7rem; /* Final meta text reduction */
    }

    .banner-year {
        font-size: 0.7rem; /* Final font size reduction */
        font-weight: 400; /* Lighter weight */
        opacity: 0.7;
        background: none; /* Remove background on mobile for cleaner look */
        padding: 0;
        border: none;
    }

    .btn-primary.banner-watch-btn {
        padding: 5px 10px; /* Final button reduction */
        font-size: 0.75rem;
    }
}


/* --- Comprehensive Mobile & Smartphone Enhancements --- */

/* General layout adjustments for small screens */
@media (max-width: 480px) {
    body {
        padding: 0 10px; /* Reduce side padding on mobile */
    }

    .container {
        padding: 10px 0;
    }

    /* Make section titles smaller */
    h2 {
        font-size: 1.4rem;
    }

    /* Create a more compact 2-column grid for anime cards */
    .anime-grid {
        grid-template-columns: repeat(2, 1fr); /* Force 2 columns */
        gap: 15px; /* Reduce gap between cards */
    }

    /* Adjust anime card appearance for mobile */
    .anime-card {
        border-radius: 8px; /* Slightly smaller border radius */
    }

    .anime-card img {
        height: auto; /* Let height be determined by aspect ratio */
        aspect-ratio: 2 / 3; /* Maintain a consistent poster aspect ratio */
        border-radius: 8px;
    }

    /* Reduce font size for anime titles */
    .anime-card-title {
        font-size: 0.85rem; /* Smaller font for card titles */
        padding: 8px;
    }

    /* Adjust details modal for small screens */




    .details-info h3 {
        font-size: 1.5rem;
    }

    .details-info p {
        font-size: 0.9rem;
    }

    .episode-list {
        max-height: 200px; /* Shorter episode list on mobile */
    }
}

