/* --- GLOBAL VARIABLES --- */
:root {
    --primary-color: #ff0055; /* Neon Red */
    --secondary-color: #00e5ff; /* Cyan */
    --bg-color: #050505;
    --card-bg: #121212;
    --panel-bg: #1a1a1a;
    --text-color: #ffffff;
    --glass-border: rgba(255, 255, 255, 0.15);
    --gradient: linear-gradient(135deg, #ff0055 0%, #ff4b1f 100%);
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

/* --- RESET & BASIC SETUP --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Roboto, Helvetica, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    padding-bottom: 70px; /* Space for bottom nav */
    overflow-x: hidden;
}

/* --- HEADER / TOP BAR --- */
.top-bar, .details-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 55px;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    z-index: 1000; /* High z-index */
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.logo {
    font-size: 18px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.5px;
}

.text-red {
    color: var(--primary-color);
    filter: drop-shadow(0 0 5px var(--primary-color));
}

.user-profile img {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 1px solid var(--secondary-color);
    cursor: pointer;
    transition: transform 0.2s;
}
.user-profile img:active { transform: scale(0.9); }

.back-btn {
    color: #fff; text-decoration: none; font-size: 14px; font-weight: 600;
    display: flex; align-items: center; gap: 10px;
    background: rgba(255, 255, 255, 0.1); padding: 6px 15px; border-radius: 20px;
}

/* --- USER INFO PANEL (PROFILE POPUP) --- */
/* এটি ডিফল্টভাবে লুকানো থাকবে (display: none) */
.user-info-panel {
    position: fixed;
    top: 60px; /* Header এর ঠিক নিচে */
    right: 10px;
    width: 220px;
    background: var(--panel-bg);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #333;
    box-shadow: 0 5px 20px rgba(0,0,0,0.8);
    z-index: 2000; /* Header এর উপরে বা সমান লেভেলে */
    display: none; /* Hidden by default */
}

/* JS দিয়ে active ক্লাস দিলে এটি শো করবে */
.user-info-panel.active {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.user-details { text-align: center; }
.user-details img {
    width: 60px; height: 60px; border-radius: 50%;
    margin-bottom: 10px; border: 2px solid var(--primary-color);
    padding: 2px;
}
.user-details h3 { font-size: 16px; margin-bottom: 5px; color: #fff; }
.user-details p { font-size: 12px; color: #aaa; }

/* --- MAIN CONTENT AREA --- */
.content-area {
    margin-top: 60px;
    padding: 5px;
    min-height: 80vh;
}

.section-title {
    margin: 10px 0 8px 5px;
    font-size: 14px;
    font-weight: 700;
    border-left: 3px solid var(--secondary-color);
    padding-left: 10px;
    text-transform: uppercase;
}

.hidden { display: none !important; }

/* --- 3 COLUMN GRID SYSTEM (HOMEPAGE) --- */
.post-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 Columns */
    gap: 6px;
}

/* --- POST CARD DESIGN --- */
.post-card {
    position: relative;
    background: var(--card-bg);
    border-radius: 6px;
    overflow: hidden;
    aspect-ratio: 9/13; /* Vertical Poster Style */
    cursor: pointer;
    border: 1px solid #2a2a2a;
    transition: transform 0.1s;
}
.post-card:active { transform: scale(0.95); }

.post-thumb { width: 100%; height: 100%; object-fit: cover; }

.post-overlay {
    position: absolute; bottom: 0; left: 0; width: 100%;
    background: linear-gradient(to top, #000 20%, transparent);
    padding: 30px 4px 4px 4px;
}

.post-title {
    font-size: 9px;
    font-weight: bold;
    line-height: 1.2;
    margin-bottom: 3px;
    color: #fff;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 1px 2px #000;
}

.post-meta {
    font-size: 8px;
    color: #ccc;
    display: flex;
    justify-content: space-between;
}

/* --- WATCHED STATUS STYLING --- */
.post-card.watched {
    border: 1px solid var(--primary-color); /* Red Border */
    box-shadow: 0 0 5px rgba(255, 0, 85, 0.4);
}
.watched-badge {
    position: absolute; top: 0; right: 0;
    background: var(--primary-color);
    color: white; font-size: 8px; padding: 2px 5px;
    border-bottom-left-radius: 6px; font-weight: bold;
    z-index: 10;
    box-shadow: -1px 1px 3px rgba(0,0,0,0.5);
}

/* --- SKELETON LOADER --- */
.skeleton-card {
    background: #1e1e1e;
    aspect-ratio: 9/13;
    border-radius: 6px;
    animation: pulse 1.5s infinite;
}
@keyframes pulse { 0% { opacity: 0.5; } 50% { opacity: 1; } 100% { opacity: 0.5; } }
.loader { text-align: center; padding: 10px; color: #666; font-size: 12px; display: none; }

/* --- TRENDING SLIDER --- */
.trending-grid { display: flex; overflow-x: auto; gap: 8px; padding-bottom: 5px; margin-bottom: 10px; }
.trending-card { min-width: 100px; height: 150px; aspect-ratio: auto; }

/* --- BOTTOM NAVIGATION --- */
.bottom-nav {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 94%;
    height: 50px;
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 9px;
    color: #777;
    text-decoration: none;
    transition: 0.2s;
    cursor: pointer;
}
.nav-item i { font-size: 18px; margin-bottom: 2px; }
.nav-item.active { color: var(--primary-color); transform: translateY(-2px); }
.nav-item.active i { filter: drop-shadow(0 0 5px var(--primary-color)); }

/* --- AD MODAL / OVERLAY --- */
.ad-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.9); z-index: 3000;
    display: none; justify-content: center; align-items: center;
    backdrop-filter: blur(5px);
}
.ad-overlay.active { display: flex; }

.ad-box {
    background: #151515; padding: 25px; border-radius: 12px;
    text-align: center; width: 85%; max-width: 300px;
    border: 1px solid var(--primary-color);
    position: relative;
    box-shadow: 0 0 25px rgba(255, 0, 85, 0.2);
}

.ad-box h3 { color: #fff; margin-bottom: 10px; }
.ad-status { color: var(--secondary-color); font-weight: bold; margin: 10px 0; }

/* Close Ad Button */
.close-ad-btn {
    position: absolute; top: -12px; right: -12px;
    width: 30px; height: 30px; background: #fff; color: #ff0055;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 16px; font-weight: bold; cursor: pointer;
    border: 2px solid var(--primary-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    z-index: 3001;
}

.btn-ad {
    background: var(--gradient); border: none; padding: 12px;
    border-radius: 25px; color: #fff; width: 100%;
    font-weight: bold; margin-top: 15px; font-size: 14px;
    box-shadow: 0 4px 10px rgba(255, 0, 85, 0.3);
    cursor: pointer;
}
.btn-unlock {
    background: #00c851; border: none; padding: 12px;
    border-radius: 25px; color: #fff; width: 100%;
    font-weight: bold; margin-top: 15px; cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 200, 81, 0.3);
}

/* --- DETAILS PAGE SPECIFIC --- */
.video-wrapper {
    background: #000; width: 100%;
    display: flex; flex-direction: column; gap: 5px;
    margin-top: 55px; /* Offset for header */
}
.video-container {
    width: 100%; background: #000; position: relative;
    display: flex; align-items: center; justify-content: center;
}
.video-container.horizontal { aspect-ratio: 16/9; }
.video-container.vertical { aspect-ratio: 9/16; max-height: 85vh; }

iframe, video { width: 100%; height: 100%; border: none; display: block; }

.controls-layer {
    position: absolute; top: 10px; right: 10px;
    color: #fff; background: rgba(0,0,0,0.6);
    padding: 4px 8px; border-radius: 4px; font-size: 11px;
    pointer-events: none;
}

.details-content {
    padding: 20px 15px; background: var(--bg-color); min-height: 40vh;
}
.details-title { font-size: 18px; margin-bottom: 12px; color: #fff; line-height: 1.4; }
.details-meta { font-size: 12px; color: #aaa; display: flex; gap: 20px; margin-bottom: 25px; border-bottom: 1px solid #333; padding-bottom: 15px; }

.dl-btn {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; padding: 14px; margin-bottom: 12px;
    background: linear-gradient(135deg, #007bff, #00c6ff);
    color: white; border-radius: 10px; text-decoration: none; font-weight: bold;
}