/* --- 1. GLOBAL SETTINGS & VARIABLES --- */
:root {
    --accent: #86efac;
    --white: #ffffff;
    --dark: #050505;
    --font-h: 'Oswald', sans-serif;
    --max-w: 1600px; /* Restored to Wide Layout */
    --max-w-legal: 1000px; /* Constrained for readability on legal pages */
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

body { 
    background: var(--dark); 
    color: var(--white); 
    font-family: 'Inter', sans-serif; 
    overflow-x: hidden; 
    line-height: 1.6;
}

/* --- 2. HERO SECTION --- */
.hero {
    position: relative;
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--dark);
    background-size: cover;
    background-position: center;
}

body.misc-page .hero {
    height: 50vh;
}

body.gallery-page .hero {
    height: 90vh;
}

body.report-page .hero {
    height: 90vh;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.5) contrast(1.1);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, transparent 20%, var(--dark) 90%);
    z-index: 2;
}

.hero-content { 
    position: relative; 
    z-index: 3; 
    text-align: center; 
    max-width: 900px; 
    padding: 20px; 
}

.hero h1 { 
    font-family: var(--font-h); 
    font-size: clamp(2.5rem, 8vw, 5.5rem); 
    text-transform: uppercase; 
    line-height: 0.85; 
    margin-bottom: 25px;
    letter-spacing: -1px;
    color: var(--white);
}

.hero a {
    display: inline-block;
    text-decoration: none;
    color: #000;
    background: var(--accent);
    padding: 18px 45px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-radius: 50px;
    transition: 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}

.hero a:hover { transform: scale(1.05); background: #fff; box-shadow: 0 10px 20px rgba(0,0,0,0.3); }

/* --- 3. SUB-NAVIGATION --- */
.sub-nav {
    width: 100%;
    background: #0a0a0a;
    border-bottom: 1px solid #1a1a1a;
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    gap: 40px;
    justify-content: center;
}

.nav-link {
    font-family: var(--font-h);
    color: #666;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 2px;
    transition: 0.3s;
}

.nav-link:hover, .nav-link.active {
    color: var(--accent);
}

/* --- 4. MAIN LAYOUT & GALLERY --- */
.content-wrapper {
    max-width: var(--max-w); /* Wide layout for gallery */
    margin: 0 auto;
    padding: 80px 40px;
}

/* Specific width for legal pages to keep text readable */
body:not(.gallery-page) .content-wrapper {
    max-width: var(--max-w-legal);
    color: #ccc;
}

.daily-analysis-teaser {
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 30px 20px;
    text-align: center;
}

.analysis-container {
    max-width: 800px;
    margin: 0 auto;
}

.analysis-badge {
    display: inline-block;
    color: var(--accent);
    font-size: 0.7rem;
    font-weight: 900;
    padding: 4px 12px;
    border-radius: 4px;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.analysis-title {
    font-family: 'Oswald', sans-serif;
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: var(--white);
}

.analysis-text {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--white);
}

.read-more-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: bold;
    margin-left: 5px;
    text-align: right;
    float: right;
}

.read-more-link:hover {
    text-decoration: underline;
}

/* Main Section Wrapper */
.analysis-leaderboard-section {
    max-width: 1600px;
    margin: 40px auto; /* Centers the section and adds vertical spacing */
    padding: 0 20px;   /* Prevents cards from hitting screen edges on mobile */
    width: 100%;
    box-sizing: border-box;
}

/* Layout Grid Container */
.analysis-grid {
    display: flex;
    gap: 24px;
    flex-wrap: wrap; /* Allows stacking on smaller screens */
    align-items: stretch; /* Ensures both cards are the same height */
}

/* Base Card Styling */
.card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    flex: 1; 
    min-width: 340px; /* Forces stack on mobile/small tablets */
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.view-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px); /* Modern touch */
    color: white;
    padding: 4px 10px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.3s ease;
    z-index: 10;
    pointer-events: none;
}

.card:hover .view-badge,
.card.active-hover .view-badge {
    opacity: 1;
    transform: translateY(0);
}

.view-badge svg {
    stroke: #ff0000;
}

.card-actions {
    cursor: pointer;
    display: flex;
    gap: 8px;
    padding: 2px 5px 2px 5px;
    background: var(--dark);
    position: absolute;
    top: 12px;
    right: 12px;
}

