/* ================================================
   VideoHub — Red / Magenta / Pink Theme
   ================================================ */

:root {
    --red: #E31B3A;
    --magenta: #C2185B;
    --pink: #F06292;
    --pink-light: #FCE4EC;
    --pink-pale: #FFF0F3;
    --crimson: #B71C1C;
    --accent: #FF4081;
    --accent-2: #F50057;

    --bg: #FFFFFF;
    --bg-alt: #FFF8FA;
    --bg-card: #FFFFFF;
    --text: #1A0A0F;
    --text-muted: #7A4A55;
    --text-light: #C2899A;
    --border: #F5D0D8;
    --shadow: rgba(195, 24, 91, 0.10);

    --max-width: 960px;
    --radius: 6px;
    --radius-sm: 4px;

    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'DM Sans', sans-serif;
}

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

html { font-size: 15px; scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--red); text-decoration: none; transition: color .2s; }
a:hover { color: var(--magenta); }

img { display: block; max-width: 100%; height: auto; }
ul { list-style: none; }

/* ── Layout ── */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 16px; }

main { flex: 1; }

/* ── Header ── */
.site-header {
    background: #fff;
    border-bottom: 2px solid var(--red);
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    box-shadow: 0 2px 12px var(--shadow);
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 24px;
    height: 58px;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 900;
    color: var(--text);
    white-space: nowrap;
    flex-shrink: 0;
}
.site-logo em { color: var(--red); font-style: normal; }
.logo-icon {
    background: linear-gradient(135deg, var(--red), var(--magenta));
    color: #fff;
    width: 30px; height: 30px;
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-size: .85rem;
}
.site-logo:hover { color: var(--text); }

.site-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    overflow-x: auto;
    scrollbar-width: none;
}
.site-nav::-webkit-scrollbar { display: none; }

.site-nav a {
    color: var(--text-muted);
    font-size: .82rem;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    transition: background .15s, color .15s;
}
.site-nav a:hover, .site-nav a.active {
    background: var(--pink-light);
    color: var(--red);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    margin-left: auto;
}
.nav-toggle span {
    display: block;
    width: 22px; height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform .3s, opacity .3s;
}

/* ── Footer ── */
.site-footer {
    background: linear-gradient(135deg, #1A0A0F 0%, #3D0A1E 100%);
    color: rgba(255,255,255,.75);
    width: 100%;
    margin-top: 48px;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 40px 16px 32px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 32px;
}

.footer-brand .site-logo { color: #fff; }
.footer-brand .site-logo em { color: var(--pink); }
.footer-brand .logo-icon { background: linear-gradient(135deg, var(--pink), var(--accent)); }
.footer-brand p { margin-top: 12px; font-size: .82rem; opacity: .65; line-height: 1.7; }

.footer-links h4 {
    font-family: var(--font-display);
    font-size: .95rem;
    color: #fff;
    margin-bottom: 12px;
}
.footer-links ul li { margin-bottom: 7px; }
.footer-links a { color: rgba(255,255,255,.55); font-size: .82rem; transition: color .2s; }
.footer-links a:hover { color: var(--pink); }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.1);
}
.footer-bottom-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 14px 16px;
    text-align: center;
    font-size: .78rem;
    opacity: .45;
}

/* ── Section Heading ── */
.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
}

.section-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}
.section-title span { color: var(--red); }

.view-all {
    font-size: .78rem;
    font-weight: 600;
    color: var(--red);
    text-transform: uppercase;
    letter-spacing: .05em;
    display: flex;
    align-items: center;
    gap: 4px;
}
.view-all::after { content: '→'; }
.view-all:hover { color: var(--magenta); }

/* ── Video Grid ── */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 14px;
}

/* ── Video Card ── */
.video-card {
    display: block;
    max-width: 120px;
    color: var(--text);
    text-decoration: none;
    width: 100%;
}

.video-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--pink-light);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 7px;
}

