/* 
   StreamWeb Elite UI Framework
   Style: Elite Midnight & Mint Green
*/

/* ===== CSS Variables ===== */
:root {
    --accent-mint: #20d472;
    --accent-mint-hover: #1abc64;
    --accent-mint-glow: rgba(32, 212, 114, 0.25);
    --accent-mint-soft: rgba(32, 212, 114, 0.1);
    --bg-obsidian: #050505;
    --bg-midnight: #0a0a0a;
    --bg-card: #111111;
    --bg-card-hover: #161616;
    --sidebar-bg: #0d0d0d;
    --glass-bg: rgba(15, 15, 15, 0.85);
    --glass-bg-light: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-hover: rgba(255, 255, 255, 0.15);
    --text-primary: #ffffff;
    --text-secondary: #999999;
    --text-dim: #666666;
    --text-muted: #444444;
    --font-pro: 'Outfit', sans-serif;
    --sidebar-width: 280px;
    --header-height: 80px;
    --bottom-nav-height: 75px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-pill: 50px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(32, 212, 114, 0.15);
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-obsidian);
    color: var(--text-primary);
    font-family: var(--font-pro);
    overflow-x: hidden;
    min-height: 100vh;
    line-height: 1.6;
}

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

img {
    max-width: 100%;
    display: block;
}

button {
    font-family: var(--font-pro);
    cursor: pointer;
}

:focus-visible {
    outline: 2px solid var(--accent-mint);
    outline-offset: 4px;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-obsidian); }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ===== Desktop Sidebar ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    padding: 30px 0;
    z-index: 2000;
    transition: transform var(--transition-base);
}

.sidebar-header { padding: 0 30px 40px; }

.logo a {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: #fff;
    font-size: 1.8rem;
    font-weight: 700;
}

.logo img { height: 38px; width: 38px; border-radius: 8px; }
.logo span span { color: var(--accent-mint); }



.sidebar-links { list-style: none; padding: 0 15px; flex-grow: 1; }
.sidebar-links li { margin-bottom: 8px; }
.sidebar-links li a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 14px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: var(--transition-base);
    font-size: 15px;
    font-weight: 500;
}
.sidebar-links li a i { width: 22px; height: 22px; opacity: 0.7; }
.sidebar-links li a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}
.sidebar-links li a:hover i { opacity: 1; }
.sidebar-links li a.active {
    color: var(--accent-mint);
    background: var(--accent-mint-soft);
    font-weight: 600;
}
.sidebar-links li a.active i { opacity: 1; }

/* Sidebar Auth Buttons */
.sidebar-auth {
    padding: 20px 25px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-top: 1px solid var(--glass-border);
}

.sidebar-auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition-base);
    text-align: center;
}

.sidebar-auth-btn.signin-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: #fff;
}

.sidebar-auth-btn.signin-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--glass-border-hover);
}

.sidebar-auth-btn.signup-btn {
    background: var(--accent-mint);
    color: #000;
}

.sidebar-auth-btn.signup-btn:hover {
    background: var(--accent-mint-hover);
    box-shadow: var(--shadow-glow);
}

/* User Profile Summary (Sidebar) */
.user-profile-summary {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: var(--glass-bg-light);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    margin-bottom: 5px;
    transition: var(--transition-base);
}

.user-profile-summary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--glass-border-hover);
}

.user-avatar {
    width: 42px;
    height: 42px;
    background: var(--accent-mint-soft);
    color: var(--accent-mint);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid var(--accent-mint-glow);
}

.user-avatar i {
    width: 20px;
    height: 20px;
}

.user-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.user-name {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.logout-link {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-dim);
    background: none;
    border: none;
    padding: 0;
    text-align: left;
    cursor: pointer;
    transition: var(--transition-base);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.logout-link:hover {
    color: var(--accent-red, #ff4757);
}

.sidebar-footer { padding: 25px 30px; border-top: 1px solid var(--glass-border); }
.social-icons { display: flex; justify-content: space-between; }
.social-icons a { color: var(--text-dim); transition: var(--transition-base); }
.social-icons a:hover { color: var(--accent-mint); transform: translateY(-2px); }

/* ===== Main Layout ===== */
.main-layout {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: auto;
}

/* ===== Header / Top Nav ===== */
header {
    height: var(--header-height);
    background: rgba(5, 5, 5, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    padding: 0 40px;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid transparent;
    transition: var(--transition-base);
}

header.scrolled {
    background: rgba(5, 5, 5, 0.95);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: var(--shadow-md);
}

nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 30px;
}

.header-left { display: flex; align-items: center; gap: 15px; }

.mobile-menu-toggle {
    display: none;
    background: none;
    border: 1px solid var(--glass-border);
    color: #fff;
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    align-items: center;
    justify-content: center;
    transition: var(--transition-base);
}

.mobile-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--glass-border-hover);
}

.mobile-only { display: none; }