.action-link {
    font-size: 12px;
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Last Report Link */
.report-available { color: #007bff; }
.report-unavailable { color: #999; }

/* Paid Trigger Link */
.paid-trigger {
    color: #28a745;
    background: rgba(40, 167, 69, 0.1);
    padding: 6px 10px;
    border-radius: 4px;
    transition: background 0.2s;
}

.paid-trigger:hover {
    background: rgba(40, 167, 69, 0.2);
}

.paid-trigger svg {
    fill: #28a745;
}

/* --- Left Card: Analysis Teaser --- */
.analysis-card {
    border-left: 5px solid #4f46e5; /* Distinctive accent for the analysis */
}

.analysis-badge {
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.analysis-text {
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--white);
    margin-bottom: 20px;
    flex-grow: 1; /* Pushes the "Read More" link to the bottom */
}

/* --- Right Card: Leaderboard --- */
.leaderboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f3f4f6;
}

.update-tag {
    font-size: 11px;
    color: var(--accent); /* Green for "live" feel */
    background: var(--dark);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid #f9fafb;
}

.leaderboard-item:last-child { border-bottom: none; }

.rank {
    font-size: 1.2rem;
    font-weight: 800;
    color: #d1d5db;
    width: 40px;
}

/* Highlight #1 */
.leaderboard-item:first-child .rank {
    color: #fbbf24; /* Gold color for rank 1 */
}

.item-info {
    flex-grow: 1;
    overflow: hidden;
}

.creator-handle {
    font-weight: 700;
    color: var(--white);
    text-decoration: none;
    font-size: 1rem;
    display: block;
}

.creator-handle:hover {
    color: var(--accent);
    text-decoration: underline;
}

.video-title {
    font-size: 0.85rem;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.stats {
    text-align: right;
    min-width: 100px;
}

.view-count {
    font-weight: 200;
    font-size: 0.9rem;
    color: var(--accent);
}

/* Responsive Tweaks */
@media (max-width: 768px) {
    .analysis-grid {
        gap: 16px;
    }
    .card {
        min-width: 100%;
    }
}

.main-feed {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 50px;
    width: 100%;
}

/* Cards & Thumbnails */
.card, .ad-card {
    position: relative;
    aspect-ratio: 16/10;
    background: #111;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid #1a1a1a;
    transition: border-color 0.3s;
}

.card:hover { border-color: var(--accent); }
.thumbnail { width: 100%; height: 100%; object-fit: cover; opacity: 0.8; transition: 0.6s cubic-bezier(0.19, 1, 0.22, 1); }
.card:hover .thumbnail { transform: scale(1.08); opacity: 0.5; }

/* Video Play Buttons */
.play-btn {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 60px; height: 60px;
    background: var(--accent);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: 0.3s;
}
.card:hover .play-btn { opacity: 1; }
.play-btn svg { width: 20px; fill: #000; margin-left: 3px; }

/* Card Info */
.card-info {
    position: absolute;
    bottom: 0; left: 0; width: 100%;
    padding: 25px;
    background: linear-gradient(transparent, rgba(0,0,0,0.95));
}
.card-info h3 { font-family: var(--font-h); font-size: 1.2rem; text-transform: uppercase; color: #fff; line-height: 1.2; }

/* Ad & Service Cards */
.ad-card { display: flex; flex-direction: column; align-items: center; justify-content: center; background: #0a0a0a; border: 1px dashed #333; }
.ad-tag { font-size: 0.6rem; color: #444; letter-spacing: 2px; margin-bottom: 10px; text-transform: uppercase; }

/* --- 5. LIGHTBOX & MODALS --- */
#lightbox {
    position: fixed; inset: 0; background: rgba(0,0,0,0.98);
    z-index: 1000; display: none; align-items: center; justify-content: center;
}
.video-box { width: 90%; max-width: 1200px; aspect-ratio: 16/9; position: relative; }

/* --- 6. LEGAL TEXT STYLING (Privacy/Terms) --- */
.content-wrapper h2 { 
    font-family: var(--font-h); 
    color: var(--accent); 
    text-transform: uppercase; 
    margin-top: 40px; 
    margin-bottom: 15px; 
}

.content-wrapper b { color: var(--white); }
.content-wrapper p { margin-bottom: 20px; }
.content-wrapper ul { margin-bottom: 20px; padding-left: 20px; }
.content-wrapper a { color: var(--accent); text-decoration: none; }
.content-wrapper a:hover { text-decoration: underline; }

/* --- 7. COOKIE CONSENT BANNER --- */
#cookie-consent {
    position: fixed; 
	bottom: 20px; 
	left: 50%;
    transform: translateX(-50%);
    width: 90%; 
	max-width: 1200px;
    background: rgba(15, 15, 15, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid #333; 
	padding: 25px;
    z-index: 10000; 
	display: none;
    justify-content: space-between; 
	align-items: center;
    border-radius: 8px; 
	box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.consent-content h4 { font-family: var(--font-h); color: var(--accent); margin-bottom: 8px; text-transform: uppercase; }
.consent-content p { font-size: 0.85rem; color: #ccc; line-height: 1.4; }
.consent-btns { display: flex; gap: 10px; }
.btn-consent { padding: 10px 20px; border: none; border-radius: 4px; cursor: pointer; font-weight: 900; font-size: 0.75rem; transition: 0.3s; }
.btn-accept { background: var(--accent); color: var(--dark); }
.btn-reject { background: #333; color: var(--white); }

#sentinel {
    height: 10px;
    width: 100%;
    clear: both; /* Prevents floating elements from overlapping it */
    margin-top: 20px;
}

.loader-container {
    grid-column: 1 / -1; /* Ensures spinner stays centered across grid rows */
    display: none;
    justify-content: center;
    padding: 40px;
}

/* --- 8. FOOTER & LOADER --- */
footer { 
    text-align: center; 
    padding: 40px; 
    border-top: 1px solid #1a1a1a; 
    margin-top: 60px; 
    font-size: 0.8rem; 
    color: #444; 
}

.spinner { width: 40px; height: 40px; border: 4px solid rgba(255, 255, 255, 0.1); border-left-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- 9. RESPONSIVE QUERIES --- */
@media (max-width: 1200px) { .main-feed { grid-template-columns: repeat(2, 1fr); gap: 30px; } }

@media (max-width: 768px) { 
    .main-feed { grid-template-columns: 1fr; }
    .nav-container { gap: 20px; }
    #cookie-consent { flex-direction: column; text-align: center; bottom: 0; width: 100%; border-radius: 0; }
    .consent-content { margin-right: 0; margin-bottom: 20px; }
}