.video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.badge-unavailable {
    position: absolute;
    bottom: 4px;
    left: 4px;
    background: rgba(0,0,0,.72);
    color: #fff;
    font-size: .6rem;
    font-weight: 600;
    padding: 2px 5px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.video-info {}

.video-title {
    font-size: .74rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}

.video-category {
    font-size: .68rem;
    color: var(--red);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 2px;
}

.video-meta {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.video-date, .video-views {
    font-size: .66rem;
    color: var(--text-light);
}

/* ── Page Sections ── */
.page-section { margin-bottom: 36px; }

.page-hero {
    background: linear-gradient(135deg, var(--red) 0%, var(--magenta) 50%, #AD1457 100%);
    padding: 28px 0 24px;
    margin-bottom: 32px;
    width: 100%;
}

.page-hero-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 16px;
}

.page-hero h1 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    color: #fff;
    line-height: 1.2;
}

.page-hero p {
    color: rgba(255,255,255,.8);
    font-size: .88rem;
    margin-top: 6px;
}

/* ── Watch Page ── */
.watch-layout {
    max-width: var(--max-width);
    margin: 24px auto;
    padding: 0 16px;
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 24px;
    align-items: start;
}

.watch-player-wrap {
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 16 / 9;
    margin-bottom: 16px;
}
.watch-player-wrap iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.watch-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.35;
}

.watch-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .8rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.watch-meta .cat-badge {
    background: var(--pink-light);
    color: var(--red);
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 600;
    font-size: .73rem;
}

.watch-desc-box {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    font-size: .85rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 24px;
}

.related-section h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    margin-bottom: 12px;
    color: var(--text);
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
}

/* Right column sidebar */
.sidebar-videos { display: flex; flex-direction: column; gap: 0; }

.sidebar-video {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
}
.sidebar-video:last-child { border-bottom: none; }

.sidebar-thumb {
    width: 80px;
    flex-shrink: 0;
    aspect-ratio: 16/9;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--pink-light);
}
.sidebar-thumb img { width: 100%; height: 100%; object-fit: cover; }

.sidebar-info {}
.sidebar-title {
    font-size: .75rem;
    font-weight: 600;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 3px;
}
.sidebar-meta { font-size: .67rem; color: var(--text-light); }

/* ── Category Page ── */
.category-page { max-width: var(--max-width); margin: 0 auto; padding: 0 16px 40px; }

.category-header-bar {
    background: linear-gradient(135deg, var(--red), var(--magenta));
    color: #fff;
    padding: 24px 0;
    margin-bottom: 28px;
    width: 100%;
}
.category-header-bar-inner { max-width: var(--max-width); margin: 0 auto; padding: 0 16px; }
.category-header-bar h1 { font-family: var(--font-display); font-size: 1.7rem; }
.category-header-bar p { font-size: .85rem; opacity: .8; margin-top: 4px; }

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 14px;
}

.load-more-wrap { text-align: center; margin-top: 28px; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 22px;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: transform .15s, box-shadow .15s, background .2s;
}
.btn-primary {
    background: linear-gradient(135deg, var(--red), var(--magenta));
    color: #fff;
    box-shadow: 0 2px 10px rgba(195,24,91,.3);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(195,24,91,.4);
    color: #fff;
}
.btn-outline {
    background: #fff;
    color: var(--red);
    border: 1.5px solid var(--red);
}
.btn-outline:hover { background: var(--pink-light); color: var(--red); }

/* ── Admin ── */
.admin-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    min-height: 100vh;
}

