/*
Theme Name: Cartoon Tamilan
Theme URI: https://cartoontamilan.net
Author: Cartoon Tamilan
Description: Custom WordPress streaming theme for movies and series matching exact layout.
Version: 2.0
Text Domain: cartoontamilan
*/

/* Global Reset & Body Layout Fixes */
html, body {
    height: auto !important;
    min-height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    background-color: #000000 !important;
    color: #ffffff !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    box-sizing: border-box;
    overflow-x: hidden !important;
    overflow-y: auto !important;
}

body {
    display: flex !important;
    flex-direction: column !important;
    padding-bottom: 70px !important;
}

*, *:before, *:after {
    box-sizing: border-box;
}

a {
    color: inherit;
    text-decoration: none;
}

.container, main {
    flex: 1 !important;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 15px;
    padding-right: 15px;
    padding-bottom: 20px !important;
    overflow: visible !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Custom Header Logo & Site Title Styling */
.site-header {
    background-color: #000000 !important;
    padding: 1px 0 !important;
    margin: 0 !important;
    text-align: center !important;
    min-height: unset !important;
    height: auto !important;
}

.site-header .container {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    min-height: unset !important;
}

.custom-logo-link {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    text-decoration: none !important;
}

.custom-logo {
    height: 35px !important;
    width: auto !important;
    max-height: 35px !important;
    object-fit: contain !important;
}

.site-title-text {
    font-size: 20px !important;
    font-weight: bold !important;
    color: #ffffff !important;
    letter-spacing: 0.5px !important;
    margin: 0 !important;
    text-decoration: none !important;
}

.site-title-text span {
    color: #db2777;
}

.site-header h1 {
    font-size: 1.875rem;
    font-weight: bold;
    color: #db2777;
    letter-spacing: 0.05em;
    margin: 0;
}

/* Fix Top Gap Across All Pages & Admin Bar */
html, body {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

body.admin-bar {
    margin-top: 0 !important;
}

#wpadminbar {
    position: fixed !important;
}

.container, main, .archive-container {
    margin-top: 0 !important;
}

/* Full-width Screen Hero Banner */
.anime-hero-banner {
    position: relative;
    width: 100% !important;
    background-size: cover;
    background-position: center center;
    padding: 40px 15px 30px 15px;
    margin-top: 0 !important;
    overflow: visible !important;
    box-sizing: border-box;
}

.anime-hero-banner::before {
    content: "";
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(10,10,10,0.10) 0%, rgba(10,10,10,0.10) 80%, #0b0f19 100%);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 1;
}

.anime-hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
    box-sizing: border-box;
}

.anime-poster-box {
    width: 170px;
    height: 240px;
    margin: 0 auto 15px auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 12px 35px rgba(0,0,0,0.85);
    border: 2px solid rgba(255,255,255,0.15);
}

.anime-poster-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.anime-title {
    font-size: 26px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 20px;
    word-break: break-word;
    overflow-wrap: break-word;
    padding: 0 10px;
}

/* First & Latest Episode Action Buttons Grid */
.hero-action-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px;
    max-width: 750px;
    margin: 0 auto 20px auto;
    padding: 0 10px;
    box-sizing: border-box;
}

