/* --- Global Styles & Base Theme --- */
:root {
    --primary-color: #e50914; /* Vibrant Red for accents */
    --secondary-color: #ff1f3d; /* Slightly brighter red for hover glow */
    --text-color: #ffffff;
    --muted-text: #b0b0b0; /* Light gray for metadata */
    --font-stack: 'Poppins', 'Roboto', Arial, sans-serif;
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    background-color: transparent; /* Full transparent background */
    color: transparent;
    font-family: var(--font-stack);
    text-align: center;
    overflow-x: hidden;
    width: 100%;
    line-height: 1.6;
}

/* --- Header --- */
header {
    padding: 15px 30px; 
    background: linear-gradient(to right, black, darkred);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.7); 
    display: flex;
    justify-content: center; 
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    height: 60px; 
    width: auto;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-color);
    position: relative; 
    margin: 20px 0 10px 0; 
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0); 
    nav-left: 20px;
}

/* --- Content Grid --- */
.series-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
    gap: 30px; 
    padding: 30px 20px;
    max-width: 1400px;
    margin: auto;
}

/* --- Series Card --- */
.series-card {
    background-color: #0f0f0f; /* card transparent */
    border-radius: 12px; 
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.8); 
    transition: transform 0.3s ease, box-shadow 0.3s ease, border 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    text-align: left; 
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Hover Effect */
.series-card:hover {
    transform: translateY(-10px) scale(1.05); 
    box-shadow: 0 15px 40px rgba(229, 9, 20, 0.5),
                0 0 25px rgba(229, 9, 20, 0.4); 
    border: 1px solid var(--primary-color);
}

/* --- Card Image --- */
.series-card img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.series-card:hover img {
    transform: scale(1.08);
}

/* --- Card Details --- */
.series-details-container {
    background-color: transparent; /* details transparent */
    padding: 15px 12px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Title */ 
.series-title, 
.series-details-container p { 
    font-size: 0.95rem; 
    font-weight: 500; 
    color: var(--text-color); 
    margin: 0 0 6px 0; 
    display: -webkit-box; 
    -webkit-line-clamp: 1; /* 1 lines on desktop */
    -webkit-box-orient: vertical; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    white-space: normal; 
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

.series-card:hover .series-title {
    color: var(--primary-color);
    text-shadow: 0 0 10px rgba(229, 9, 20, 0.7);
}

/* Metadata */
.series-metadata {
    font-size: 0.9rem;
    color: var(--muted-text);
    font-weight: 400;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Rating Style */
.series-metadata .rating-value {
    color: #ffcc00; 
    font-weight: 700;
    text-shadow: none;
    font-size: 0.85em;
}

/* Year Style */
.series-metadata .year-value {
    color: #ffffff; 
    font-weight: 700;
    text-shadow: none;
    font-size: 0.85em;
}

/* --- Pagination --- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 40px 0;
    padding-bottom: 100px;
}

.pagination button {
    background: var(--primary-color);
    color: white;
    font-size: 14px;
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
    font-weight: 600;
}

.pagination button:disabled {
    background: #444;
    cursor: not-allowed;
    box-shadow: none;
}

.pagination button:hover:not(:disabled) {
    background: var(--secondary-color);
    box-shadow: 0 0 15px rgba(229, 9, 20, 0.6);
    transform: scale(1.05);
}

#page-number {
    font-size: 1.1em;
    font-weight: 500;
    color: #aaa;
}

/* --- Bottom Navigation --- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #111;
    display: flex;
    justify-content: center;
    gap: 100px;
    padding: 10px 0;
    border-top: 3px solid red;
    z-index: 1000;
}

.bottom-nav a {
    color: white;
    font-size: 18px;
    font-weight: bold;
    text-decoration: none;
    padding: 12px 24px;
    transition: color 0.3s ease;
    text-align: center;
}

.bottom-nav a:not(.active) {
    color: white;
}

.bottom-nav .active {
    color: red;
}

.bottom-nav a:hover {
    color: red;
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .series-container {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
}

@media (max-width: 600px) {
    .header-center {
        /* Allow the search bar to stack/break on mobile */
        order: 3; 
        padding: 10px 15px;
        width: 100%; 
    }
    
    .search-bar {
        height: 35px;
        width: 100%;
    }
    
    #search-input {
        font-size: 0.85rem;
    }

    .search-bar button {
        padding: 0 8px;
        font-size: 1rem;
    }

    .series-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
        padding: 10px;
    }

    .series-title {
        font-size: 0.9rem; 
        -webkit-line-clamp: 1; /* 1 line on mobile */
    }

    .series-details-container {
        padding: 10px 8px;
    }

    .series-metadata {
        font-size: 0.85rem; /* Slightly smaller base text for mobile */
        justify-content: center; /* Center items on mobile */
        gap: 8px; /* Add small space between rating and year/separator */
    }
    .series-metadata .rating-value {
        color: #ffcc00; 
        font-weight: 500;
        text-shadow: none;
        font-size: 0.75em;
    }
    
    .series-metadata .year-value {
        color: #ffffff; 
        font-weight: 500;
        text-shadow: none;
        font-size: 0.75em;
    }

    .pagination button {
        font-size: 14px;
        padding: 8px 12px;
    }

    .bottom-nav {
        width: 100%;
        gap: 15px;
        padding: 6px 0;
    }

    .bottom-nav a {
        font-size: 14px;
        padding: 6px 12px;
    }
}