.admin-sidebar {
    background: linear-gradient(180deg, #1A0A0F 0%, #3D0A1E 100%);
    padding: 0;
    display: flex;
    flex-direction: column;
}

.admin-brand {
    padding: 20px 18px 16px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.admin-brand .site-logo { color: #fff; font-size: 1.1rem; }
.admin-brand .site-logo em { color: var(--pink); }
.admin-brand .logo-icon { background: linear-gradient(135deg, var(--pink), var(--accent)); width: 26px; height: 26px; font-size: .75rem; }
.admin-subtitle { color: rgba(255,255,255,.35); font-size: .72rem; margin-top: 4px; padding-left: 34px; text-transform: uppercase; letter-spacing: .08em; }

.admin-nav { padding: 12px 0; flex: 1; }
.admin-nav a {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 18px;
    color: rgba(255,255,255,.6);
    font-size: .82rem;
    font-weight: 500;
    transition: background .15s, color .15s;
    position: relative;
}
.admin-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.admin-nav a.active {
    background: rgba(255,255,255,.1);
    color: #fff;
}
.admin-nav a.active::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--pink);
    border-radius: 0 2px 2px 0;
}
.admin-nav .nav-icon { font-size: 1rem; width: 18px; text-align: center; }
.admin-nav .nav-sep {
    margin: 8px 18px;
    border: none;
    border-top: 1px solid rgba(255,255,255,.08);
}

.admin-main {
    background: #F9F1F4;
    display: flex;
    flex-direction: column;
}

.admin-topbar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.admin-topbar h1 { font-family: var(--font-display); font-size: 1.2rem; color: var(--text); }
.admin-topbar .breadcrumb { font-size: .75rem; color: var(--text-light); }

.admin-content { padding: 24px 28px; flex: 1; }

/* ── Admin Cards / Tables ── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(135deg, var(--red), var(--magenta));
}
.stat-card .stat-val {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--red);
}
.stat-card .stat-label { font-size: .75rem; color: var(--text-muted); margin-top: 4px; }

.admin-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 24px;
}

.admin-card-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.admin-card-header h2 { font-size: .95rem; font-weight: 600; }
.admin-card-body { padding: 20px; }

table { width: 100%; border-collapse: collapse; font-size: .83rem; }
thead { background: var(--pink-pale); }
th { padding: 10px 14px; text-align: left; font-weight: 600; color: var(--text-muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--pink-pale); }

.table-thumb { width: 48px; height: 27px; object-fit: cover; border-radius: 3px; }

.action-btns { display: flex; gap: 6px; }
.btn-xs {
    padding: 4px 10px;
    font-size: .73rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: background .15s, color .15s;
    text-decoration: none;
    display: inline-block;
}
.btn-edit { background: #FFF0F3; color: var(--red); border-color: var(--pink-light); }
.btn-edit:hover { background: var(--pink-light); color: var(--magenta); }
.btn-del { background: #FFF0F0; color: #B71C1C; border-color: #FFCDD2; }
.btn-del:hover { background: #FFCDD2; color: #B71C1C; }
.btn-toggle { background: #F3F3F3; color: #555; border-color: #ddd; }
.btn-toggle:hover { background: #e0e0e0; }

/* ── Forms ── */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: .82rem; font-weight: 600; margin-bottom: 6px; color: var(--text-muted); }
.form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: .85rem;
    color: var(--text);
    background: #fff;
    transition: border-color .2s;
    outline: none;
}
.form-control:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(227,27,58,.1); }
textarea.form-control { resize: vertical; min-height: 100px; }

.form-hint { font-size: .73rem; color: var(--text-light); margin-top: 4px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.alert {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: .83rem;
    margin-bottom: 16px;
    border-left: 4px solid;
}
.alert-success { background: #E8F5E9; color: #2E7D32; border-color: #4CAF50; }
.alert-error { background: #FFEBEE; color: #C62828; border-color: #EF5350; }

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: .68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.badge-active { background: #E8F5E9; color: #2E7D32; }
.badge-inactive { background: #FFEBEE; color: #C62828; }
.badge-ep-yes { background: #E3F2FD; color: #1565C0; }
.badge-ep-no { background: #FFF3E0; color: #E65100; }

.search-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}
.search-form .form-control { flex: 1; }

/* ── Pagination ── */
.pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 28px;
    flex-wrap: wrap;
}
.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    font-size: .83rem;
    font-weight: 600;
    border: 1.5px solid var(--border);
    color: var(--text-muted);
}
.pagination a:hover { background: var(--pink-light); border-color: var(--pink); color: var(--red); }
.pagination .current { background: var(--red); border-color: var(--red); color: #fff; }

/* ── Empty State ── */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
}
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 12px; }
.empty-state p { font-size: .88rem; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .site-nav {
        display: none;
        position: absolute;
        top: 58px;
        left: 0; right: 0;
        background: #fff;
        border-bottom: 2px solid var(--red);
        flex-direction: column;
        padding: 8px 0;
        gap: 0;
        box-shadow: 0 8px 24px rgba(0,0,0,.1);
    }
    .site-nav.open { display: flex; }
    .site-nav a { border-radius: 0; padding: 10px 20px; border-bottom: 1px solid var(--border); }
    .nav-toggle { display: flex; }

    .footer-inner { grid-template-columns: 1fr; gap: 20px; }

    .watch-layout { grid-template-columns: 1fr; }

    .admin-layout { grid-template-columns: 1fr; }
    .admin-sidebar {
        position: fixed;
        left: -220px;
        top: 0; bottom: 0;
        width: 220px;
        z-index: 200;
        transition: left .3s;
    }
    .admin-sidebar.open { left: 0; }
    .admin-main { padding-top: 0; }
    .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .video-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .video-card { max-width: none; }

    .admin-content { padding: 16px; }
}

@media (min-width: 481px) and (max-width: 640px) {
    .video-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 641px) and (max-width: 900px) {
    .video-grid { grid-template-columns: repeat(5, 1fr); }
}

@media (min-width: 901px) {
    .video-grid { grid-template-columns: repeat(8, 1fr); }
}

/* Truncate long embed codes in table */
td .embed-preview {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: monospace;
    font-size: .7rem;
    color: var(--text-muted);
}
