@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@300;400;500;600;700&family=Bebas+Neue&display=swap');

:root {
    /* JavFun Branding - Pornhub Inspired */
    --primary: #ff9000; 
    --primary-hover: #e68200;
    --primary-glow: rgba(255, 144, 0, 0.4);
    
    --bg-dark: #000000;
    --bg-card: #0f0f12;
    --bg-elevated: #1a1a1f;
    --bg-glass: rgba(15, 15, 18, 0.95);
    
    --text-main: #ffffff;
    --text-sub: #bcbcbc;
    --text-muted: #707070;
    
    --border: rgba(255, 255, 255, 0.07);
    --border-hover: rgba(255, 255, 255, 0.15);
    
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.6);
    --shadow-md: 0 8px 32px rgba(0,0,0,0.8);
    --shadow-lg: 0 20px 60px rgba(0,0,0,1);
    
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    --font-main: 'Inter', sans-serif;
    --font-heading: 'Outfit', sans-serif;
    --font-brand: 'Bebas Neue', cursive;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1); }

/* HEADER */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: var(--bg-glass);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--border);
    padding: 0 5%;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-family: var(--font-brand);
    font-size: 32px;
    color: #fff;
    display: flex;
    align-items: center;
    letter-spacing: 1px;
}
.logo span { 
    background: var(--primary); 
    color: #000;
    padding: 2px 8px; 
    border-radius: 4px; 
    margin-left: 2px;
    font-weight: 900;
}

.search-bar {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 5px 15px;
    width: 100%;
    max-width: 600px;
    display: flex;
    align-items: center;
}
.search-bar input {
    background: transparent;
    border: none;
    color: #fff;
    padding: 10px;
    width: 100%;
    outline: none;
    font-family: var(--font-main);
}
.search-bar button {
    background: transparent;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 18px;
}

/* NAVIGATION */
nav { display: flex; gap: 28px; align-items: center; }
nav a { font-weight: 600; font-size: 15px; color: var(--text-main); text-transform: uppercase; }
nav a:hover, nav a.active { color: var(--primary); }

/* GRID SYSTEM */
.section { padding: 40px 5%; margin-top: 72px; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; border-bottom: 2px solid var(--bg-elevated); padding-bottom: 10px; }
.section-title { font-family: var(--font-heading); font-size: 22px; font-weight: 800; display: flex; align-items: center; gap: 10px; color: #fff; }
.section-title i { color: var(--primary); }

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* VIDEO CARD */
.video-card {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: 0.3s;
    position: relative;
}
.video-card:hover {
    transform: scale(1.02);
    z-index: 2;
    box-shadow: var(--shadow-lg);
}
.video-thumb {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
}
.video-thumb img { width: 100%; height: 100%; object-fit: cover; transition: 0.5s; }
.video-card:hover .video-thumb img { transform: scale(1.1); }

.video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.85);
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 800;
}
.video-info { padding: 12px; }
.video-title {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    height: 40px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 8px;
    color: #eee;
}
.video-meta { font-size: 11px; color: var(--text-muted); display: flex; justify-content: space-between; font-weight: 600; }

/* LAYOUTS */
.video-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 30px;
}

@media (max-width: 1024px) {
    .video-layout {
        grid-template-columns: 1fr;
    }
}

/* PLAYER */
.player-wrapper {
    position: relative;
    box-shadow: 0 0 40px rgba(255, 144, 0, 0.1);
    transition: box-shadow 0.5s;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.player-container {
    background: #000;
    aspect-ratio: 16/9;
    width: 100%;
}
.player-container iframe { width: 100%; height: 100%; border: none; }

.video-info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    padding: 18px 25px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    gap: 20px;
}
.video-stats { display: flex; gap: 25px; font-size: 14px; color: var(--text-sub); font-weight: 600; }

@media (max-width: 768px) {
    .video-info-bar { flex-direction: column; align-items: flex-start; padding: 15px; }
    .video-stats { flex-wrap: wrap; gap: 15px; font-size: 12px; }
    .video-actions { width: 100%; }
}


.server-btn {
    background: #222;
    border: 1px solid #333;
    color: #ccc;
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    transition: 0.2s;
}