/* ===== Search ===== */
.search-container {
    flex: 1;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--glass-bg-light);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-pill);
    padding: 0 20px;
    height: 46px;
    transition: var(--transition-base);
}

.search-input-wrapper:focus-within {
    border-color: var(--accent-mint);
    box-shadow: 0 0 0 3px var(--accent-mint-glow);
    background: rgba(255, 255, 255, 0.05);
}

.search-icon { width: 18px; height: 18px; color: var(--text-dim); margin-right: 12px; flex-shrink: 0; }

.search-container input {
    background: transparent;
    border: none;
    color: #fff;
    width: 100%;
    outline: none;
    font-family: var(--font-pro);
    font-size: 14px;
}

.search-container input::placeholder { color: var(--text-dim); }

/* Search Results Dropdown */
.search-results {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    z-index: 100;
    max-height: 400px;
    overflow-y: auto;
}

.search-result-item {
    display: flex;
    color: inherit;
    text-decoration: none;
    align-items: center;
    gap: 15px;
    padding: 12px 18px;
    cursor: pointer;
    transition: var(--transition-fast);
    border-bottom: 1px solid var(--glass-border);
}

.search-result-item:last-child { border-bottom: none; }

.search-result-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.search-result-item img {
    width: 45px;
    height: 65px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.result-info h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 3px;
}

.result-info span {
    font-size: 12px;
    color: var(--text-secondary);
}

.no-results {
    padding: 20px;
    text-align: center;
    color: var(--text-dim);
    font-size: 14px;
}

/* ===== Auth Buttons ===== */
.auth-buttons { display: flex; gap: 12px; flex-shrink: 0; }

.auth-btn {
    padding: 10px 22px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition-base);
    white-space: nowrap;
}

.auth-buttons .signin-btn {
    color: #fff;
    background: var(--glass-bg-light);
    border: 1px solid var(--glass-border);
}

.auth-buttons .signin-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--glass-border-hover);
}

.auth-buttons .signup-btn {
    background: var(--accent-mint);
    color: #000;
    border: 1px solid transparent;
}

.auth-buttons .signup-btn:hover {
    background: var(--accent-mint-hover);
    box-shadow: var(--shadow-glow);
}

/* ===== Sub-page Nav Links (old-style top nav) ===== */
.nav-links {
    display: flex;
    list-style: none;
    gap: 8px;
    align-items: center;
}

.nav-links li a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition-base);
}

.nav-links li a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.nav-links li a.active {
    color: var(--accent-mint);
}

/* ===== Hero Section ===== */
.hero-section {
    position: relative;
    min-height: 85vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding: 60px 50px;
}

.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero-video video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.3;
}

.hero-video::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to right,
        rgba(5, 5, 5, 0.95) 0%,
        rgba(5, 5, 5, 0.7) 50%,
        rgba(5, 5, 5, 0.4) 100%
    );
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 650px;
}

.hero-badge {
    display: inline-block;
    padding: 8px 20px;
    background: var(--accent-mint-soft);
    border: 1px solid rgba(32, 212, 114, 0.2);
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-mint);
    margin-bottom: 25px;
    animation: fadeInDown 0.6s ease;
}

.hero-content h1 {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #ffffff 0%, var(--accent-mint) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeInUp 0.6s ease 0.1s both;
}

.hero-content p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 35px;
    max-width: 500px;
    animation: fadeInUp 0.6s ease 0.2s both;
}

.hero-stats {
    display: flex;
    gap: 40px;
    margin-bottom: 40px;
    animation: fadeInUp 0.6s ease 0.3s both;
}

.hero-stats .stat { text-align: center; }

.hero-stats .stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-mint);
}

.hero-stats .stat-label {
    font-size: 13px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    animation: fadeInUp 0.6s ease 0.4s both;
}

.btn-primary, .btn-secondary {
    padding: 14px 32px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
    font-family: var(--font-pro);
}

.btn-primary {
    background: var(--accent-mint);
    color: #000;
}

.btn-primary:hover {
    background: var(--accent-mint-hover);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--glass-border-hover);
    transform: translateY(-2px);
}

/* ===== Trending Section ===== */
.trending-section {
    padding: 60px 40px 40px;
}

.trending-section h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 30px;
}

.trending-slider {
    display: flex;
    gap: 25px;
    overflow-x: auto;
    padding-bottom: 15px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.trending-slider::-webkit-scrollbar { height: 4px; }
.trending-slider::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 2px; }

.trending-item {
    display: block;
    color: inherit;
    text-decoration: none;
    flex-shrink: 0;
    width: 180px;
    cursor: pointer;
    scroll-snap-align: start;
    transition: var(--transition-base);
}

.trending-item:hover { transform: translateY(-8px); }

.trending-rank {
    font-size: 2.5rem;
    font-weight: 900;
    color: transparent;
    -webkit-text-stroke: 2px var(--accent-mint);
    margin-bottom: -12px;
    position: relative;
    z-index: 1;
    padding-left: 5px;
}

