@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

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

:root {
    --accent: #ff1744;
    --accent2: #ff6ec7;
    --glow: rgba(255, 23, 68, 0.45);
    --glow2: rgba(255, 110, 199, 0.3);
    --bg: #080608;
    --bg2: #100d12;
    --card: #130f16;
    --border: rgba(255,255,255,0.07);
    --text: #f0e6f6;
    --muted: #7a6d84;
}

body {
    background: var(--bg);
    background-image:
        radial-gradient(ellipse 80% 40% at 50% -10%, rgba(255,23,68,0.12) 0%, transparent 70%),
        radial-gradient(ellipse 60% 30% at 90% 80%, rgba(255,110,199,0.07) 0%, transparent 60%);
    background-attachment: fixed;
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    padding-bottom: 86px;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ── BROWSER NOTICE ── */
.in-app-browser-notice {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #f6d365;
    color: #111;
    border-bottom: 1px solid rgba(0, 0, 0, 0.18);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    text-align: left;
}

.in-app-browser-notice div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.in-app-browser-notice strong {
    font-size: 0.95rem;
    line-height: 1.2;
}

.in-app-browser-notice span {
    font-size: 0.8rem;
    line-height: 1.25;
}

.in-app-browser-notice button {
    border: 0;
    border-radius: 999px;
    background: #111;
    color: #fff;
    cursor: pointer;
    font-weight: 700;
    padding: 9px 14px;
    white-space: nowrap;
}

.in-app-browser-notice button:active {
    transform: scale(0.98);
}

/* ── HEADER ── */
header {
    background: rgba(8, 6, 8, 0.85);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 1.6rem;
    font-weight: 900;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.5px;
}

.logo-icon {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 900;
    font-style: italic;
    box-shadow: 0 0 16px var(--glow);
}

.logo span:last-child {
    background: linear-gradient(90deg, #fff 0%, var(--accent2) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

nav {
    display: flex;
    gap: 6px;
    align-items: center;
}

nav a {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 20px;
    transition: all 0.2s;
}

nav a:hover,
nav a.active {
    color: #fff;
    background: rgba(255,255,255,0.08);
}

/* ── HERO ── */
.hero {
    text-align: center;
    padding: 56px 20px 36px;
    position: relative;
}

.hero h1 {
    font-size: 2.6rem;
    font-weight: 900;
    letter-spacing: -1px;
    line-height: 1.1;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #fff 0%, var(--accent2) 60%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    color: var(--muted);
    font-size: 1.05rem;
    max-width: 500px;
    margin: 0 auto;
}

/* ── VIDEO GRID ── */
.video-grid {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px 40px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 20px;
}

.video-card {
    background: var(--card);
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
    cursor: pointer;
}

.video-card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 12px 40px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,23,68,0.3), 0 0 30px var(--glow);
    border-color: rgba(255,23,68,0.4);
}

.thumb-wrapper {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.thumb-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s;
}

.video-card:hover .thumb-wrapper img {
    transform: scale(1.08);
}

.thumb-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 50%);
    pointer-events: none;
}

.thumb-wrapper .play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    width: 54px;
    height: 54px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #fff;
    opacity: 0;
    transition: opacity 0.25s, transform 0.25s;
    box-shadow: 0 0 24px var(--glow);
    z-index: 2;
}

.video-card:hover .play-icon {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.thumb-wrapper .duration {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    z-index: 2;
    backdrop-filter: blur(4px);
}

.video-info {
    padding: 14px 16px 16px;
}

.video-info h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 6px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-meta {
    font-size: 0.8rem;
    color: var(--muted);
}

/* ── WATCH PAGE ── */
.watch-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 20px;
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 28px;
}

.player-container {
    width: 100%;
}

.video-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0,0,0,0.8), 0 0 0 1px var(--border);
}

.video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.card-preview-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #000;
}

.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
}

.play-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 20px;
}

.play-btn-icon {
    width: 84px;
    height: 84px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #fff;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 30px var(--glow), 0 0 60px var(--glow2);
}

.play-btn:hover .play-btn-icon {
    transform: scale(1.12);
    box-shadow: 0 8px 40px var(--glow), 0 0 80px var(--glow2);
}

.play-btn-text {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    text-shadow: 0 2px 10px rgba(0,0,0,0.9);
}

.video-details {
    padding: 20px 0;
}

.video-details h1 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
    line-height: 1.3;
}

.video-stats {
    display: flex;
    gap: 8px;
    color: var(--muted);
    font-size: 0.88rem;
    margin-bottom: 16px;
}

.video-description {
    color: #9a8da6;
    font-size: 0.93rem;
    line-height: 1.7;
}

/* ── RELATED VIDEOS ── */
.related-videos h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.related-card {
    display: flex;
    gap: 12px;
    padding: 10px 8px;
    border-radius: 10px;
    transition: background 0.2s;
    margin-bottom: 4px;
}

.related-card:hover {
    background: rgba(255,255,255,0.05);
}

.related-thumb {
    position: relative;
    width: 150px;
    min-width: 150px;
    aspect-ratio: 16/9;
    border-radius: 8px;
    overflow: hidden;
}

.related-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.related-card:hover .related-thumb img {
    transform: scale(1.05);
}

.related-thumb .duration {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
}

.related-info {
    padding: 2px 0;
}

.related-info h4 {
    font-size: 0.88rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 5px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-info p {
    font-size: 0.78rem;
    color: var(--muted);
}

/* ── ADS ── */
.ad-banner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 10px 20px;
}

