:root {
    --color-titles: #fff;
    --color-primary: #43a6df;
    --color-secondary: #0076a9;
    --color-accent: #000;
    --color-links: #005487;
    --color-extra: #dedede;
    --color-extratext: #8d8c8c;
    --color-shadow: #8ac9f0
}

.wiki-main {
    display: block;
}

/******* WikiAnime Container ******/

.wikianime-list {
    list-style-type: none;
    padding: 0;
    direction: rtl
}

.wikianime-item {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.wikianime-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #dedede
}

.wikianime-item:last-child {
    border-bottom: none
}

.wikianime-img {
    margin-left: 10px;
    margin-right: 10px;
    width: 160px;
    height: 106px
}

.wikianime-img-link :hover {
    opacity: 0.8;
}

.wikianime-content {
    flex: 1
}

.wikianime-info {
    margin: 12px 0 0
}

.wikianime-time-posted {
    color: var(--color-extratext);
    font-size: 14px
}

.wikianime-title {
    color: #000;
    font-weight: 700;
    font-size: 18px;
    transition: color 0.5s ease
}

.wikianime-title:hover {
    color: var(--color-primary);
}






/*********************************************************************************/

/******* Seasonal anime Page ******/

/***** Seasonal Menu *****/

.section-title-sa {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.section-title-sa h3 {
    color: var(--color-accent);
}

.section-title-text-sa {
    background-color: var(--color-shadow);
    padding: 8px 12px 7px;
    border-bottom: solid;
    border-bottom-color: var(--color-secondary);
}

.manga-grid {
    margin-top: 10px;
}

@media (max-width: 768px) {
    .section-title-text-sa {
        font-size: 20px;
        padding: 6px 10px;
    }
}



/* Seasonal Anime Menu Container */
.seasonal-anime-menu {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin: 0 auto;
    transition: all 0.3s ease;
    /* Smooth transition */
    padding: 16px 20px;
    font-size: 16px;
    width: 97%;
}

.seasonal-anime-menu.shrunk {
    padding: 8px 12px;
    /* Reduce padding */
    font-size: 14px;
    /* Smaller text */
    background-color: #f9f9f9;
    /* Optional: subtle background change */
}

.sticky-sa {
    position: fixed;
    top: 0;
    z-index: 1000;
    width: 100%
}

.sticky-sa+main {
    padding-top: 81px
}

@media (max-width: 960px) {
    .sticky-sa {
        position: fixed;
        top: 0;
        width: 100%;
        background: #fff;
        z-index: 1000;
        height: 60px
    }

    .sticky-sa+main {
        padding-top: 60px
    }
}

/* Top Navigation Bar */
.top-nav {
    display: flex;
    flex-wrap: wrap;
    /* Allow wrapping for mobile */
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #eee;
    gap: 10px;
    width: 99%;
    /* Add gap between items */
}

/* Season Links */
.seasons {
    display: flex;
    flex-wrap: wrap;
    /* Allow wrapping for mobile */
    gap: 8px;
    /* Add gap between links */
}

.seasons a {
    text-decoration: none;
    color: #0056b3;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background-color 0.3s, color 0.3s;
}

.seasons a:hover {
    background: var(--color-primary);
    color: white;
}

.seasons a.active {
    background: var(--color-primary);
    color: white;
}

.custom-select-wrapper {
    display: none;
}

/* --- Dropdown Styling --- */

.custom-select-wrapper {
    width: 100%;
    max-width: 100%;
    position: relative;
    user-select: none;
}

.custom-select-trigger {
    padding: 12px 16px;
    font-size: 16px;
    font-weight: 500;
    background-color: #f8f8f8;
    border: 2px solid #43a6df;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    color: #333;
}

.custom-options {
    position: absolute;
    top: calc(100% + 4px);
    /* Opens downward */
    left: 0;
    right: 0;
    background-color: #fff;
    border-radius: 8px;
    padding: 0;
    margin: 0;
    list-style: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    z-index: 10;
}

/* Open state: show options and apply borders */
.custom-select-wrapper.open .custom-options {
    max-height: 300px;
    overflow-y: auto;
    border: 2px solid #43a6df
}

.custom-select-wrapper.open .custom-option {

    border-bottom: 1px solid #dedede
        /* Border only when dropdown is open */
}

.custom-option {
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.custom-option:hover {
    background-color: #eaf6fc;
    color: #1c84b8;
}

.custom-option.selected {
    background-color: #43a6df;
    color: #fff;
}

/* Arrow styling */
.custom-select-trigger::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 14px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #555;
    transform: translateY(-50%);
}

/* RTL support */
html[dir="rtl"] .custom-select-trigger::after {
    right: auto;
    left: 14px;
}


/* Additional Navigation Links */
.nav-links {
    display: flex;
    align-items: center;
    gap: 10px;
    /* Add gap between links */
}

.nav-links a {
    text-decoration: none;
    color: #0056b3;
    padding: 10px 12px;
    border-radius: 6px 6px 0px 0px;
    transition: background-color 0.3s, color 0.3s;
    border: 1px solid #eee;
}

.nav-links a:hover {
    background: var(--color-primary);
    color: white;
}

.manga {
    position: relative;
}

.new-badge {
    background: red;
    color: white;
    font-size: 10px;
    padding: 3px 6px;
    border-radius: 4px;
    position: absolute;
    top: -8px;
}

/* Jump To Section */
.jump-to {
    display: flex;
    align-items: center;
    gap: 8px;
    /* Add gap between elements */
}

.jump-to select,
.jump-to button {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    transition: background-color 0.3s, border-color 0.3s;
}

.jump-to select:hover,
.jump-to button:hover {
    border-color: #0056b3;
}

.jump-to button {
    background: var(--color-primary);
    color: white;
    cursor: pointer;
    border: none;
}

.jump-to button:hover {
    background: #1f5da2;
}

/* Filter Buttons */
.manga-filter-buttons,
.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    /* Allow wrapping for mobile */
    gap: 8px;
    /* Add gap between buttons */
    margin-top: 16px;
    border-bottom: 1px solid #dedede;
}