.trending-poster {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 2/3;
}

.trending-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-slow);
}

.trending-item:hover .trending-poster img { transform: scale(1.08); }

.trending-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 60%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition-base);
}

.trending-item:hover .trending-overlay { opacity: 1; }

.play-btn-small {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--accent-mint);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #000;
    box-shadow: var(--shadow-glow);
}

.trending-info { padding: 12px 5px 0; }
.trending-info h4 { font-size: 15px; font-weight: 600; margin-bottom: 5px; }

.trending-badge {
    display: inline-block;
    font-size: 11px;
    color: var(--accent-mint);
    background: var(--accent-mint-soft);
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-weight: 600;
}

/* ===== Genre Section ===== */


/* ===== Movies Section ===== */
.movies-section {
    padding: 40px 40px 60px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 10px;
}

.section-header h2,
.movies-section h2 {
    font-size: 1.8rem;
    font-weight: 700;
}

/* Filter Buttons */
.filter-buttons {
    display: flex;
    gap: 10px;
}

.filter-btn {
    padding: 8px 20px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
    font-family: var(--font-pro);
}

.filter-btn:hover {
    color: #fff;
    border-color: var(--glass-border-hover);
    background: rgba(255, 255, 255, 0.05);
}

.filter-btn.active {
    background: var(--accent-mint);
    color: #000;
    border-color: var(--accent-mint);
}

/* Movies Grid */
.movies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 25px;
    padding: 30px 0;
}

/* Movie Card */
.movie-item {
    display: block;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-base);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid transparent;
}

.movie-item:hover {
    transform: translateY(-8px);
    border-color: var(--glass-border);
    box-shadow: var(--shadow-md);
}

.movie-poster {
    position: relative;
    aspect-ratio: 2/3;
    overflow: hidden;
}

.movie-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-slow);
}

.movie-item:hover .movie-poster img { transform: scale(1.08); }

.quality-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--accent-mint);
    color: #000;
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    z-index: 2;
}

.movie-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.2) 40%, transparent 70%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition-base);
}

.movie-item:hover .movie-overlay { opacity: 1; }

.play-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--accent-mint);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #000;
    box-shadow: var(--shadow-glow);
    transform: scale(0.8);
    transition: var(--transition-base);
}

.movie-item:hover .play-button { transform: scale(1); }

.movie-rating {
    position: absolute;
    bottom: 15px;
    left: 15px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}

.movie-info { padding: 15px; }

.movie-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.movie-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.movie-year, .movie-duration {
    font-size: 12px;
    color: var(--text-dim);
}

.genre-tag {
    font-size: 10px;
    font-weight: 700;
    color: var(--accent-mint);
    background: var(--accent-mint-soft);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    letter-spacing: 0.5px;
}

.movie-description {
    font-size: 13px;
    color: var(--text-dim);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 20px 0 40px;
}

.pagination button {
    padding: 10px 28px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
    font-family: var(--font-pro);
}

.pagination button:hover:not(:disabled) {
    background: var(--accent-mint);
    color: #000;
    border-color: var(--accent-mint);
    transform: translateY(-2px);
}

.pagination button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ===== Continue Watching ===== */
.continue-watching {
    padding: 40px 40px 60px;
}

.continue-watching h2 {
    font-size: 1.8rem;
    font-weight: 700;
}

/* Header with "See All" Link */
.continue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.see-all-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-pill);
    color: var(--text-dim);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.see-all-btn:hover {
    background: var(--glass-bg-light);
    border-color: var(--accent-mint);
    color: var(--accent-mint);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(32, 212, 114, 0.1);
}

.see-all-btn i {
    font-size: 14px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.see-all-btn:hover i {
    transform: translateX(4px);
}

.continue-grid {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding-bottom: 20px; /* More space for scrollbar */
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: var(--glass-border) transparent; /* Firefox */
    -webkit-overflow-scrolling: touch;
    transition: var(--transition-base);
}

/* Custom Scrollbar Styles — Professional & Minimal */
.continue-grid::-webkit-scrollbar { 
    height: 4px; 
}

.continue-grid::-webkit-scrollbar-track { 
    background: transparent; 
}

.continue-grid::-webkit-scrollbar-thumb { 
    background: rgba(255, 255, 255, 0.1); 
    border-radius: 10px;
    transition: background 0.3s ease;
}

.continue-grid:hover::-webkit-scrollbar-thumb { 
    background: var(--glass-border); 
}

.continue-grid::-webkit-scrollbar-thumb:hover {
    background: var(--accent-mint);
}

.continue-grid.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    overflow: visible;
    gap: 25px;
}

.continue-item {
    flex-shrink: 0;
    width: 340px;
    scroll-snap-align: start;
    display: flex;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition-base);
    border: 1px solid var(--glass-border);
    height: 100px;
    position: relative; /* Anchor for removal button */
}

