:root {
    --primary-color: #6c5ce7;
    --secondary-color: #2d3436;
    --accent-color: #fd79a8;
    --background-dark: #0f0c29;
    --background-gradient: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    --card-bg: rgba(30, 32, 64, 0.6);
    --card-hover-bg: rgba(44, 46, 88, 0.8);
    --text-color: #f8f9fa;
    --text-light: #adb5bd;
    --white: #ffffff;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    --transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    --border-radius: 16px;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

/* Base styles */
body {
    background: var(--background-gradient);
    color: var(--text-color);
    min-height: 100vh;
    background-attachment: fixed;
    line-height: 1.6;
}

/* General Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

header {
    background: rgba(15, 12, 41, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: white;
    padding: 1.5rem 0;
    margin-bottom: 2rem;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

header h1 {
    font-size: 2rem;
    margin: 0;
}

.theme-toggle {
    background: none;
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    background-color: rgba(255, 255, 255, 0.1);
}

.theme-toggle:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.0);
}

.theme-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.series-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
    padding: 1rem 0;
}

.mobile-ad-banner {
    display: none;
    justify-content: center;
    align-items: center;
    padding: 0.75rem 0;
    margin: 0 auto;
    max-width: 100%;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 1200;
    background: transparent;
    backdrop-filter: none;
    border-bottom: 1px solid transparent;
    box-shadow: none;
    transition: background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.mobile-ad-banner .adsterra-slot {
    display: inline-block;
    max-width: 100%;
}

.mobile-ad-banner.is-sticky {
    background: rgba(15, 12, 41, 0.45);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.35);
}

.desktop-ad-banner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.5rem 0 1rem;
    margin: 0 auto;
    max-width: 100%;
    position: sticky;
    top: 0;
    z-index: 1100;
    background: transparent;
    backdrop-filter: none;
    border-bottom: 1px solid transparent;
    box-shadow: none;
    transition: background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.desktop-ad-banner .adsterra-slot {
    display: inline-block;
}

.desktop-ad-banner.is-sticky {
    background: rgba(15, 12, 41, 0.35);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.series-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    border: var(--glass-border);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transform: translateZ(0);
    will-change: transform, box-shadow;
}

.series-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    background: var(--card-hover-bg);
    border-color: rgba(255, 255, 255, 0.15);
    z-index: 2;
}

.series-card .thumbnail-container {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
    border-radius: 8px;
}

.series-card img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.0);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
    backface-visibility: hidden;
    transform-style: preserve-3d;
    border-radius: 8px;
}

.series-card:hover img {
    transform: scale(1.03);
}

.series-info {
    padding: 1.25rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.series-info h2 {
    font-size: 1.1rem;
    margin: 0 0 0.5rem 0;
}

/* Removed duplicate .thumbnail-container rules */

.thumbnail-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.5) 30%, rgba(0, 0, 0, 0.3) 60%, rgba(0, 0, 0, 0.7) 100%);
    z-index: 1;
    opacity: 1;
    pointer-events: none;
    border-radius: 8px;
    transition: opacity 0.3s ease;
}

.thumbnail-container .description-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem 1.5rem 1.5rem;
    color: var(--text-color);
    z-index: 2;
    opacity: 1;
    transform: translate3d(0, 0, 0);
    pointer-events: none;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7) 30%, rgba(0, 0, 0, 0.9) 80%);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, padding, background;
}

.thumbnail-container .description-overlay h2 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
    line-height: 1.3;
    transition: transform 0.3s ease;
    transform-origin: left bottom;
}

.thumbnail-container .description-overlay p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateZ(0);
    max-height: 4.5em; /* 3 lines * 1.5 line-height */
    position: relative;
}

.series-card:hover .description-overlay p {
    -webkit-line-clamp: unset;
    -ms-line-clamp: unset;
    line-clamp: unset;
    max-height: 500px; /* Arbitrarily large value to accommodate all content */
}

/* Hover effects for better interactivity */
.series-card:hover .thumbnail-container::before {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.8) 40%, rgba(0, 0, 0, 0.6) 70%, rgba(0, 0, 0, 0.4) 100%);
    opacity: 0.95;
}

.thumbnail-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.series-card:hover .thumbnail-container img {
    transform: scale(1.03);
}

.series-info {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.series-info h2 {
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
    color: var(--text-color);
    transition: var(--transition);
}

.series-info p {
    color: var(--text-light);
    font-size: 0.95rem;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-clamp: 3;
    margin-bottom: 1rem;
    flex-grow: 1;
    transition: all 0.3s ease;
}

/* Collapsible styles */
.series-card.collapsed .series-info p {
    -webkit-line-clamp: 3;
    line-clamp: 3;
    max-height: 4.5em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
}

.series-card:not(.collapsed) .series-info p {
    -webkit-line-clamp: unset;
    line-clamp: unset;
    max-height: none;
    display: block;
}

.read-more-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.25rem 0;
    text-align: left;
    margin-top: 0.5rem;
    display: inline-flex;
    align-items: center;
    transition: color 0.2s ease;
}

.read-more-btn:hover {
    color: var(--accent-color);
}

.read-more-btn .icon {
    margin-left: 0.25rem;
    transition: transform 0.3s ease;
}

.series-card:not(.collapsed) .read-more-btn .icon {
    transform: rotate(180deg);
}

.series-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #eee;
    font-size: 0.9rem;
    color: var(--text-light);
}

/* ===== Loading State ===== */
.loading {
text-align: center;
padding: 4rem 2rem;
color: var(--text-light);
font-size: 1.1rem;
position: relative;
}

.loading:after {
content: '';
display: inline-block;
width: 20px;
height: 20px;
border: 3px solid var(--text-light);
border-radius: 50%;
border-top-color: transparent;
animation: spin 0.8s linear infinite;
margin-left: 10px;
vertical-align: middle;
    display: inline-block;
    animation: ellipsis 1.5s infinite;
}

@keyframes ellipsis {
    0% { content: '.'; }
    33% { content: '..'; }
    66% { content: '...'; }
}

/* Remove footer styles */

/* ===== Responsive Design ===== */
@media (max-width: 1024px) {
    .series-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem;
    }
    
    .thumbnail-container {
        height: 320px;
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 2.2rem;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero p {
        font-size: 1.1rem;
    }
    
    .series-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 1.25rem;
    }
    
    .thumbnail-container {
        height: 280px;
    }

    .mobile-ad-banner {
        display: flex;
    }

    .desktop-ad-banner {
        display: none;
    }
}

/* Mobile-specific styles */
@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .series-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin: 0 auto;
    }
    
    .thumbnail-container {
        height: 400px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-section h3::after {
        left: 50%;
        transform: translateX(-50%);
    }
}