.manga-filter-buttons button,
.filter-buttons button {
    background: #e0e0e0;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
}

.manga-filter-buttons button:hover,
.filter-buttons button:hover {
    background: var(--color-primary);
    color: white;
}

.manga-filter-buttons .active,
.filter-buttons .active {
    background: var(--color-primary);
    color: white;
}

/* Filters Section */
.filters {
    margin-top: 16px;
    font-size: 14px;
    display: flex;
    flex-wrap: wrap;
    /* Allow wrapping for mobile */
    gap: 12px;
    /* Add gap between items */
    color: #555;
}

.filters span {
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    transition: background-color 0.3s, color 0.3s;
}

.filters span:hover {
    background: #f0f0f0;
}

.filters .disabled {
    color: red;
    cursor: not-allowed;
}

@media (max-width: 1180px) {



    /* Hide Regular Navigation Links */
    .jump-to {
        display: none;
    }
}

/* Mobile View */
@media (max-width: 960px) {

    /* Hide Regular Navigation Links */
    .filters,
    .filter-buttons,
    .jump-to,
    .seasons,
    .nav-links {
        display: none;
    }

    .custom-select-wrapper {
        display: block;
    }

    /* Adjust Jump To Section */
    .jump-to {
        width: 100%;
        margin-top: 10px;
    }

    .jump-to select,
    .jump-to button {
        width: 100%;
    }

    /* Adjust Filter Buttons */
    .filter-buttons {
        flex-direction: column;
    }

    .filter-buttons button {
        width: 100%;
    }

    /* Adjust Filters Section */
    .filters {
        flex-direction: column;
    }
}


/***** Anime Grid *****/

.grid__container {
    display: flex;
    justify-content: center;
    flex-direction: row;
    flex-wrap: wrap;
}

.grid-title-sa {
    text-align: center;
    position: relative;
    width: 97%
}

.grid-title-text-sa {
    background-color: var(--color-primary);
    padding: 8px 12px 7px;
    font-size: 2rem;
}

@media (max-width: 768px) {
    .grid-title-text-sa {
        font-size: 2rem;
        padding: 6px 10px;
    }
}

/* General Styles */


.anime-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 97%;
}

.card-body {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    width: calc(100% + 32px);
    /* Adjust for parent padding */
    margin-left: -16px;
    /* Offset parent padding */
    margin-right: -16px;
    /* Offset parent padding */
    padding: 0px 5px;

}

