﻿/* ============================================
   WEBSTREAM - Movie Streaming Website
   ============================================ */

/* ---------- CSS Variables ---------- */
:root {
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-card: #111111;
    --bg-input: #0e0e0e;
    --accent: #ff6b00;
    --accent-hover: #ff8c33;
    --accent-rgb: 255, 107, 0;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #6c6c6c;
    --border-color: #1e1e1e;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
    --radius: 10px;
    --transition: all 0.3s ease;
}

/* ---------- Reset & Base ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

a:hover {
    color: var(--accent);
}

img {
    max-width: 100%;
    height: auto;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
}

/* ---------- Navbar ---------- */
.navbar-custom {
    background: linear-gradient(180deg, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.7) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 15px 0;
    border-bottom: 1px solid rgba(var(--accent-rgb), 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-custom > .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.navbar-top {
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-brand-custom {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ---------- Toggle Button ---------- */
.nav-toggle {
    display: none;
    background: none;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1.5rem;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    padding: 0;
    line-height: 1;
}

.nav-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.nav-toggle .toggle-close {
    display: none;
}

.nav-toggle.active .toggle-open {
    display: none;
}

.nav-toggle.active .toggle-close {
    display: inline;
}

.navbar-brand-custom .brand-icon {
    color: var(--accent);
    font-size: 2rem;
}

.navbar-brand-custom .brand-text {
    background: linear-gradient(135deg, var(--accent), #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu .nav-link-custom {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.nav-menu .nav-link-custom:hover,
.nav-menu .nav-link-custom.active {
    color: var(--text-primary);
    background: rgba(var(--accent-rgb), 0.15);
}

.nav-menu .nav-link-custom.active {
    color: var(--accent);
}

.nav-menu .nav-link-custom ion-icon {
    font-size: 1.15rem;
}

/* ---------- Search Section ---------- */
.search-section {
    padding: 40px 0 20px;
}

.search-wrapper {
    position: relative;
    max-width: 650px;
    margin: 0 auto;
}

.search-wrapper .search-input {
    width: 100%;
    padding: 14px 50px 14px 20px;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: 50px;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}

.search-wrapper .search-input::placeholder {
    color: var(--text-muted);
}

.search-wrapper .search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(var(--accent-rgb), 0.2);
}

.search-wrapper .search-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    background: var(--accent);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.search-wrapper .search-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-50%) scale(1.05);
}

.search-info {
    text-align: center;
    margin-top: 12px;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ---------- Section Title ---------- */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title ion-icon {
    color: var(--accent);
    font-size: 1.4rem;
}

.section-link {
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.section-link:hover {
    color: var(--accent-hover);
    gap: 8px;
}

/* ---------- Movie Grid ---------- */
.movies-section {
    padding: 20px 0 40px;
}

/* ---------- Trending Section ---------- */
.trending-section {
    padding: 10px 0 20px;
}

.trending-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 10px;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) var(--bg-secondary);
}

.trending-scroll::-webkit-scrollbar {
    height: 4px;
}
.trending-scroll::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}
.trending-scroll::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
}

.trending-card {
    flex: 0 0 220px;
    scroll-snap-align: start;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    position: relative;
    color: var(--text-primary);
    text-decoration: none;
    display: block;
}

.trending-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow), 0 0 20px rgba(var(--accent-rgb), 0.2);
    color: var(--text-primary);
}

.trending-rank {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 3;
    background: var(--accent);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.trending-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.trending-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.trending-card:hover .trending-thumb img {
    transform: scale(1.08);
}

.trending-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.trending-card:hover .trending-play {
    opacity: 1;
}

.trending-play ion-icon {
    font-size: 2rem;
    color: #fff;
    background: var(--accent);
    border-radius: 50%;
    padding: 6px;
}

.trending-hot {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(var(--accent-rgb), 0.9);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 3px;
    backdrop-filter: blur(4px);
}

.trending-hot ion-icon {
    font-size: 0.65rem;
}

.trending-info {
    padding: 10px;
}

.trending-title {
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.trending-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.trending-meta span {
    display: flex;
    align-items: center;
    gap: 3px;
}

.trending-meta ion-icon {
    font-size: 0.75rem;
}

@media (max-width: 767px) {
    .trending-card {
        flex: 0 0 170px;
    }
    .trending-title {
        font-size: 0.75rem;
    }
    .trending-meta {
        font-size: 0.65rem;
    }
}

/* ---------- Movie Grid ---------- */
.movies-section {
    padding: 20px 0 40px;
}

.movie-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.movie-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow), 0 0 30px rgba(var(--accent-rgb), 0.15);
}