.hero-action-btn {
    background: rgba(20, 24, 33, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 10px;
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    backdrop-filter: blur(5px);
    cursor: pointer;
    overflow: hidden;
}

.hero-action-btn:hover {
    border-color: #db2777;
    background: rgba(30, 37, 51, 0.95);
    transform: translateY(-2px);
}

.hero-action-icon {
    font-size: 14px;
    color: #9ca3af;
    flex-shrink: 0;
}

.hero-action-text {
    text-align: left;
    overflow: hidden;
}

.hero-action-label {
    font-size: 11px;
    font-weight: bold;
    color: #fff;
    display: block;
    white-space: nowrap;
}

.hero-action-sub {
    font-size: 10px;
    color: #9ca3af;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.anime-meta-badges {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.meta-badge {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    color: #e5e7eb;
    display: flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
}

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

/* --- Fixed 2-Column Grid Layout for Languages Fitting Mobile Screen Perfectly --- */
.grid-languages {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    padding: 0 5px !important;
    box-sizing: border-box !important;
}

@media (min-width: 768px) {
    .grid-languages {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

.lang-btn {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    text-align: center !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 10px 4px !important;
    background: #111827 !important;
    border: 1px solid #1f2937 !important;
    border-radius: 10px !important;
    text-decoration: none !important;
    color: #fff !important;
    overflow: hidden !important;
}

.lang-btn span {
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

/* Clean Streaming Card Grid Layout for Normal Archives */
.grid-movies {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 20px !important;
    margin-bottom: 30px !important;
}

@media (max-width: 1024px) {
    .grid-movies {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .grid-movies {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }
}

.movie-card {
    background: #111827 !important;
    border: 1px solid #1f2937 !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    position: relative !important;
    transition: transform 0.2s ease, border-color 0.2s ease !important;
    display: flex !important;
    flex-direction: column !important;
}

.movie-card:hover {
    transform: translateY(-4px);
    border-color: #db2777 !important;
}

.movie-card img {
    width: 100% !important;
    height: 240px !important;
    object-fit: cover !important;
    display: block !important;
    background: #1f2937 !important;
}

.card-number {
    position: absolute !important;
    bottom: 40px !important;
    left: 8px !important;
    font-size: 28px !important;
    font-weight: bold !important;
    color: #fff !important;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8) !important;
}

.card-title {
    padding: 10px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #ffffff !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    margin: 0 !important;
}

/* Overview Content Area & Scrollbar Fixes */
.post-content-area, article, #app-container, main {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
}

.post-content-area * {
    max-width: 100% !important;
    overflow-x: hidden !important;
    word-break: break-word !important;
}

/* Sticky Bottom Footer */
.fixed-footer {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    background-color: #000000 !important;
    border-top: 1px solid #1f2937 !important;
    z-index: 99999 !important;
    padding: 10px 0 !important;
    box-sizing: border-box;
}

.footer-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    font-size: 11px;
    color: #9ca3af;
}

.footer-copyright {
    display: none;
}

/* Ultimate Fix to Remove Bottom Gap Above Footer */
.container, main {
    margin-bottom: 0 !important;
    padding-bottom: 10px !important;
}

body {
    padding-bottom: 50px !important;
}

/* --- STRICT NETFLIX STYLE COMPACT SLIDER FOR HISTORY & MOST WATCHED --- */
.history-slider-box, 
.most-watched-slider-box {
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
    margin-bottom: 25px !important;
}

.history-slider-box .grid-movies,
.most-watched-slider-box .grid-movies {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    gap: 12px !important;
    padding: 5px 5px 15px 5px !important;
    margin: 0 !important;
    width: 100% !important;
    scroll-behavior: smooth !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

.history-slider-box .grid-movies::-webkit-scrollbar,
.most-watched-slider-box .grid-movies::-webkit-scrollbar {
    display: none !important;
    height: 0 !important;
    width: 0 !important;
}

.history-slider-box .grid-movies .movie-card,
.most-watched-slider-box .grid-movies .movie-card {
    flex: 0 0 120px !important;
    width: 120px !important;
    min-width: 120px !important;
    max-width: 120px !important;
    height: 150px !important;
    max-height: 150px !important;
    background: #111827 !important;
    border: 1px solid #1f2937 !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
}

.history-slider-box .grid-movies .movie-card img,
.most-watched-slider-box .grid-movies .movie-card img {
    width: 100% !important;
    height: 115px !important;
    min-height: 115px !important;
    max-height: 115px !important;
    object-fit: cover !important;
}

.history-slider-box .grid-movies .movie-card .card-number,
.most-watched-slider-box .grid-movies .movie-card .card-number {
    position: absolute !important;
    bottom: 28px !important;
    left: 6px !important;
    font-size: 22px !important;
    font-weight: 900 !important;
    color: #ffffff !important;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.9), 0 0 15px rgba(0,0,0,0.8) !important;
    background: transparent !important;
    padding: 0 !important;
    line-height: 1 !important;
    z-index: 5;
}

.history-slider-box .grid-movies .movie-card .card-title,
.most-watched-slider-box .grid-movies .movie-card .card-title {
    padding: 4px 6px !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    color: #ffffff !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    text-align: left !important;
    background: #111827 !important;
    margin: 0 !important;
    height: 25px !important;
}

/* --- Clean Full Visibility Fix for Main Sections without Half-Screen Cut --- */
main.container, .container {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
}

main > section, .container > section {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
    padding: 0 5px !important;
}
.cartoon-share-box {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 20px 0;
}
.cartoon-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    color: #fff;
    transition: opacity 0.2s ease, transform 0.2s ease;
    cursor: pointer;
    border: none;
}
.cartoon-share-btn:hover {
    opacity: 0.85;
    transform: translateY(-2px);
}
.share-whatsapp { background: #25d366; }
.share-telegram { background: #0088cc; }
.share-copy { background: #374151; border: 1px solid #4b5563; }