.ad-banner-top {
    display: flex;
    justify-content: center;
    padding-top: 16px;
    padding-bottom: 10px;
}

.ad-banner-player {
    max-width: none;
    padding: 0 0 18px;
    display: flex;
    justify-content: center;
}

.ad-banner-footer {
    display: flex;
    justify-content: center;
    padding: 18px 20px 0;
}

.sticky-footer-ad {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 950;
    max-width: none;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: rgba(8, 6, 8, 0.96);
    border-top: 1px solid var(--border);
    backdrop-filter: blur(16px);
}

.ad-slot {
    display: block;
    overflow: visible;
    position: relative;
    line-height: 0;
}

.ad-slot-300x250 {
    width: 300px;
    min-height: 250px;
    max-width: 100%;
}

.ad-slot-320x50 {
    width: 320px;
    min-height: 50px;
    max-width: 100%;
}

.ad-placeholder {
    background: rgba(255,255,255,0.02);
    border: 1px dashed rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
}

/* ── FOOTER ── */
footer {
    text-align: center;
    padding: 32px 20px;
    color: var(--muted);
    font-size: 0.82rem;
    border-top: 1px solid var(--border);
    margin-top: 40px;
    margin-bottom: 16px;
}

/* ── ADMIN ── */
.admin-body {
    padding-bottom: 0;
}

.admin-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 32px 0 48px;
}

.admin-topbar {
    position: static;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 22px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.admin-topbar h1,
.admin-card h1,
.admin-card h2 {
    color: #fff;
    line-height: 1.2;
}

.admin-topbar p,
.admin-card p,
.admin-help {
    color: var(--muted);
}

.admin-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-actions a,
.admin-video-item a {
    background: rgba(255,255,255,0.07);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: #fff;
    padding: 8px 12px;
    transition: background 0.2s;
}

.admin-actions a:hover,
.admin-video-item a:hover {
    background: rgba(255,255,255,0.12);
}

.admin-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 22px;
    margin-bottom: 18px;
}

.admin-login-card {
    max-width: 430px;
    margin: 10vh auto 0;
}

.admin-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 18px;
}

.admin-form {
    display: grid;
    gap: 14px;
    margin-top: 16px;
}

.admin-form label {
    color: #ccc;
    display: grid;
    gap: 7px;
    font-size: 0.9rem;
}

.admin-form input,
.admin-form textarea {
    width: 100%;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    color: #fff;
    font: inherit;
    padding: 11px 12px;
    transition: border-color 0.2s;
}

.admin-form input:focus,
.admin-form textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.admin-form textarea {
    min-height: 110px;
    resize: vertical;
}

.admin-form input[type="file"] {
    padding: 9px;
}

.admin-form button,
.admin-danger {
    background: linear-gradient(135deg, var(--accent), #c7003c);
    border: 0;
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
    font-weight: 700;
    padding: 11px 14px;
    transition: opacity 0.2s, transform 0.15s;
}

.admin-form button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.admin-danger {
    background: #3a0f14;
    border: 1px solid #5f1418;
}

.admin-alert {
    border-radius: 12px;
    margin-bottom: 18px;
    padding: 12px 14px;
}

.admin-alert-success {
    background: rgba(32, 156, 90, 0.12);
    border: 1px solid rgba(32, 156, 90, 0.3);
    color: #7ee0ad;
}

.admin-alert-error {
    background: rgba(229, 9, 20, 0.12);
    border: 1px solid rgba(229, 9, 20, 0.3);
    color: #ff9aa2;
}

.admin-video-list {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.admin-video-item {
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border);
    border-radius: 14px;
    display: grid;
    grid-template-columns: 150px 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 12px;
}

.admin-video-item img {
    width: 150px;
    aspect-ratio: 16/9;
    border-radius: 10px;
    object-fit: cover;
}

.admin-video-item h3 {
    color: #fff;
    font-size: 1rem;
}

.admin-video-item p {
    font-size: 0.82rem;
    color: var(--muted);
    margin: 4px 0 10px;
    word-break: break-all;
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
    .watch-page {
        grid-template-columns: 1fr;
    }

    .related-videos {
        margin-top: 20px;
    }

    .admin-grid,
    .admin-video-item {
        grid-template-columns: 1fr;
    }

    .admin-video-item img {
        width: 100%;
    }

    .admin-topbar {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 600px) {
    .header-inner {
        flex-direction: column;
        gap: 10px;
    }

    nav {
        gap: 4px;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .hero p {
        font-size: 0.92rem;
    }

    .video-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 0 12px 32px;
    }

    .watch-page {
        padding: 12px;
    }

    .ad-banner-player {
        padding-bottom: 12px;
    }

    .ad-banner-footer {
        padding: 14px 12px 0;
    }

    .sticky-footer-ad {
        padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    }

    .in-app-browser-notice {
        align-items: stretch;
        flex-direction: column;
        gap: 8px;
        padding: 10px 12px;
        text-align: center;
    }

    .in-app-browser-notice button {
        width: 100%;
    }

    .video-wrapper {
        border-radius: 10px;
    }

    .play-btn-icon {
        width: 68px;
        height: 68px;
        font-size: 1.7rem;
    }

    .play-btn-text {
        font-size: 1rem;
    }

    .video-details h1 {
        font-size: 1.2rem;
    }

    .related-thumb {
        width: 120px;
        min-width: 120px;
    }
}