.movie-poster {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/9;
}

.movie-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.movie-card:hover .movie-poster img {
    transform: scale(1.08);
}

.movie-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.85) 100%);
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.movie-card:hover .movie-overlay {
    opacity: 1;
}

.play-btn {
    width: 55px;
    height: 55px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: #fff;
    transform: scale(0.8);
    transition: var(--transition);
    box-shadow: 0 0 25px rgba(var(--accent-rgb), 0.5);
}

.movie-card:hover .play-btn {
    transform: scale(1);
}

.movie-rating {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 2;
}

.movie-rating ion-icon {
    color: #ffc107;
}

.movie-quality {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    z-index: 2;
}

.movie-info {
    padding: 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.movie-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.movie-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: auto;
}

.movie-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.movie-meta ion-icon {
    font-size: 0.9rem;
}

/* ---------- Pagination ---------- */
.pagination-section {
    padding: 20px 0 50px;
    display: flex;
    justify-content: center;
}

.pagination-custom {
    display: flex;
    align-items: center;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.pagination-custom .page-item .page-link {
    min-width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0 12px;
    transition: var(--transition);
    cursor: pointer;
}

.pagination-custom .page-item .page-link:hover {
    background: rgba(var(--accent-rgb), 0.15);
    border-color: var(--accent);
    color: var(--text-primary);
}

.pagination-custom .page-item.active .page-link {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 700;
}

.pagination-custom .page-item.disabled .page-link {
    opacity: 0.35;
    cursor: not-allowed;
}

.pagination-custom .page-link ion-icon {
    font-size: 1.1rem;
}

/* ---------- Footer ---------- */
.footer-custom {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 30px 0;
    margin-top: auto;
}

.footer-brand {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 8px;
}

.footer-text {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 6px;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.footer-links a:hover {
    color: var(--accent);
    padding-left: 4px;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    margin-top: 20px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ============================================
   VIDEO PAGE
   ============================================ */

.video-page {
    padding: 30px 0 50px;
}

/* ---------- Video Player ---------- */
.video-player-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.6);
}

.video-player {
    width: 100%;
    height: 100%;
    display: block;
}

/* ---------- Video Info ---------- */
.video-info-section {
    margin-top: 20px;
}

.video-title {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 12px;
}

.video-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.stat-item ion-icon {
    font-size: 1.1rem;
    color: var(--text-muted);
}

.stat-item ion-icon[name="star"] {
    color: #ffc107;
}

/* ---------- Tags ---------- */
.video-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.tag-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(var(--accent-rgb), 0.1);
    border: 1px solid rgba(var(--accent-rgb), 0.25);
    color: var(--accent);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: var(--transition);
}

.tag-item:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.tag-item ion-icon {
    font-size: 0.85rem;
}

/* ---------- Description ---------- */
.video-description {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--border-color);
}

.desc-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.desc-title ion-icon {
    color: var(--accent);
}

.video-description p {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.7;
    margin: 0;
}

/* ---------- Related Videos ---------- */
.related-section {
    position: sticky;
    top: 90px;
}

.related-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
}

.related-title ion-icon {
    color: var(--accent);
}

.related-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.related-card {
    display: flex;
    gap: 12px;
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid transparent;
}

.related-card:hover {
    border-color: var(--border-color);
    transform: translateX(4px);
    color: inherit;
}

.related-thumb {
    position: relative;
    flex-shrink: 0;
    width: 160px;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.related-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.related-card:hover .related-thumb img {
    transform: scale(1.05);
}

.related-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.3);
    opacity: 0;
    transition: var(--transition);
}

.related-card:hover .related-play {
    opacity: 1;
}

.related-play ion-icon {
    font-size: 1.6rem;
    color: #fff;
    background: var(--accent);
    border-radius: 50%;
    padding: 6px;
}

