:root {
    --bg: #08080d;
    --bg-surface: #0f0f17;
    --bg-card: #141420;
    --primary: #6c5ce7;
    --primary-hover: #5a4bcf;
    --text: #e8e8f0;
    --text-secondary: #8888a0;
    --font: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --transition: 0.2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font);
    line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; outline: none; background: transparent; color: inherit; }

.container { max-width: 1400px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
    position: sticky;
    top: 0;
    background: rgba(15, 15, 23, 0.95);
    backdrop-filter: blur(10px);
    height: 56px;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.header-inner { display: flex; align-items: center; height: 100%; justify-content: space-between; }
.logo { font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.main-nav a { margin-left: 20px; color: var(--text-secondary); transition: var(--transition); }
.main-nav a:hover { color: var(--text); }

/* Video Grid */
.page-main { padding: 40px 20px; }
.section-title { margin-bottom: 24px; font-size: 1.5rem; font-weight: 600; }
.video-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}
@media (max-width: 1200px) { .video-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 992px) { .video-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) { .video-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .video-grid { grid-template-columns: 1fr; } }

/* Video Card */
.video-card { display: block; transition: transform var(--transition); }
.video-card:hover { transform: translateY(-4px); }
.thumb-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 10px;
}
.thumb { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.duration-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}
.card-info { padding: 0 4px; }
.card-title {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-meta { font-size: 0.875rem; color: var(--text-secondary); display: flex; gap: 6px; }

/* Watch Layout */
.watch-layout { display: flex; gap: 24px; padding: 24px 20px; }
.watch-main { flex: 1; min-width: 0; }
.watch-sidebar { width: 350px; flex-shrink: 0; }
@media (max-width: 992px) {
    .watch-layout { flex-direction: column; }
    .watch-sidebar { width: 100%; }
}

/* Player */
.player-wrapper { width: 100%; background: #000; border-radius: 12px; overflow: hidden; margin-bottom: 20px; position: relative; }
.player-container { width: 100%; padding-top: 56.25%; position: relative; }
#video-player { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

/* Ad Overlay */
.ad-overlay { position: absolute; bottom: 60px; left: 50%; transform: translateX(-50%); z-index: 50; background: rgba(0,0,0,0.5); padding: 10px; }
.ad-close { position: absolute; top: -20px; right: 0; background: #000; color: #fff; padding: 2px 8px; border-radius: 4px; }

/* Custom Controls Base */
.v-controls {
    position: absolute; bottom: 0; left: 0; width: 100%; background: linear-gradient(0deg, rgba(0,0,0,0.8) 0%, transparent 100%);
    padding: 40px 15px 10px; opacity: 0; transition: opacity 0.3s; z-index: 10; display: flex; flex-direction: column;
}
.player-container:hover .v-controls, .v-controls.active { opacity: 1; }

.v-progress-container { width: 100%; height: 5px; background: rgba(255,255,255,0.2); cursor: pointer; position: relative; margin-bottom: 10px; border-radius: 2px; }
.v-progress-container:hover { height: 7px; }
.v-buffered { position: absolute; top: 0; left: 0; height: 100%; background: rgba(255,255,255,0.4); border-radius: 2px; }
.v-played { position: absolute; top: 0; left: 0; height: 100%; background: var(--primary); border-radius: 2px; }
.v-handle { position: absolute; top: 50%; transform: translate(-50%, -50%); width: 12px; height: 12px; background: var(--primary); border-radius: 50%; opacity: 0; transition: opacity 0.2s; pointer-events: none;}
.v-progress-container:hover .v-handle { opacity: 1; }
.v-time-tooltip { position: absolute; bottom: 15px; background: rgba(0,0,0,0.8); padding: 4px 8px; border-radius: 4px; font-size: 12px; transform: translateX(-50%); display: none; pointer-events: none; }

.v-bottom-row { display: flex; align-items: center; gap: 15px; color: #fff; }
.v-btn { color: #fff; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; }
.v-btn:hover { color: var(--primary); }
.v-time-display { font-size: 13px; font-variant-numeric: tabular-nums; }
.v-spacer { flex: 1; }

.v-volume-container { display: flex; align-items: center; gap: 5px; }
.v-volume-slider { width: 60px; height: 4px; -webkit-appearance: none; background: rgba(255,255,255,0.3); outline: none; border-radius: 2px; cursor: pointer; }
.v-volume-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 10px; height: 10px; border-radius: 50%; background: #fff; cursor: pointer; }

.v-speed-menu { position: absolute; bottom: 50px; right: 50px; background: rgba(20,20,32,0.95); border-radius: 8px; padding: 10px 0; display: none; }
.v-speed-menu.active { display: block; }
.v-speed-opt { display: block; width: 100%; padding: 8px 20px; text-align: left; color: #fff; }
.v-speed-opt:hover { background: rgba(255,255,255,0.1); }

.v-play-overlay { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 64px; height: 64px; background: rgba(0,0,0,0.6); border-radius: 50%; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.2s, transform 0.2s; pointer-events: none; }
.v-play-overlay.animate { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }

/* Video Info */
.video-title { font-size: 1.25rem; font-weight: 600; margin-bottom: 12px; }
.video-actions-meta { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 15px; margin-bottom: 20px; }
.meta-stats { color: var(--text-secondary); font-size: 0.9rem; }
.actions { display: flex; gap: 10px; }
.btn { background: var(--bg-card); color: var(--text); padding: 8px 16px; border-radius: 20px; font-weight: 500; font-size: 0.9rem; display: inline-flex; align-items: center; gap: 6px; transition: background var(--transition); }
.btn:hover { background: rgba(255,255,255,0.1); }
.video-description { background: var(--bg-surface); padding: 15px; border-radius: 12px; font-size: 0.95rem; color: #ccc; }

/* Sidebar */
.sidebar-title { font-size: 1.1rem; margin-bottom: 15px; }
.related-grid { display: flex; flex-direction: column; gap: 12px; }
.related-card { display: flex; gap: 12px; }
.related-card .thumb-wrapper { width: 160px; margin-bottom: 0; padding-top: 90px; flex-shrink: 0; }
.related-card .card-title { font-size: 0.95rem; -webkit-line-clamp: 2; }
@media (max-width: 480px) {
    .related-card { flex-direction: column; }
    .related-card .thumb-wrapper { width: 100%; padding-top: 56.25%; }
}

/* Pagination */
.pagination { display: flex; justify-content: center; align-items: center; gap: 15px; margin-top: 40px; }

/* Toasts */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 1000; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--primary); color: #fff; padding: 12px 20px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.2); animation: slideIn 0.3s forwards; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--bg-card); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #333; }

/* Enhanced Player Styles */
.v-hide-cursor { cursor: none !important; }
.v-hide-cursor * { cursor: none !important; }

.v-end-screen {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8); z-index: 40;
    display: flex; align-items: center; justify-content: center; gap: 20px;
    opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.v-end-screen.active { opacity: 1; pointer-events: auto; }
.v-end-btn {
    background: rgba(255,255,255,0.1); border: 2px solid rgba(255,255,255,0.2);
    color: #fff; padding: 12px 24px; border-radius: 8px; font-size: 1.1rem;
    font-weight: 500; display: flex; align-items: center; gap: 8px;
    transition: background 0.2s, transform 0.2s;
}
.v-end-btn:hover { background: rgba(255,255,255,0.2); transform: scale(1.05); }

.v-play-overlay {
    transition: opacity 0.3s ease-out, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