.continue-item:focus-visible {
    outline-offset: -2px;
}

.continue-item.hidden-item {
    display: none;
}

.continue-grid.expanded .continue-item.hidden-item {
    display: flex;
}

.continue-item:hover {
    transform: translateY(-4px);
    border-color: var(--glass-border);
    box-shadow: var(--shadow-md);
}

.continue-thumbnail {
    position: relative;
    width: 180px; /* Fixed width for horizontal thumbnails */
    min-width: 180px;
    height: 100%;
}

.continue-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.progress-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 12px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
}

.progress-bar {
    height: 4px;
    background: var(--accent-mint);
    border-radius: 2px;
    margin-bottom: 10px;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    right: -4px;
    top: -3px;
    width: 10px;
    height: 10px;
    background: var(--accent-mint);
    border-radius: 50%;
    box-shadow: var(--shadow-glow);
}

.resume-btn {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent-mint);
    display: flex;
    align-items: center;
    gap: 4px;
}

.continue-info { 
    padding: 12px 20px; 
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.continue-info h4 { font-size: 15px; font-weight: 600; margin-bottom: 6px; }

.continue-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-dim);
}

.remove-item-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    border: 1px solid var(--glass-border);
    color: var(--text-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-base);
    opacity: 0; /* Hidden by default */
    z-index: 10;
}

.continue-item:hover .remove-item-btn {
    opacity: 1;
}

.remove-item-btn:hover {
    background: var(--accent-red, #ff4757);
    color: #fff;
    border-color: var(--accent-red, #ff4757);
    transform: scale(1.1);
}

.remove-item-btn i {
    font-size: 14px;
}

.progress-text { color: var(--accent-mint); font-weight: 600; }



/* ===== Footer ===== */
footer {
    background: linear-gradient(to bottom, var(--bg-midnight), rgba(5, 5, 5, 1));
    border-top: 1px solid var(--glass-border);
    padding: 80px 40px 30px;
    margin-top: auto;
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--accent-mint), transparent);
    box-shadow: 0 0 20px var(--accent-mint-glow);
    opacity: 0.5;
}

.footer-content {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 60px;
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 60px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.footer-logo img { width: 36px; height: 36px; border-radius: 8px; }
.footer-logo h3 { font-size: 1.4rem; font-weight: 700; }

.footer-brand p {
    color: var(--text-dim);
    font-size: 14px;
    line-height: 1.6;
}

.footer-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.footer-column h4 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 18px;
    color: var(--text-primary);
}

.footer-column a {
    display: block;
    color: var(--text-dim);
    font-size: 14px;
    padding: 5px 0;
    transition: var(--transition-base);
}

.footer-column a:hover {
    color: var(--accent-mint);
    padding-left: 5px;
}

.footer-social h4 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 18px;
}

.footer-social .social-icons {
    display: flex;
    gap: 15px;
}

.footer-social .social-icons a {
    font-size: 1.3rem;
    transition: var(--transition-base);
}

.footer-social .social-icons a:hover { transform: scale(1.2); }

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 0;
    border-top: 1px solid var(--glass-border);
    max-width: 1200px;
    margin: 0 auto;
}



.footer-bottom p {
    font-size: 13px;
    color: var(--text-dim);
}

.footer-legal {
    display: flex;
    gap: 20px;
}

.footer-legal a {
    font-size: 13px;
    color: var(--text-dim);
    transition: var(--transition-base);
}

.footer-legal a:hover { color: var(--accent-mint); }

/* ===== Sign In / Sign Up / Contact Forms ===== */
.signin-section,
.signup-section,
.feedback-section {
    min-height: calc(100vh - var(--header-height) - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.signin-form-container,
.signup-form-container,
.feedback-form-container {
    width: 100%;
    max-width: 480px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 45px 40px;
    box-shadow: var(--shadow-lg);
}

.signin-header,
.signup-header {
    text-align: center;
    margin-bottom: 35px;
}

.signin-header h2,
.signup-header h2,
.feedback-form-container h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.signin-header p,
.signup-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.signup-benefits {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.benefit {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-group input,
.form-group textarea,
.feedback-form input,
.feedback-form textarea {
    width: 100%;
    padding: 13px 18px;
    background: var(--glass-bg-light);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: #fff;
    font-size: 14px;
    font-family: var(--font-pro);
    outline: none;
    transition: var(--transition-base);
}

.form-group input:focus,
.form-group textarea:focus,
.feedback-form input:focus,
.feedback-form textarea:focus {
    border-color: var(--accent-mint);
    box-shadow: 0 0 0 3px var(--accent-mint-glow);
    background: rgba(255, 255, 255, 0.05);
}

.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-muted); }

/* Password Show/Hide Styling - Premium Redesign */
.password-input-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    padding-right: 55px !important; /* Extra room for a clean look */
}

.password-toggle {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.3); /* Integrated neutral state */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

.password-toggle:hover {
    color: var(--accent-mint);
    background: rgba(32, 212, 114, 0.1); /* Subtle mint glow */
    transform: translateY(-50%) scale(1.1);
}

.password-toggle:active {
    transform: translateY(-50%) scale(0.95);
}

.password-toggle i {
    width: 18px;
    height: 18px;
    pointer-events: none; /* Icon inside button shouldn't intercept */
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    font-size: 13px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-mint);
}