.related-info {
    padding: 10px 10px 10px 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.related-video-title {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-meta {
    display: flex;
    gap: 12px;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.related-meta span {
    display: flex;
    align-items: center;
    gap: 3px;
}

.related-meta ion-icon {
    font-size: 0.8rem;
}

/* ---------- Btn Accent ---------- */
.btn-accent {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-accent:hover {
    background: var(--accent-hover);
    color: #fff;
}

/* ---------- Video Page Responsive ---------- */
@media (max-width: 991px) {
    .related-section {
        position: static;
        margin-top: 30px;
    }
}

@media (max-width: 767px) {
    .video-title {
        font-size: 1.2rem;
    }

    .video-stats {
        gap: 12px;
    }

    .stat-item {
        font-size: 0.8rem;
    }

    .related-thumb {
        width: 120px;
    }

    .related-video-title {
        font-size: 0.8rem;
    }
}
}

/* ---------- Ad Slots ---------- */
.ad-slot {
    text-align: center;
    margin: 20px 0;
    overflow: hidden;
    position: relative;
}
.ad-slot img.ad-banner-img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
}

/* Position-specific: leaderboard ads (728x90) */
.ad-header,
.ad-homepage_middle,
.ad-homepage_bottom,
.ad-above_player,
.ad-below_player,
.ad-between_videos,
.ad-footer_ad {
    max-width: 728px;
    margin-left: auto;
    margin-right: auto;
}

/* Position-specific: rectangle ads (300x250) */
.ad-below_description,
.ad-sidebar {
    max-width: 300px;
}
.ad-sidebar {
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 20px;
}

/* Above/below player: match container */
.ad-above_player {
    margin-bottom: 15px;
}
.ad-below_player {
    margin-top: 15px;
}
.ad-below_description {
    margin: 20px auto 0;
}
.ad-between_videos {
    margin: 16px auto;
}
.ad-footer_ad {
    margin: 30px auto 0;
}

/* Ad position label */
.ad-slot .ad-label {
    display: inline-block;
    background: rgba(var(--accent-rgb),0.85);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Sticky Mobile Ad */
.sticky-mobile-ad {
    display: none;
}
@media (max-width: 767px) {
    .sticky-mobile-ad {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 9999;
        background: var(--bg-primary);
        padding: 5px;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.5);
        max-width: 100%;
        margin: 0;
    }
    .sticky-mobile-ad img.ad-banner-img {
        border-radius: 0;
        width: 100%;
        max-height: 60px;
        object-fit: contain;
    }
}

/* Responsive ads */
@media (max-width: 767px) {
    .ad-slot {
        margin: 12px 0;
    }
    /* Leaderboard ads: full width on mobile */
    .ad-header,
    .ad-homepage_middle,
    .ad-homepage_bottom,
    .ad-above_player,
    .ad-below_player,
    .ad-between_videos,
    .ad-footer_ad {
        max-width: 100%;
    }
    .ad-header img.ad-banner-img,
    .ad-homepage_middle img.ad-banner-img,
    .ad-homepage_bottom img.ad-banner-img,
    .ad-above_player img.ad-banner-img,
    .ad-below_player img.ad-banner-img,
    .ad-between_videos img.ad-banner-img,
    .ad-footer_ad img.ad-banner-img {
        width: 100%;
        border-radius: 6px;
    }
    /* Rectangle ads: center and full width on mobile */
    .ad-below_description,
    .ad-sidebar {
        max-width: 100%;
    }
    .ad-sidebar {
        margin-bottom: 15px;
    }
    .ad-slot .ad-label {
        font-size: 0.6rem;
    }
    /* Hide sidebar ad label on very small screens */
    .ad-below_description img.ad-banner-img,
    .ad-sidebar img.ad-banner-img {
        max-width: 320px;
        width: 100%;
        margin: 0 auto;
    }
}

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
    .navbar-brand-custom {
        font-size: 1.4rem;
    }

    .nav-menu {
        gap: 4px;
    }

    .nav-menu .nav-link-custom {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
}

@media (max-width: 767px) {
    .navbar-top {
        width: 100%;
        justify-content: space-between;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        gap: 0;
        margin-top: 15px;
        padding-top: 15px;
        border-top: 1px solid var(--border-color);
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu .nav-link-custom {
        padding: 12px 16px;
        font-size: 0.95rem;
        border-radius: 8px;
        width: 100%;
    }

    .nav-menu .nav-link-custom:hover {
        background: rgba(var(--accent-rgb), 0.1);
    }

    .search-section {
        padding: 25px 0 15px;
    }

    .section-title {
        font-size: 1.2rem;
    }

    .movie-info {
        padding: 10px;
    }

    .movie-title {
        font-size: 0.85rem;
    }
}