.anime-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
    padding: 16px;
    width: 100%;
    min-width: 250px;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-header {
    height: 100px;
    /* Set a fixed height for the header */
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Center content vertically */
    align-items: center;
    /* Center content horizontally */
    text-align: center;
    /* Ensure text is centered */
    overflow: hidden;
    /* Hide overflow */
}

.title {
    color: var(--color-primary);
    font-size: 18px;
    font-weight: bold;
    white-space: normal;
    /* Allows wrapping */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    /* Wraps to 2 lines max */
    -webkit-box-orient: vertical;
    word-break: break-word;
    /* Ensures long words break properly */
}

.subtitle {
    font-size: 14px;
    color: gray;
    white-space: normal;
    /* Allows wrapping */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    /* Wraps to 2 lines max */
    -webkit-box-orient: vertical;
    word-break: break-word;
    /* Ensures long words break properly */
}

.release-info {
    background: #f8f8f8;
    padding: 8px 6px;
    font-size: 12px;
    color: gray;
    display: flex;
    justify-content: center;
    align-items: center;
    width: calc(100% + 32px);
    /* Adjust for parent padding */
    margin-left: -16px;
    /* Offset parent padding */
    margin-right: -16px;
    /* Offset parent padding */
}

.release-info span:not(:last-child)::after {
    content: "|";
    /* Add separator */
    margin-left: 20px;
    margin-right: 20px;
    /* Space after the separator */
    color: gray;
    /* Separator color */
}

.pv-button {
    background: var(--color-primary);
    color: white;
    padding: 5px 10px;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s, color 0.3s
}

.pv-button:hover {
    background-color: #0056b3;
    cursor: pointer;
    border: none;
}

.genre-tags {
    background: #f0f0f0;
    padding: 8px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 5px;
    justify-content: center;
    width: calc(100% + 32px);
    /* Adjust for parent padding */
    margin-left: -16px;
    /* Offset parent padding */
    margin-right: -16px;
    /* Offset parent padding */

}

.genre-tags span {
    background: #fff;
    color: #787878;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 10px;
    transition: background-color 0.3s, color 0.3s
}

.genre-tags span:hover {
    background-color: var(--color-primary);
    color: white;
    cursor: pointer;
    border: none;
}

/* ✅ Poster on Right, Description on Left */
.card-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 10px;
    overflow-y: auto;
    /* Scrollable by default on hover */
    max-height: 200px;
    /* Prevents full expansion */
    padding-right: 5px;
}

.card-content:hover {
    max-height: 200px;
    /* Allows more scrolling when hovered */
}


.poster {
    width: 167px;
    height: 237px;
    border-radius: 5px;
    flex-shrink: 0;
}

/* ✅ Description Container */
.description-container {
    display: flex;
    flex-direction: column;
}

.description {
    font-size: 12px;
    text-align: justify;
    color: black;
    max-height: 100px;
    /* Fixed height */
    overflow: hidden;
    /* Default: Hide overflow */
    padding-right: 5px;
    position: relative;
}

.description.expanded {
    max-height: none;
    /* Expands fully when toggled */
}

.official-links,
.streaming-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.streaming-list li {
    margin: 6px 0;
}

.streaming-list a {
    font-weight: 600;
    color: #43a6df;
}



/* ✅ Toggle Button */
.toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    /* Center vertically */
    justify-content: center;
    /* Center horizontally */
    width: 100%;
    color: #007bff;
}

.toggle-btn:hover {
    background-color: #f0f0f0;
    /* Light gray background on hover */
    border-radius: 5px;
    /* Rounded corners on hover */
}

.additional-info {
    font-size: 12px;
    text-align: right;
    padding-top: 5px;
    border-top: 1px solid #ccc;
    /* Separates visually */
}

.card-footer {
    background: #f8f8f8;
    padding: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    width: calc(100% + 32px);
    /* Adjust for parent padding */
    margin-left: -16px;
    /* Offset parent padding */
    margin-right: -16px;
    /* Offset parent padding */
    margin-bottom: -16px;
}

.stats {
    font-size: 14px;
}

.add-button {
    background: var(--color-primary);
    font-size: 1.2rem;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
}