.checkbox-label a { color: var(--accent-mint); }

.forgot-password {
    color: var(--accent-mint);
    font-weight: 500;
}

.forgot-password:hover { text-decoration: underline; }

.signin-form .signin-btn,
.signup-form .signup-btn,
.signin-section .signin-btn,
.feedback-form button {
    width: 100%;
    padding: 14px;
    background: var(--accent-mint);
    color: #000;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-base);
    font-family: var(--font-pro);
    margin-top: 5px;
}

.signin-form .signin-btn:hover,
.signup-form .signup-btn:hover,
.signin-section .signin-btn:hover,
.feedback-form button:hover {
    background: var(--accent-mint-hover);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.divider {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 25px 0;
    color: var(--text-muted);
    font-size: 13px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--glass-border);
}

.social-signin {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 25px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    background: transparent;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-base);
    font-family: var(--font-pro);
}

.social-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--glass-border-hover);
}

.signup-link,
.login-link {
    text-align: center;
    font-size: 14px;
    color: var(--text-dim);
}

.signup-link a,
.login-link a {
    color: var(--accent-mint);
    font-weight: 600;
}

.signup-link a:hover,
.login-link a:hover { text-decoration: underline; }

/* Feedback form extra */
.feedback-form-container {
    text-align: left;
}

.feedback-form-container h2 {
    text-align: center;
    margin-bottom: 30px;
}

.feedback-form {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.feedback-form label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 5px;
    margin-top: 12px;
    display: block;
}

.feedback-form label:first-of-type { margin-top: 0; }

.feedback-form textarea {
    resize: vertical;
    min-height: 120px;
}

.feedback-form button {
    margin-top: 20px;
}

/* Success Message */
.success-message {
    text-align: center;
    padding: 30px 20px;
}

.success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--accent-mint-soft);
    color: var(--accent-mint);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 auto 25px;
    border: 3px solid var(--accent-mint);
    animation: successPop 0.5s ease;
}

.success-message h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.success-message p {
    color: var(--text-secondary);
    margin-bottom: 25px;
    font-size: 14px;
}

.success-message .btn-primary,
.success-message .signin-btn {
    display: inline-block;
    padding: 12px 30px;
    width: auto;
}

/* ===== Movie Player Page ===== */
.movie-player-section {
    padding: 30px 40px 60px;
}

.movie-player-section .container {
    max-width: 1100px;
    margin: 0 auto;
}

.movie-info-header {
    margin-bottom: 25px;
}

.movie-info-header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.movie-info-header .movie-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.movie-info-header p {
    color: var(--text-secondary);
    font-size: 15px;
    max-width: 700px;
}

.movie-player-container {
    position: relative;
    width: 100%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #000;
    box-shadow: var(--shadow-lg);
    margin-bottom: 25px;
}

.movie-player {
    width: 100%;
    aspect-ratio: 16/9;
    display: block;
    background: #000;
}

.movie-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.action-btn {
    padding: 12px 24px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
    font-family: var(--font-pro);
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--glass-border-hover);
    transform: translateY(-2px);
}

.action-btn.primary {
    background: var(--accent-mint);
    color: #000;
    border-color: transparent;
}

.action-btn.primary:hover {
    background: var(--accent-mint-hover);
    box-shadow: var(--shadow-glow);
}

/* ===== Mobile Bottom Nav ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--bottom-nav-height);
    background: rgba(13, 13, 13, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-top: 1px solid var(--glass-border);
    display: none;
    justify-content: space-around;
    align-items: center;
    z-index: 2000;
}

.bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 11px;
    font-weight: 500;
    transition: var(--transition-base);
    padding: 5px 10px;
}

.bottom-nav a i { width: 22px; height: 22px; }

.bottom-nav a.active {
    color: var(--accent-mint);
}

.bottom-nav a:hover { color: var(--text-secondary); }

/* ===== Sidebar Overlay (Mobile) ===== */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1999;
}

.sidebar-overlay.active { display: block; }