.server-btn:hover {
    background: #333;
    color: #fff;
    border-color: #444;
}

.server-btn.active {
    background: var(--primary);
    color: #000;
    border-color: var(--primary);
}

/* UTILS */
.tag { background: var(--bg-elevated); padding: 6px 14px; border-radius: 4px; font-size: 12px; font-weight: 700; color: var(--text-sub); }
.tag:hover, .tag.active { background: var(--primary); color: #000; }

.btn {
    padding: 10px 24px;
    border-radius: 4px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    text-transform: uppercase;
    font-size: 13px;
}
.btn-primary { background: var(--primary); color: #000; }
.btn-primary:hover { background: var(--primary-hover); }

/* CATEGORIES */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
}
.cat-box {
    display: block;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    aspect-ratio: 16/9;
    border: 1px solid #222;
    background: #000;
}
.cat-thumb {
    width: 100%;
    height: 100%;
    position: relative;
}
.cat-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.5s;
    filter: brightness(0.6);
}
.cat-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: 0.3s;
}
.cat-overlay i { font-size: 24px; color: var(--primary); }
.cat-overlay span { font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: #fff; text-shadow: 0 2px 4px rgba(0,0,0,0.8); }

.cat-box:hover .cat-thumb img { transform: scale(1.1); filter: brightness(0.8); }
.cat-box:hover .cat-overlay { background: rgba(0,0,0,0.1); }

@media (max-width: 768px) {
    .cat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .cat-box { aspect-ratio: 3/2; }
    .cat-overlay span { font-size: 10px; letter-spacing: 0; }
    .cat-overlay i { font-size: 16px; }
}

@media (max-width: 480px) {
    .cat-grid { grid-template-columns: repeat(2, 1fr); }
    .cat-box { aspect-ratio: 4/3; }
}

/* CPA */
.cpa-banner {
    background: #111;
    padding: 30px;
    border-radius: var(--radius-sm);
    border-left: 5px solid var(--primary);
    margin: 40px 0;
}

@media (max-width: 768px) {
    header { padding: 0 10px; height: 60px; display: flex; justify-content: space-between; align-items: center; flex-direction: row; }
    .logo { font-size: 20px; flex-shrink: 0; }
    
    .search-bar { max-width: 150px; padding: 4px 10px; background: #111; border-radius: 4px; border: 1px solid #333; }
    .search-bar input { padding: 4px; font-size: 11px; }
    .search-bar button { font-size: 13px; }
    
    .section { padding: 15px 10px; margin-top: 60px; }
    .section-title { font-size: 18px; }
    
    .video-grid { 
        grid-template-columns: repeat(2, 1fr); 
        gap: 10px; 
    }
    
    .video-info { padding: 8px; }
    .video-title { font-size: 12px; height: 34px; margin-bottom: 5px; }
    .video-meta { font-size: 10px; }
    
    .player-container { margin-bottom: 15px; border-radius: 0; margin-left: -10px; width: calc(100% + 20px); }
    
    .video-sidebar { margin-top: 30px; }
    
    /* Hide nav on mobile to save space */
    nav { display: none; }
    
    .btn { padding: 8px 15px; font-size: 11px; }
    
    .cpa-banner { padding: 20px; font-size: 13px; }
    .cpa-banner h2 { font-size: 18px; }
}

/* Extra small devices */
@media (max-width: 380px) {
    .video-grid { grid-template-columns: 1fr; }
    .logo { font-size: 22px; }
}

/* ADS */
.ad-container {
    text-align: center;
    padding: 20px 0;
    background: #000;
    border-bottom: 1px solid var(--border);
    margin-top: 72px; /* Clear fixed header */
    position: relative;
    z-index: 10;
    overflow: hidden;
}

.ad-mobile { display: none; }
.ad-desktop { display: block; }

/* If Ad is present, remove the extra top margin from the section to prevent double gap */
.ad-container ~ .section,
.ad-container ~ main.section {
    margin-top: 0;
}

@media (max-width: 768px) {
    .ad-container {
        margin-top: 60px; /* Mobile header height */
        padding: 15px 5px;
    }
    .ad-desktop { display: none; }
    .ad-mobile { display: block; }
}
