
       
       /* NAVBAR */



.navbar{
    position:fixed;
    top:0;
    width:100%;
    height:70px;

    display:flex;
    justify-content:space-between;
    align-items:center;

    padding:0 40px;

    z-index:999;

    background:linear-gradient(to bottom,
    rgba(0,0,0,0.9),
    rgba(0,0,0,0));
}

.nav-left{
    display:flex;
    align-items:center;
    gap:40px;
}

.logo{
    font-size:2rem;
    font-weight:bold;
}

.logo span{
    color:#4a7c2c;
}

.nav-links{
    display:flex;
    gap:25px;
}

.nav-links a{
    color:rgb(66, 66, 66);
    text-decoration:none;
    transition:0.3s;
    opacity:0.8;
}

.nav-links a:hover{
    opacity:1;
    color:#69ff768a;
}

.nav-right{
    display:flex;
    align-items:center;
    gap:20px;
}

       
       
       :root {
            /* Light Theme (Nature) */
            --hero-bg:rgba(255, 255, 255, 0.562);
            --content-box-bg: #ffffff63;
            --leaf-green: #4a7c2c;
            --accent-glow: #a8cf45;
            --glass-white: rgba(255, 255, 255, 0.25);
            --glass-border: rgba(255, 255, 255, 0.4);
            --text-main: #2d3436;
            --bg-gradient: linear-gradient(135deg, #eef5f2 0%, #d9e8e3 100%);
            --radius-lg: 30px;
            --radius-md: 18px;

;
        }

        .dark-mode {
            --hero-bg:rgba(255, 255, 255, 0.089);
            --content-box-bg: #ffffff15;
            --leaf-green: #a8cf45;
            --accent-glow: #ffffff;
            --glass-white: rgba(20, 20, 20, 0.7);
            --glass-border: rgba(255, 255, 255, 0.1);
            --text-main: #f0f0f0;
            --bg-gradient: linear-gradient(135deg, #0f1412 0%, #050505 100%);
            
        }

        * { box-sizing: border-box; transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1); }

        body {
            background: var(--bg-gradient);
            background-attachment: fixed;
            color: var(--text-main);
            margin: 0;
            font-family: 'Inter', 'Segoe UI', sans-serif;
            overflow-x: hidden;
        }

        body::before {
            content: "";
            position: fixed;
            top: 0; left: 0; width: 100%; height: 100%;
            background: url('twigstv.jpg') no-repeat center center/cover;
            opacity: 0.75;
            z-index: -1;
        }
        .dark-mode body::before { opacity: 0.05; }

        /* --- Navigation --- */
        .navbar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 15px 8%;
            background: var(--glass-white);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border-bottom: 1px solid var(--glass-border);
            position: sticky;
            top: 0;
            z-index: 1000;
        }

        .logo {
            color: var(--leaf-green);
            font-weight: 800;
            font-size: 1.4rem;
            display: flex;
            align-items: center;
            gap: 12px;
            text-transform: uppercase;
        }

        .logo::before {
            content: "";
            width: 35px; height: 35px;
            background: url('twigstv.jpg') center/cover;
            border-radius: 50%;
            border: 2px solid var(--leaf-green);
        }

        /* --- Search Bar --- */
        .search-container { position: relative; width: 300px; }
        #animeSearch {
            width: 100%;
            padding: 10px 15px 10px 40px;
            border-radius: var(--radius-lg);
            border: 1px solid var(--glass-border);
            background: rgba(255, 255, 255, 0.1);
            color: var(--text-main);
            outline: none;
        }
        #animeSearch:focus { width: 350px; background: rgba(255,255,255,0.3); box-shadow: 0 0 15px var(--leaf-green); }
        .search-icon { position: absolute; left: 12px; top: 10px; width: 18px; fill: var(--leaf-green); }

        /* --- Theme Toggle --- */
        .theme-switch { cursor: pointer; display: flex; align-items: center; gap: 8px; font-size: 1.2rem; }
        #checkbox { display: none; }

        /* --- Hero --- */
        .hero {
            height: 60vh;
            display: flex;
            align-items: center;
            padding: 0 10%;
            margin-bottom: 60px;
            background: linear-gradient(to right, var(--bg-gradient), transparent), url('twigstv.jpg') center/cover;
        }
        .hero-content h1 { font-size: 3.5rem; color: var(--leaf-green); margin: 0; }

 .normal-header {
            height: 60px;
            display: flex;
            align-items: center;
            padding: 0 10%;
            margin-bottom: 60px;
        }

        .normal-header h1 { font-size: 2rem; color: var(--leaf-green); margin: 0; }

        /* --- Grid & Cards --- */


        
       .content-grid {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 24px;
    padding: 20px 0;
    scroll-behavior: smooth;

    scrollbar-width: none;
    -ms-overflow-style: none;
}