/* ===== Animations ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(25px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-15px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes successPop {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

/* ===== Responsive: Tablet (max-width: 950px) ===== */
@media (max-width: 950px) {
    :root {
        --sidebar-width: 0px;
        --header-height: 65px;
        --bottom-nav-height: 70px;
    }

    /* Sidebar: hidden off-screen, slides in on toggle */
    .sidebar {
        width: 280px;
        transform: translateX(-100%);
        pointer-events: none;
        box-shadow: none;
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.35s ease;
    }

    .sidebar.active {
        transform: translateX(0);
        pointer-events: auto;
        box-shadow: 10px 0 40px rgba(0, 0, 0, 0.6);
    }

    /* Main layout: no sidebar margin, pad for bottom nav */
    .main-layout {
        margin-left: 0;
        padding-bottom: var(--bottom-nav-height);
    }

    /* Show mobile elements */
    .mobile-menu-toggle { display: flex; }
    .mobile-only { display: flex; }
    .bottom-nav { display: flex; }
    .auth-buttons { display: none; }
    .nav-links { display: none; }

    /* Header */
    header {
        padding: 0 20px;
        height: var(--header-height);
    }

    nav { gap: 15px; }

    /* Hero */
    .hero-section {
        min-height: 65vh;
        padding: 40px 30px;
    }

    .hero-content h1 { font-size: 2.8rem; }
    .hero-content p { font-size: 1rem; max-width: 100%; }

    /* Sections padding */
    .trending-section,
    .genres-section,
    .movies-section,
    .continue-watching {
        padding-left: 20px;
        padding-right: 20px;
        padding-top: 40px;
        padding-bottom: 30px;
    }

    /* Trending: ensure horizontal scroll works well */
    .trending-slider {
        gap: 18px;
        scroll-padding-left: 20px;
    }

    .trending-item { width: 190px; }

    /* Genre grid — 3 columns on tablet */
    .genre-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

    /* Movies grid */
    .movies-grid {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
        gap: 18px;
    }

    /* Continue watching */
    .continue-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 18px;
    }

    /* Footer */
    .footer-content { grid-template-columns: 1fr; gap: 30px; }
    .footer-bottom { flex-direction: column; gap: 15px; text-align: center; }
    footer { padding: 40px 20px 0; }

    /* Movie player */
    .movie-player-section { padding: 20px 20px 40px; }
    .movie-player-container { border-radius: var(--radius-md); }

    /* Forms */
    .signin-section,
    .signup-section,
    .feedback-section {
        padding: 40px 20px;
    }
}

