/* assets/css/style.css */
:root {
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --text-main: #fff;
    --text-muted: #888;
    --accent: #FF4500;
    --border: #333;
}

* { box-sizing: border-box; }
body { 
    background: var(--bg-color); color: var(--text-main); 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; 
    margin: 0; padding-bottom: 90px; 
}
a { text-decoration: none; color: inherit; }

/* --- APP BAR & HEADERS --- */
.app-bar {
    position: sticky; top: 0; z-index: 100;
    background: rgba(18, 18, 18, 0.98); backdrop-filter: blur(10px);
    padding: 15px 20px; border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center; height: 60px;
}
.app-title { font-size: 18px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-icon { background: none; border: none; color: #fff; font-size: 18px; cursor: pointer; }

/* --- SEARCH --- */
.search-container {
    display: none; background: var(--card-bg); padding: 10px 15px;
    border-bottom: 1px solid var(--border);
    position: sticky; top: 60px; z-index: 99;
}
.search-input {
    width: 100%; padding: 10px 15px; background: #2a2a2a; border: 1px solid #444;
    border-radius: 20px; color: #fff; outline: none;
}
.search-input:focus { border-color: var(--accent); }

/* --- GRID SYSTEM (Home & Bookmark) --- */
.grid-container {
    padding: 15px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px;
}
.video-card {
    background: var(--card-bg); border-radius: 10px; overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3); position: relative;
}
.thumb-wrapper {
    position: relative; width: 100%; padding-top: 56.25%; display: block; background: #000;
}
.thumb-img {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover;
}
.card-body { padding: 10px; }
.card-title {
    font-size: 12px; color: #e0e0e0; line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
/* Badge watched/delete */
.watched-badge, .btn-card-action {
    position: absolute; top: 5px; right: 5px;
    width: 25px; height: 25px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 12px;
}
.watched-badge { background: rgba(0,0,0,0.6); border: 1px solid #00ff00; color: #00ff00; }
.btn-card-action { background: rgba(0,0,0,0.7); color: #fff; cursor: pointer; }

/* --- LIST VIEW (History) --- */
.list-item { 
    display: flex; padding: 12px 15px; border-bottom: 1px solid #2a2a2a; 
    align-items: center; justify-content: space-between;
}
.list-content { display: flex; align-items: center; flex: 1; overflow: hidden; margin-right: 10px;}
.list-thumb { width: 110px; height: 65px; object-fit: cover; border-radius: 6px; margin-right: 12px; flex-shrink: 0; }
.list-info { flex: 1; min-width: 0; }
.list-date { font-size: 11px; color: var(--text-muted); margin-top: 4px;}

/* --- PLAYER (Watch Page) --- */
.player-wrapper { position: relative; width: 100%; padding-top: 56.25%; background: #000; }
.player-frame { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }
.info-section { padding: 20px; }
.video-meta { font-size: 12px; color: var(--text-muted); display: flex; gap: 15px; margin-bottom: 20px; }
.action-group { display: flex; gap: 10px; }
.btn-action {
    flex: 1; padding: 12px; border-radius: 8px; text-align: center;
    font-weight: 600; font-size: 14px; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary { background: var(--accent); color: white; }
.btn-secondary { background: #2a2a2a; color: #aaa; border: 1px solid #333; }

/* --- SCRAPER FORM --- */
.form-group { margin-bottom: 15px; }
.form-label { font-size: 12px; color: #aaa; margin-bottom: 5px; display: block; }
.form-control { width: 100%; padding: 12px; background: var(--card-bg); border: 1px solid #333; color: #fff; border-radius: 8px; outline: none; }
.card.selected { border: 2px solid #00ff00; }
.fab-save { 
    position: fixed; bottom: 80px; right: 20px; background: #00ff00; color: #000; 
    padding: 15px 25px; border-radius: 50px; font-weight: bold; box-shadow: 0 4px 10px rgba(0,255,0,0.3); border: none; cursor: pointer; z-index: 90;
    display: flex; align-items: center; gap: 10px;
}

/* --- BOTTOM NAV --- */
.bottom-nav { 
    position: fixed; bottom: 0; left: 0; width: 100%; 
    background: var(--card-bg); border-top: 1px solid var(--border); 
    display: flex; justify-content: space-around; align-items: center; 
    height: 65px; z-index: 1000; 
}
.nav-item { color: #666; display: flex; flex-direction: column; align-items: center; font-size: 10px; width: 60px; transition: color 0.3s; }
.nav-item i { font-size: 20px; margin-bottom: 4px; }
.nav-item.active { color: #fff; }
.nav-item.active i { color: var(--accent); }
.nav-fab-wrapper { position: relative; width: 60px; height: 100%; display: flex; justify-content: center; }
.nav-fab { 
    position: absolute; top: -25px; background: var(--accent); color: white; 
    width: 55px; height: 55px; border-radius: 50%; 
    display: flex; align-items: center; justify-content: center; font-size: 24px; 
    border: 5px solid var(--bg-color); 
}
/* --- AUTH PAGES (Login/Signup) --- */
.auth-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: radial-gradient(circle at top, #2a2a2a, #121212);
}
.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    text-align: center;
}
.auth-logo {
    font-size: 50px;
    color: var(--accent);
    margin-bottom: 20px;
}
.auth-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #fff;
}
.auth-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 30px;
}
.btn-auth {
    width: 100%;
    padding: 14px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
    transition: background 0.3s;
}
.btn-auth:hover { background: #e03e00; }
.auth-footer {
    margin-top: 20px;
    font-size: 14px;
    color: #888;
}
/* --- HERO SECTION (Featured Video) --- */
.hero-wrapper {
    position: relative; width: 100%; height: 250px;
    background: #000; overflow: hidden; margin-bottom: 20px;
}
.hero-img {
    width: 100%; height: 100%; object-fit: cover; opacity: 0.6;
}
.hero-overlay {
    position: absolute; bottom: 0; left: 0; width: 100%;
    background: linear-gradient(to top, #121212, transparent);
    padding: 20px;
}
.hero-tag {
    background: #FF4500; color: #fff; padding: 3px 8px;
    font-size: 10px; font-weight: bold; border-radius: 4px;
    text-transform: uppercase; display: inline-block; margin-bottom: 5px;
}
.hero-title {
    color: #fff; font-size: 18px; font-weight: bold;
    margin: 5px 0 10px 0; line-height: 1.3;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.btn-hero-play {
    display: inline-flex; align-items: center; gap: 8px;
    background: #fff; color: #000; padding: 8px 20px;
    border-radius: 4px; font-weight: bold; font-size: 13px;
    transition: transform 0.2s;
}
.btn-hero-play:active { transform: scale(0.95); }

/* --- HORIZONTAL SCROLL (Popular) --- */
.section-header {
    padding: 0 15px; margin-bottom: 10px;
    display: flex; justify-content: space-between; align-items: center;
}
.section-title { font-size: 16px; font-weight: bold; color: #fff; }

.scroll-container {
    display: flex; overflow-x: auto; gap: 10px; padding: 0 15px 15px 15px;
    scroll-behavior: smooth;
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}
.scroll-container::-webkit-scrollbar { display: none; } /* Chrome, Safari, Opera */

.scroll-item {
    flex: 0 0 140px; /* Lebar fix item scroll */
    position: relative;
}
.scroll-thumb {
    width: 100%; height: 200px; object-fit: cover; border-radius: 8px;
}
.scroll-overlay {
    position: absolute; bottom: 0; left: 0; width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    padding: 10px; border-bottom-left-radius: 8px; border-bottom-right-radius: 8px;
}

/* --- PAGINATION CENTER --- */
.pagination {
    display: flex; justify-content: center; align-items: center; 
    gap: 15px; margin: 30px 0 20px 0;
}
.page-btn {
    background: #333; color: white; 
    padding: 10px 20px; border-radius: 25px; 
    font-size: 14px; font-weight: 600;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    transition: background 0.3s;
}
.page-btn:hover { background: #FF4500; }
.page-btn:active { transform: scale(0.95); }

.auth-footer a { color: var(--accent); font-weight: 600; }
/* --- UTILS --- */
.text-center { text-align: center; }
.toast { background: rgba(40, 167, 69, 0.9); color: white; padding: 10px 15px; border-radius: 5px; margin-bottom: 15px; }