.content-grid::-webkit-scrollbar {
    display: none;
}


.anime-card-link {
    flex: 0 0 auto;
}

.anime-card {
    width: 290px;
    flex-shrink: 0;
}
        .anime-card {
            background: var(--glass-white);
            border: 1px solid var(--glass-border);
            border-radius: var(--radius-md);
            overflow: hidden;
            cursor: pointer;
            box-shadow: 0 10px 30px rgba(0,0,0,0.05);
        }

        .anime-card:hover { transform: translateY(-10px); box-shadow: 0 20px 40px rgba(74, 124, 44, 0.2); }

        .media-container { position: relative; width: 100%; aspect-ratio: 2/3; overflow: hidden; }
        .thumbnail { width: 100%; height: 100%; object-fit: cover; z-index: 2; transition: opacity 0.5s; }
        .preview-video { position: absolute; top:0; left:0; width:100%; height:100%; object-fit: cover; opacity: 0; z-index: 1; }

        .anime-card:hover .thumbnail { opacity: 0; }
        .anime-card:hover .preview-video { opacity: 1; }

        .card-info { padding: 20px; }
        .card-info h3 { margin: 0 0 5px; color: var(--leaf-green); font-size: 1.2rem; }

        /* --- Player Overlay --- */
        .video-overlay {
            display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(0,0,0,0.95); z-index: 2000; justify-content: center; align-items: center;
        }
        .video-container { width: 80%; position: relative; }
        video#mainVideo { width: 100%; border-radius: var(--radius-md); border: 4px solid var(--glass-white); }
        .close-btn { position: absolute; top: -50px; right: 0; color: white; font-size: 2rem; cursor: pointer; }

        .play-btn {
            background: var(--leaf-green); color: white; border: none; padding: 15px 40px;
            border-radius: var(--radius-lg); font-weight: bold; cursor: pointer;
        }

        .player-wrapper {
    display: flex;
    width: 90%;
    height: 85vh;
    background: var(--glass-white);
    backdrop-filter: blur(30px);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--glass-border);
scrollbar-width: none;
-ms-overflow-style: none;
        }


.player-wrapper::-webkit-scrollbar {
  display: none;
}


.main-stage {
    flex: 3; /* Takes up 75% of the space */
    padding: 30px;
    display: flex;
    flex-direction: column;
    position: relative;

}

.episode-sidebar {
    flex: 1; /* Takes up 25% of the space */
    background: rgba(0, 0, 0, 0.2);
    border-left: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--glass-border);
}

.episode-list {
    overflow-y: auto;
    padding: 10px;
}

/* Custom Scrollbar for that "Premium" feel */
.episode-list::-webkit-scrollbar { width: 5px; }
.episode-list::-webkit-scrollbar-thumb { background: var(--leaf-green); border-radius: 10px; }

.ep-item {
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 15px;
}

.ep-item:hover {
    background: rgba(115, 255, 134, 0.2);
    transform: translateX(5px);
}

.ep-item.active {
    background: var(--leaf-green);
    color: white;
}

.ep-num { font-weight: bold; opacity: 0.6; }

.anime-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}