/* ===== Responsive: Mobile (max-width: 600px) ===== */
@media (max-width: 600px) {
    :root {
        --header-height: 60px;
        --bottom-nav-height: 65px;
    }

    /* Header — two row layout on mobile */
    header {
        padding: 10px 16px;
        height: auto;
    }

    nav { 
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 12px; 
    }

    .header-left {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: flex-start; /* Toggle stays on left */
    }

    .mobile-only {
        display: block;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }

    .auth-buttons {
        display: none; /* Accessible via sidebar on mobile */
    }

    /* Mobile menu button — proper touch target */
    .mobile-menu-toggle {
        width: 44px;
        height: 44px;
        min-width: 44px;
        border-radius: var(--radius-sm);
    }

    /* Mobile logo — smaller */
    .mobile-only .logo a { font-size: 1.3rem; gap: 8px; }
    .mobile-only .logo img { height: 28px; width: 28px; }

    /* Search — Wide and Prominent on Mobile Row 2 */
    .search-container { 
        width: 100%; 
        order: 2; /* Push to second row */
        margin: 0;
    }

    .search-input-wrapper {
        height: 46px; /* Larger pill on mobile */
        padding: 0 16px;
        border-radius: 50px;
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.15);
        backdrop-filter: blur(15px);
    }

    .search-icon { width: 18px; height: 18px; margin-right: 10px; }
    .search-container input { font-size: 14px; }
    .search-container input::placeholder { font-size: 14px; }

    /* Search results — full width on mobile */
    .search-results {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
        max-height: 60vh;
    }

    .search-result-item { padding: 10px 15px; gap: 12px; }
    .search-result-item img { width: 40px; height: 55px; }

    /* ===== Hero — Mobile Optimized ===== */
    .hero-section {
        min-height: auto;
        padding: 35px 16px 45px;
    }

    .hero-video::after {
        background: linear-gradient(
            to right,
            rgba(5, 5, 5, 0.97) 0%,
            rgba(5, 5, 5, 0.85) 100%
        );
    }

    .hero-badge {
        padding: 6px 14px;
        font-size: 11px;
        margin-bottom: 18px;
    }

    .hero-content h1 {
        font-size: 2rem;
        margin-bottom: 14px;
    }

    .hero-content p {
        font-size: 0.9rem;
        margin-bottom: 25px;
        line-height: 1.6;
    }

    .hero-stats {
        gap: 20px;
        margin-bottom: 28px;
    }

    .hero-stats .stat-number { font-size: 1.4rem; }
    .hero-stats .stat-label { font-size: 11px; }

    .hero-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .btn-primary, .btn-secondary {
        width: 100%;
        text-align: center;
        padding: 13px 24px;
        font-size: 14px;
    }

    /* ===== Sections — Mobile ===== */
    .trending-section,
    .genres-section,
    .movies-section,
    .continue-watching {
        padding: 30px 16px;
    }

    .trending-section h2,
    .genres-section h2,
    .movies-section h2,
    .section-header h2,
    .continue-watching h2 {
        font-size: 1.3rem;
        margin-bottom: 20px;
    }

    /* Section header + filters */
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .filter-buttons {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 5px;
        gap: 8px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .filter-buttons::-webkit-scrollbar { display: none; }

    .filter-btn {
        padding: 7px 16px;
        font-size: 12px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* ===== Trending — Mobile swipeable ===== */
    .trending-slider {
        gap: 14px;
        scroll-padding-left: 16px;
        margin: 0 -16px;
        padding: 0 16px 12px;
    }

    .trending-item { width: 160px; }
    .trending-rank { font-size: 2.2rem; margin-bottom: -10px; }
    .trending-poster { border-radius: var(--radius-sm); }
    .trending-info h4 { font-size: 13px; }
    .trending-badge { font-size: 10px; padding: 2px 8px; }

    /* Always show trending overlay on mobile (no hover) */
    .trending-overlay { opacity: 0.7; }
    .play-btn-small { width: 40px; height: 40px; font-size: 14px; }

    /* ===== Genre Grid — 2 columns, compact ===== */
    .genre-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .genre-card {
        padding: 22px 14px;
        font-size: 13px;
        border-radius: var(--radius-sm);
    }

    /* ===== Movie Grid — responsive columns ===== */
    .movies-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
        padding: 20px 0;
    }

    .movie-item { border-radius: var(--radius-sm); }
    .movie-info { padding: 10px; }
    .movie-title { font-size: 13px; margin-bottom: 5px; }
    .movie-meta { gap: 6px; margin-bottom: 4px; }
    .movie-year, .movie-duration { font-size: 11px; }
    .genre-tag { font-size: 9px; padding: 1px 6px; }
    .movie-description { font-size: 11px; -webkit-line-clamp: 1; line-clamp: 1; }
    .quality-badge { top: 8px; right: 8px; padding: 2px 7px; font-size: 10px; }

    /* Always show overlay on mobile for discoverability */
    .movie-overlay { opacity: 1; background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 60%); }
    .play-button { width: 44px; height: 44px; font-size: 16px; transform: scale(1); }
    .movie-rating { bottom: 10px; left: 10px; font-size: 12px; }

    /* ===== Continue Watching — Horizontal Slider on Mobile ===== */
    .continue-grid {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        gap: 12px;
        padding-bottom: 10px;
    }

    .continue-item {
        width: 300px; /* Slightly narrower on mobile */
    }

    .continue-thumbnail {
        width: 140px;
        min-width: 140px;
    }

    .continue-info { padding: 10px 12px; }
    .continue-info h4 { font-size: 14px; }
    .continue-meta { font-size: 11px; }
    .resume-btn { opacity: 1; } /* Always visible on mobile */

    /* ===== Pagination — Touch-friendly ===== */
    .pagination {
        padding: 15px 0 30px;
        gap: 12px;
    }

    .pagination button {
        padding: 10px 22px;
        font-size: 13px;
        min-height: 44px;
    }

    /* ===== Footer — Mobile compact ===== */
    footer {
        padding: 30px 16px 0;
    }

    .footer-content { gap: 25px; }
    .footer-logo img { width: 30px; height: 30px; }
    .footer-logo h3 { font-size: 1.2rem; }
    .footer-brand p { font-size: 13px; }
    .footer-column h4 { font-size: 14px; margin-bottom: 12px; }
    .footer-column a { font-size: 13px; padding: 4px 0; }
    .footer-links { grid-template-columns: 1fr 1fr; gap: 20px; }
    .footer-social h4 { font-size: 14px; }
    .footer-bottom { padding: 18px 0; }
    .footer-bottom p { font-size: 12px; }
    .footer-legal a { font-size: 12px; }

    /* ===== Forms — Mobile compact ===== */
    .signin-section,
    .signup-section,
    .feedback-section {
        padding: 30px 16px;
        min-height: auto;
    }

    .signin-form-container,
    .signup-form-container,
    .feedback-form-container {
        padding: 28px 20px;
        border-radius: var(--radius-lg);
    }

    .signin-header h2,
    .signup-header h2,
    .feedback-form-container h2 { font-size: 1.5rem; }

    .signup-benefits { gap: 12px; flex-wrap: wrap; justify-content: center; }
    .benefit { font-size: 12px; }

    .form-group { margin-bottom: 16px; }
    .form-group input,
    .form-group textarea,
    .feedback-form input,
    .feedback-form textarea {
        padding: 12px 14px;
        font-size: 14px;
        /* Prevent zoom on iOS inputs */
        font-size: max(14px, 16px);
    }

    .form-options { font-size: 12px; gap: 8px; }

    .social-btn { padding: 11px; font-size: 13px; min-height: 44px; }

    /* ===== Movie Player — Mobile ===== */
    .movie-player-section { padding: 12px 12px 30px; }
    .movie-player-container { border-radius: var(--radius-sm); margin-bottom: 18px; }
    .movie-info-header { margin-bottom: 15px; }
    .movie-info-header h1 { font-size: 1.4rem; margin-bottom: 8px; }
    .movie-info-header p { font-size: 13px; }
    .movie-info-header .movie-meta { gap: 8px; }
    .movie-actions { flex-direction: column; gap: 8px; }
    .action-btn { width: 100%; text-align: center; padding: 12px; min-height: 44px; }

    /* ===== Bottom Nav — Enhanced mobile ===== */
    .bottom-nav {
        height: var(--bottom-nav-height);
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .bottom-nav a {
        gap: 3px;
        font-size: 10px;
        padding: 8px 5px;
        min-width: 50px;
    }

    .bottom-nav a i { width: 20px; height: 20px; }
}