.add-button:hover {
    background: #0056b3;
    cursor: pointer;
    border: none;
}

.fa-globe {
    font-size: 14px;
    transition: color 0.3s, color 0.3s;
    margin-left: 20px
}

.fa-globe:hover {
    color: var(--color-primary);
    cursor: pointer;
}

.title-sa-link:hover {
    text-decoration: underline;
    color: var(--color-primary);
}

@media (min-width: 1200px) {
    .anime-container {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ✅ Keeps 3 columns only when they fit correctly */
@media (min-width: 900px) and (max-width: 1199px) {
    .anime-container {
        grid-template-columns: repeat(3, 1fr);
    }

    .poster {
        width: 120px;
        height: 170px;
    }
}

/* ✅ Ensures 2 columns for smaller screens */
@media (min-width: 600px) and (max-width: 899px) {
    .anime-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .poster {
        width: 100px;
        height: 140px;
    }

    .title {
        font-size: 16px;
        /* Slightly smaller for mobile */
        -webkit-line-clamp: 3;
        /* Allows up to 3 lines */
    }

    .subtitle {
        font-size: 13px;
        -webkit-line-clamp: 3;
        /* Allows up to 3 lines */
    }
}

/* ✅ Single-column layout for mobile */
@media (max-width: 599px) {
    .anime-container {
        grid-template-columns: repeat(1, 1fr);
    }
}

/***** Archive ****/

.seasons-container {
    width: 97%;
    margin: auto;
    padding: 10px 0px 20px 0px;
}

/* === Desktop Table === */
.seasons-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.seasons-table td {
    padding: 12px;
    text-align: center;
    border: 1px solid #ddd;
}

.seasons-table a {
    display: inlineflex;
    justify-content: center;
    align-items: center;
    color: #0056b3;
    text-decoration: none;
    font-size: 14px;
}

.seasons-table a::after {
    content: "\f104";
    /* FontAwesome left arrow */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: gray;
    margin-left: 5px;
    /* Space between text and icon */
    margin-right: 5px;
    display: inline-block;
    text-decoration: none;
    /* Ensure icon is not underlined */
    pointer-events: none;
    /* Prevent interaction with the icon */
}

.seasons-table a:hover {
    text-decoration: underline;
    /* Underline only the text */
}



/* === Mobile View === */
.seasons-mobile {
    display: none;
}

.year-group {
    background: #fff;
    margin: 10px 0;
    border-radius: 5px;
    overflow: hidden;
}

.year-header {
    background: #ddd;
    padding: 10px;
    font-weight: bold;
    text-align: center;
}

.year-group a {
    display: block;
    padding: 12px;
    border-bottom: 1px solid #ddd;
    color: #0056b3;
    text-decoration: none;
    font-size: 14px;
    text-align: right;
}

.year-group a:last-child {
    border-bottom: none;
}

.year-group a i {
    float: left;
    color: #ccc;
}

/* Increase row height and add alternating row colors */
.seasons-table tr {
    height: 60px;
    /* Adjust row height */
}

.seasons-table tr:nth-child(odd) {
    background-color: #f1f1f1;
    /* Light gray background for odd rows */
}

/* === Responsive Styles === */
@media (max-width: 768px) {
    .seasons-table {
        display: none;
    }

    .seasons-mobile {
        display: block;
    }

    .season-link {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-decoration: none;
        color: #003366;
        /* Adjust text color */
        font-weight: bold;
        padding: 10px 15px;
        width: 100%;
        /* Ensures the link spans the full width of the td */
        position: relative;
    }

    .season-link::after {
        content: "\f104";
        /* Unicode for Font Awesome 'fa-angle-left' */
        font-family: "Font Awesome 6 Free";
        /* Ensure FontAwesome is loaded */
        font-weight: 900;
        /* Required for solid icons */
        color: gray;
        /* Adjust icon color */
        position: absolute;
        left: 10px;
        /* Ensure it appears after the text (adjust if needed) */
        top: 50%;
        transform: translateY(-50%);
    }

    .season-link:hover {
        background-color: rgb(238, 238, 238);
        color: rgb(133, 148, 185);
    }

}


/***** ANIME PAGE *****/

.privacy-section-title,
.wiki-section-title {
    margin-bottom: 30px;
    position: relative;
    padding: 8px 12px 7px;
    background-color: var(--color-shadow);
    border-bottom: solid;
    border-bottom-color: var(--color-secondary);
}

.privacy-title-text,
.wiki-title-text {
    color: var(--color-accent);
    margin-bottom: 0;
}

.wiki-subtitle-text {
    color: gray;
}


@media (max-width: 768px) {
    .wiki-title-text {
        font-size: 20px;
        padding: 6px 10px;
    }
}

.content-wrapper {
    display: flex;
    margin-top: 30px;
    gap: 30px;
}

.main-content {
    flex: 2.5;
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.ap-sidebar {
    flex: 0.7;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    /* Ensures sidebar stays on the right in RTL */
}

.banner {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    margin-bottom: 20px;
}

.banner-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.banner:hover .banner-image {
    transform: scale(1.1);
}


.banner-overlay {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: rgba(46, 81, 162, 0.7);
    color: white;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    opacity: 0;
    transition: opacity 0.3s;
}

.banner:hover .banner-overlay {
    opacity: 1;
}

.buttons button {
    width: 100%;
    margin: 5px 0;
    padding: 12px;
    background-color: #4a90e2;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.buttons button:hover {
    background-color: #357abd;
}

.social-buttons {
    text-align: center;
    margin-top: 10px;
}

.social-buttons a {
    color: #e0e7ff;
    text-decoration: none;
    margin: 0 10px;
    transition: color 0.3s;
}

.social-buttons a:hover {
    color: #fff;
}

.sidebar-section {
    margin-bottom: 25px;
}

.sidebar-section h3 {
    font-size: 18px;
    border-bottom: 2px solid var(--color-primary);
    padding-bottom: 5px;
    margin-bottom: 15px;
    color: var(--color-primary);
}

.tab-menu {
    background: #fff;
    padding: 10px 0;
    border-bottom: 1px solid #ddd;
    text-align: right;
    border-radius: 10px 10px 0 0;
}

.tab-menu a {
    color: var(--color-primary);
    text-decoration: none;
    margin: 0 15px;
    font-weight: 500;
    transition: color 0.3s, font-weight 0.3s;
}

.tab-menu a:hover,
.tab-menu a.active {
    font-weight: 700;
    color: var(--color-primary);
    text-decoration: underline;
}

/* General container styling */
.statistics-section {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 10px;
    border-radius: 5px;
}

/* Existing styles (unchanged) */
.video-thumbnail-container {
    flex: 0 0 120px;
    /* Fixed width for thumbnail; adjustable */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.video-thumbnail {
    text-align: center;
    padding: 1rem;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.video-thumbnail img {
    width: 87%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: opacity 0.3s ease;
}

.more-videos {
    display: block;
    color: #2e51a2;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
}

.more-videos:hover {
    color: #1a3a7a;
    text-decoration: underline;
}

/* New Video Effect Styles */
.video-thumbnail::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.5), transparent);
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-thumbnail:hover::before {
    opacity: 1;
}

.video-thumbnail .play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
    text-decoration: none;
    z-index: 2;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: pulse 2s infinite;
}

.video-thumbnail .play-button i {
    margin-left: 4px;
    /* Offset to mimic a play triangle */
}

.video-thumbnail:hover .play-button {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}

.video-thumbnail:hover img {
    opacity: 0.8;
}

.video-thumbnail-container a[href] {
    position: relative;
    display: block;
}

.video-thumbnail-container a[href]:hover .video-thumbnail {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

/* Animation for pulsing play button */
@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        transform: translate(-50%, -50%) scale(1.05);
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
    }
}

.stats-content {
    flex: 1;
    /* Takes remaining space */
    display: flex;
    flex-direction: column;
    gap: 15px;
    /* Space between stats-container and stats-action */
}

.stats-container {
    background-color: #f5f5f5;
    padding: 0;
    /* Adjusted to avoid double padding */
    border-radius: 0;
    /* Removed to match parent border-radius */
    padding-bottom: 10px;
}

.stats-section {
    display: flex;
    justify-content: space-around;
    margin-bottom: 0;
    /* Removed to avoid extra space */
    align-items: center;
}

.stat-item {
    text-align: center;
}

.stat-item .stat-value {
    display: block;
    font-size: 1.5em;
    font-weight: bold;
}

.stat-item .stat-label {
    display: block;
    font-size: 0.9em;
    color: #666;
}

.stat-item .stat-label-score {
    display: block;
    font-size: 0.9em;
    color: var(--color-titles);
    background-color: var(--color-primary);
    border: none;
    border-radius: 3px;
}

.stat-item .users-count {
    display: block;
    font-size: 0.8em;
    color: #999;
}

/* Vertical line separator after score */
.stat-item.score {
    border-left: 1px solid #ccc;
    padding-left: 15px;
    margin-left: 15px;
    margin-top: 10px;
}

.stats-details {
    text-align: center;
    font-size: 0.9em;
    color: #333;
}

.stats-action {
    display: flex;
    align-items: center;
    justify-content: space-around;
    background-color: #e8ecef;
    padding: 10px;
    border-radius: 5px;
}

.add-to-list {
    background-color: var(--color-primary);
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    transition: color 0.5s ease
}

.add-to-list:hover {
    background-color: var(--color-secondary);
}

.status-select {
    padding: 5px;
}

.progress label {
    margin-right: 5px;
}

.progress input[type="text"] {
    width: 60px;
    text-align: center;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 3px;
}

/* Mobile View Adjustments */
@media (max-width: 768px) {
    .statistics-section {
        flex-direction: column;
        gap: 20px;
        padding: 15px;
    }

    .video-thumbnail {
        padding: 0.75rem;
        width: 100%;
    }

    .play-button {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }


    .stats-content {
        width: 100%;
    }

    .stat-item.score {
        border-left: 0 solid #ccc;
        padding-left: 0;
        margin-left: 0;
        margin-top: 0;
    }

    .stats-section {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .stat-item.score {

        width: 100%;
    }

    .stat-value {
        font-size: 22px;
    }

    .stat-label {
        font-size: 14px;
    }

    .users-count {
        font-size: 12px;
    }

    .stats-details {
        font-size: 14px;
    }

    .stats-action {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .add-to-list,
    .status-select,
    .progress {
        width: 100%;
        padding: 10px;
        font-size: 14px;
    }
}


.h2-section-title {
    font-size: 22px;
    color: var(--color-primary);
    border-bottom: 2px solid var(--color-primary);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.written-by {
    color: var(--color-secondary);
    margin: 40px 0px 0px 0px;
}

.sub-synopsis-text {
    font-style: italic;
    font-size: 12px;
}

.sub-synopsis,
.synopsis,
.related,
.ads,
.characters,
.staff,
.themes,
.episodes {
    margin-bottom: 25px;
}

.related {
    margin-bottom: 25px;
}

.related h2 {
    font-size: 22px;
    color: var(--color-primary);
    border-bottom: 2px solid var(--color-primary);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.related-categories {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    /* 2 columns */
    grid-template-rows: repeat(2, auto);
    /* 2 rows */
    gap: 20px;
    margin-bottom: 20px;
}

.related-category {
    background: #f9fbfd;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.related-category h3 {
    font-size: 16px;
    color: #2e51a2;
    margin-bottom: 10px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 5px;
}

.related-entry {
    display: flex;
    /* Horizontal layout */
    align-items: flex-start;
    /* Align at the top */
    gap: 10px;
    /* Space between image and text */
    margin-bottom: 10px;
}

.related-entry img {
    width: 50px;
    height: 75px;
    object-fit: cover;
    border-radius: 3px;
}

.text-container {
    display: flex;
    flex-direction: column;
    /* Stack p and a vertically */
    gap: 5px;
    /* Space between p and a */
}

.text-container p {
    margin: 0;
    font-size: 10px;
    color: #666;
}

.text-container a.related-link {
    color: #2e51a2;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.text-container a.related-link:hover {
    color: #4a90e2;
    text-decoration: underline;
}

.more-names,
.more-link {
    color: #4a90e2;
    text-decoration: none;
    font-size: 16px;
    transition: color 0.3s;
    display: block;
    text-align: left;
    margin-top: 10px;
}

.more-names {
    text-align: right;
}

.more-names:hover,
.more-link:hover {
    color: #357abd;
    text-decoration: underline;
}

.more-names i,
.more-link i {
    margin-right: 5px;
    /* Space between icon and text */
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .related-categories {
        grid-template-columns: 1fr;
    }

    .related-entry img {
        width: 40px;
        height: 60px;
    }

    .related-entry p,
    .related-entry a.related-link {
        font-size: 12px;
    }
}

.ad-banner img {
    width: 20%;
    height: auto;
    margin: 10px 0;
    border-radius: 5px;
}

.character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.character-card {
    text-align: center;
    padding: 15px;
    background: #f9fbfd;
    border-radius: 10px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.character-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.character-card img {
    width: 100px;
    height: 150px;
    object-fit: cover;
    border-radius: 5px;
}

.character-card p {
    margin: 5px 0;
    color: #333;
}

/* Themes Section Styles */
.themes {
    margin: 2rem 0;
}

.theme-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    /* Two columns */
    gap: 2rem;
    /* Space between columns */
}

.theme-column {
    border: 1px solid #e0e0e0;
    /* Optional border for visual separation */
    border-radius: 8px;
    padding: 1rem;
}

.theme-subtitle {
    font-size: 1.7rem;
    color: #2e51a2;
    margin-bottom: 1rem;
    text-align: center;
    /* Center the subtitle */
}

.theme-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
    /* Optional separator between items */
}

.theme-item:last-child {
    border-bottom: none;
    /* Remove border for the last item */
}

.theme-item p {
    margin: 0;
    font-size: 12px;
}

.theme-item button {
    background: var(--color-extratext);
    color: white;
    border: none;
    border-radius: 23%;
    width: 33px;
    height: 30px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.theme-item button:hover {
    background-color: #ede9e8;
}

/* Video Slider Container */
/* Main Content Container */


/* Video Slider Container */
/* Video Slider Container */
.video-slider {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    /* Enable horizontal scrolling */
    padding: 10px 0;
    width: 100%;
    /* Ensure it takes full width of its parent */
    max-width: 100%;
    /* Prevent overflow beyond the parent container */
    scrollbar-width: thin;
    /* For Firefox */
    scrollbar-color: #2e51a2 #f9f9f9;
    /* For Firefox */
}

/* Custom Scrollbar for WebKit Browsers (Chrome, Safari) */
.video-slider::-webkit-scrollbar {
    height: 8px;
    /* Scrollbar height */
}

.video-slider::-webkit-scrollbar-track {
    background: #f9f9f9;
    /* Track color */
    border-radius: 5px;
}

.video-slider::-webkit-scrollbar-thumb {
    background: #2e51a2;
    /* Thumb color */
    border-radius: 5px;
}

.video-slider::-webkit-scrollbar-thumb:hover {
    background: #1a3a7a;
    /* Darker thumb on hover */
}

/* Video Slider Item */
.video-slider-item {
    position: relative;
    /* For positioning the play button */
    flex-shrink: 0;
    /* Prevent items from shrinking */
}

/* Video Slider Images */
.video-slider-item img {
    width: 180px;
    /* Fixed width for images */
    height: auto;
    border-radius: 5px;
    transition: transform 0.3s;
}

.video-slider-item img:hover {
    transform: scale(1.05);
    /* Zoom effect on hover */
}

/* Video Slider Play Button */
.video-slider-play {
    position: absolute;
    top: 50%;
    /* Center vertically */
    left: 50%;
    /* Center horizontally */
    transform: translate(-50%, -50%);
    /* Perfect centering */
    background-color: rgba(0, 0, 0, 0.7);
    /* Semi-transparent background */
    width: 40px;
    /* Button size */
    height: 40px;
    border-radius: 50%;
    /* Circular button */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s;
}

.video-slider-play i {
    color: white;
    /* Play icon color */
    font-size: 1.2rem;
    /* Icon size */
}

.video-slider-play:hover {
    background-color: rgba(0, 0, 0, 0.9);
    /* Darker background on hover */
}



/* Responsive Design */
@media (max-width: 768px) {

    .theme-grid {
        grid-template-columns: 1fr;
        /* Stack columns on smaller screens */
    }

    .content-wrapper {
        flex-direction: column;
    }


    .tab-menu a {
        margin: 0 10px;
        font-size: 14px;
    }

    .stats-section {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .score-box,
    .rank-stats,
    .video-preview {
        margin-bottom: 15px;
    }

    .character-grid {
        grid-template-columns: 1fr;
    }

    .video-slider img {
        width: 120px;
    }


}

.related-list {
    margin-top: 20px;
    width: 100%;
}

.related-category-list {
    display: block;
    text-align: left;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.related-item {
    display: flex;
    align-items: baseline;
    margin-bottom: 5px;
}

/* Ensures category-title has proper width */
.category-title {
    font-size: 16px;
    color: #2e51a2;
    font-weight: bold;
    padding-left: 5px;
    white-space: nowrap;
    min-width: 140px;
}

/* Align all .entry-content to the first position except for the first one */
.entry-content {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 5px;
}

/* Only apply margin to items after the first one */
.related-item:not(:first-child) .entry-content {
    margin-right: 140px;
}

/* Hide category-title for non-first entries but keep spacing intact */
.related-item:not(:first-child) .category-title {
    visibility: hidden;
    width: 0;
    padding: 0;
}

/* Make (رواية خفيفة) match entry-link */
.entry-type {
    font-size: 14px;
    color: #333;
}

/* Entry link styling */
.entry-link {
    color: #2e51a2;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.entry-link:hover {
    color: #4a90e2;
    text-decoration: underline;
}

/* Category separator */
.category-separator {
    border: 0;
    height: 1px;
    background: #ddd;
    margin: 15px 0 20px 0;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .related-category-list {
        max-width: 100%;
        margin: 0;
    }

    .category-title {
        font-size: 14px;
        min-width: 100px;
    }

    .related-item:not(:first-child) .entry-content {
        margin-right: 100px;
    }

    .entry-link {
        font-size: 12px;
    }

    .entry-type {
        font-size: 12px;
    }
}

/* Character Table Styles */
.staff-table,
.character-table {
    display: grid;
    gap: 1rem;
    margin: 2rem 0;
}

.table-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.table-cell {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Character Section (Right-aligned) */
.staff-section,
.character-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-direction: row-reverse;
    /* Reverse for RTL */
    text-align: right;
}

.staff-portrait,
.character-portrait {
    width: 42px;
    height: 62px;
}

.staff-details span,
.character-details p {
    margin: 0.2rem 0;
    font-size: 10px;
}

.staff-name,
.character-name {
    font-weight: bold;
    color: #2e51a2;
    text-decoration: none;
    transition: color 0.3s;
    display: block;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.staff-name:hover,
.character-name:hover {
    color: #4a90e2;
    text-decoration: underline;
}


.staff-portrait,
.character-portrait,
.va-portrait {
    border: 1px solid var(--color-extra);
    /* Adjust color and thickness as needed */
    border-radius: 5px;
    /* Ensures the border is circular for rounded images */
    box-sizing: border-box;
    /* Ensures the border is included in the image's dimensions */
}

/* Voice Actor Section (Left-aligned) */
.va-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-align: left;
}

.va-portrait {
    width: 42px;
    height: 62px;
}

.va-details p {
    margin: 0.2rem 0;
    font-size: 10px;
}

.va-name {
    color: #666;
    text-decoration: none;
    transition: color 0.3s;
    display: block;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.va-name:hover {
    color: #4a90e2;
    text-decoration: underline;
}

.va-country {
    color: #888;
}

/* More Link */
.more-staff,
.more-characters {
    display: block;
    text-align: left;
    color: #2e51a2;
    text-decoration: none;
    margin-top: 1rem;
    font-weight: bold;
}

/* Responsive Design */
@media (max-width: 768px) {
    .table-row {
        grid-template-columns: 1fr;
    }

    .character-section,
    .va-section {
        justify-content: flex-start;
        margin: 0.5rem 0;
    }
}

@media (min-width: 768px) and (max-width: 824px) {
    .main-content {
        flex: 2;
        /* Reduce flex ratio to fit better */
        padding: 15px;
        /* Reduce padding to free up space */
        
    }

    /* Adjust parent container if needed (e.g., .content-wrapper) */
    .content-wrapper {
        flex-wrap: wrap;
        /* Allow wrapping if sidebar is present */
        gap: 15px;
        /* Space between columns */
    }

    /* Optional: Adjust sidebar if present */
    .ap-sidebar {
        flex: 1;
        max-width: 100%;
    }
}
