/* ==================================================
   1. BASE LAYER
================================================== */

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

/* THEME */
:root {
    --bg: #0f172a;
    --card: #111827;
    --text: #e5e7eb;
    --muted: #9ca3af;
    --accent: #3b82f6;
}

body {
    font-family: system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

.yt-wrapper {
    position: relative;
    cursor: pointer;
    overflow: hidden;
}

.yt-wrapper iframe {
    width: 100%;
    height: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
}

.yt-wrapper.hovering {
    transform: scale(1.02);
    transition: 0.2s ease;
}

/* ==================================================
   2. LAYOUT
================================================== */

/* HEADER */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #1f2937;
}

/* NAV */
nav {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    max-width: 900px;
    margin: auto;

    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
}

nav::-webkit-scrollbar {
    display: none;
}

/* NAV LINKS */
nav a {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    text-decoration: none;
    font-size: 14px;
    color: var(--muted);
    flex-shrink: 0;
}

nav a:hover {
    background: var(--card);
    color: var(--text);
}

nav a.active {
    background: var(--accent);
    color: white;
}

/* PAGE WRAPPER */
.container {
    max-width: 900px;
    margin: auto;
    padding: 20px;
}

/* TEXT CONTENT */
.content {
    background: var(--card);
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
}

/* ==================================================
   3. COMPONENTS
================================================== */

/* FEATURE IMAGE */
.featured {
    width: 100%;
    border-radius: 10px;
    margin-bottom: 20px;
}

/* HEADINGS */
h1 {
    font-size: 28px;
    margin-bottom: 15px;
}

/* VIDEO CARD */
.video-card {
    background: var(--card);
    padding: 10px;
    border-radius: 10px;
    transition: transform 0.2s;
}

.video-card:hover {
    transform: scale(1.02);
}

.video-card h3 {
    font-size: 14px;
    margin-bottom: 10px;
    color: var(--text);
}

/* THUMBNAIL */
.video-thumb {
    position: relative;
    cursor: pointer;
}

.video-thumb img {
    width: 100%;
    border-radius: 8px;
    display: block;
}

/* PLAY BUTTON */
.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 40px;
    color: white;
    background: rgba(0,0,0,0.6);
    border-radius: 50%;
    padding: 10px 15px;
}

/* ==================================================
   4. FEATURES
================================================== */

/* VIDEO GRID (VIDEO PAGE ONLY) */
.video-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

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

/* ==================================================
   SHORTS FEED (TIKTOK STYLE)
================================================== */

.shorts-feed {
    height: 100vh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
}

.shorts-item {
    height: 100vh;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: var(--bg);
}

.shorts-frame {
    width: 100%;
    max-width: 420px;
    aspect-ratio: 9 / 16;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.shorts-frame iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.shorts-title {
    margin-top: 12px;
    font-size: 14px;
    color: var(--text);
    text-align: center;
    padding: 0 10px;
}

.yt-wrapper {
    position: relative;
    width: 100%;
    max-width: 420px;
    aspect-ratio: 9 / 16;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
}

.yt-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.yt-video {
    width: 100%;
    height: 100%;
    border: 0;
}

.video-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.video-modal.hidden {
    display: none;
}

.video-modal-content {
    width: min(90vw, 600px);
    aspect-ratio: 9 / 16;
    background: #000;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
}

.video-modal-content iframe {
    width: 100%;
    height: 100%;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 20px;
    padding: 6px 10px;
    cursor: pointer;
    border-radius: 6px;
}

@media (max-width: 600px) {
    .shorts-frame {
        max-width: 100%;
        border-radius: 0;
    }
}