/* ===== Responsive: Small Mobile (max-width: 400px) ===== */
@media (max-width: 400px) {
    .hero-content h1 { font-size: 1.7rem; }
    .hero-content p { font-size: 0.85rem; }
    .hero-stats { gap: 15px; }
    .hero-stats .stat-number { font-size: 1.2rem; }

    .signup-benefits { flex-direction: column; align-items: center; gap: 8px; }

    .movies-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .movie-info { padding: 8px; }
    .movie-title { font-size: 12px; }
    .movie-description { display: none; }

    .trending-item { width: 140px; }
    .trending-rank { font-size: 1.8rem; }



    .continue-info h4 { font-size: 13px; }

    .signin-form-container,
    .signup-form-container,
    .feedback-form-container { padding: 22px 16px; }

    .signin-header h2,
    .signup-header h2 { font-size: 1.3rem; }

    .mobile-only .logo a { font-size: 1.1rem; }
    .mobile-only .logo img { height: 24px; width: 24px; }

    .search-input-wrapper { height: 36px; }
    .search-container input { font-size: 12px; }
}

/* ===== Very small screens (max-width: 320px) ===== */
@media (max-width: 320px) {
    .hero-content h1 { font-size: 1.5rem; }
    .hero-badge { font-size: 10px; padding: 5px 10px; }
    .hero-stats .stat-number { font-size: 1.1rem; }
    .hero-stats .stat-label { font-size: 10px; }
    
    .movies-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
    .movie-info { padding: 6px; }
    .movie-title { font-size: 11px; }
    .movie-meta { display: none; }
    

    
    .trending-item { width: 120px; }
    
    .bottom-nav a { font-size: 9px; min-width: 45px; }
    .bottom-nav a i { width: 18px; height: 18px; }
    
    .search-input-wrapper { height: 34px; padding: 0 10px; }
}

/* ===== iOS Safe Area Support ===== */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .bottom-nav {
        padding-bottom: env(safe-area-inset-bottom);
        height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
    }

    .main-layout {
        padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
    }
}

/* ===== Touch Device Optimizations ===== */
@media (hover: none) and (pointer: coarse) {
    /* Show interactive overlays by default on touch devices */
    .movie-overlay {
        opacity: 1;
        background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, transparent 55%);
    }
    .play-button { transform: scale(1); }
    .trending-overlay { opacity: 0.6; }
    .resume-btn { opacity: 1; }

    /* Remove hover transform effects (jittery on touch) */
    .movie-item:hover { transform: none; }
    .trending-item:hover { transform: none; }

    .btn-primary:hover, .btn-secondary:hover { transform: none; }
    .action-btn:hover { transform: none; }
    .pagination button:hover:not(:disabled) { transform: none; }

    /* Active (tap) states instead of hover */
    .movie-item:active { transform: scale(0.97); }
    .trending-item:active { transform: scale(0.97); }

    .btn-primary:active { transform: scale(0.97); }
    .btn-secondary:active { transform: scale(0.97); }
    .filter-btn:active { transform: scale(0.95); }
    .bottom-nav a:active { transform: scale(0.9); }
    .action-btn:active { transform: scale(0.97); }
    .social-btn:active { background: rgba(255, 255, 255, 0.08); }

    /* Smooth scrolling sections */
    .trending-slider {
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
    }

    .filter-buttons {
        -webkit-overflow-scrolling: touch;
    }
}

/* ===== Landscape Mobile ===== */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-section {
        min-height: auto;
        padding: 20px 30px;
    }

    .hero-content h1 { font-size: 1.8rem; margin-bottom: 10px; }
    .hero-content p { margin-bottom: 15px; }
    .hero-stats { margin-bottom: 20px; gap: 25px; }
    .hero-buttons { flex-direction: row; }
    .btn-primary, .btn-secondary { width: auto; }

    .bottom-nav { height: 55px; }
    .bottom-nav a span { display: none; }
    .bottom-nav a { gap: 0; }
}