@media (max-width: 768px) {

/* Disable hover preview effects on touch screens */
    .anime-card:hover .thumbnail { 
        opacity: 1 !important; /* Forces the poster to stay visible */
    }
    
    .anime-card:hover .preview-video { 
        opacity: 0 !important; /* Keeps the preview video hidden */
        pointer-events: none; /* Prevents it from capturing accidental touch events */
    }

    /* 1. Eliminate the huge inline 100px padding and 50px margins causing the squish */
    div[style*="padding: 100px;"] {
        padding: 20px 10px !important;
        margin: 10px 0 !important;
    }

    /* 2. Responsive Global Navbar Integration */
    .navbar {
        padding: 10px 15px !important;
        height: auto !important;
        flex-direction: column !important;
        gap: 12px;
    }

    .nav-left {
        width: 100%;
        justify-content: space-between;
        gap: 10px;
    }

    /* Keeps your links beautifully side-by-side inside a neat touch-swipe row */
    .nav-links {
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        padding: 5px 0;
        gap: 20px;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
    }
    
    .nav-links::-webkit-scrollbar {
        display: none;
    }

    .nav-right {
        width: 100%;
        justify-content: space-between;
        gap: 15px;
    }

    .search-container { 
        width: 80%; 
    }
    #animeSearch {
        width: 100%;
    }
    #animeSearch:focus { 
        width: 100%; 
    }

    /* 3. Hero Layout Typography Scales */
    .hero {
        height: 45vh !important;
        padding: 0 5% !important;
        margin-bottom: 20px !important;
        background-position: center center !important;
    }

    .hero-content h1 {
        font-size: 2rem !important;
    }
    
    .hero-content p {
        font-size: 1rem !important;
    }

    .normal-header {
        padding: 0;
        margin-bottom: 15px;
    }

    .normal-header h1 {
        font-size: 1.5rem !important;
    }

    /* 4. Fix Carousel Content Grid & Swipe Architecture */
    .content-grid {
        display: flex !important;      /* Changes grid into a smooth touch slider for carousels */
        overflow-x: auto !important;   /* Allows users to swipe left and right on their phones */
        scroll-snap-type: x mandatory;
        gap: 15px !important;
        padding: 0 10px 20px !important;
        scrollbar-width: none;         /* Hides messy scrollbars */
    }

    .content-grid::-webkit-scrollbar {
        display: none;
    }

    /* Ensure cards scale consistently during horizontal swiping */
    .anime-card-link {
        flex: 0 0 180px !important;    /* Forces every card to stay a sharp 180px wide */
        scroll-snap-align: start;
    }

    .card-info {
        padding: 12px !important;
    }

    .card-info h3 {
        font-size: 0.95rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;       /* Adds a clean '...' for extremely long titles */
    }

    /* Hide desktop carousel utility arrow buttons on mobile touchscreen devices */
    .carousel-buttons {
        display: none !important;
    }
}



/* Continue Watching Progress UI Styles */
.continue-card {
    min-width: 220px;
    width: 220px;
    background: #ffffff; /* Solid background for light mode */
    border-radius: 12px; /* Smooth corners like your New Releases */
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    position: relative;
    border: 1px solid rgba(0,0,0,0.05);
}

/* Maintain dark mode readability */
.dark-mode .continue-card {
    background: #1e251a; 
    border: 1px solid rgba(255,255,255,0.05);
}

.continue-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.25);
}

.continue-card img {
    width: 100%;
    height: 140px; /* Slightly taller aspect ratio */
    object-fit: cover;
    display: block;
}

.continue-info {
    padding: 12px;
    background: inherit;
}

.continue-info h4 {
    margin: 0 0 6px 0;
    font-size: 0.95rem;
    color: #111111;
    font-weight: 600;
}

.dark-mode .continue-info h4 {
    color: #ffffff;
}

.continue-info p {
    margin: 0;
    font-size: 0.8rem;
    color: #666666;
}

.dark-mode .continue-info p {
    color: #aaaaaa;
}

/* Progress bar alignment fixes */
.progress-container {
    width: 100%;
    height: 5px;
    background: rgba(0, 0, 0, 0.1);
    position: absolute;
    bottom: 0;
    left: 0;
}

.dark-mode .progress-container {
    background: rgba(255, 255, 255, 0.1);
}

.progress-bar {
    height: 100%;
    background: var(--leaf-green);
    width: 0%;
}

