:root {
    --bg: #0a0d13;
    --panel: #151923;
    --line: rgba(255, 255, 255, .08);
    --text: #f6f7fb;
    --muted: #8f98a9;
    --accent: #ff4f68;
    --accent2: #ff6b81;
    --violet: #8b5cf6;
    --shadow: 0 18px 50px rgba(0, 0, 0, .34)
}

* {
    box-sizing: border-box
}

html,
body {
    margin: 0;
    padding: 0
}

body {
    min-height: 100vh;
    color: var(--text);
    background: radial-gradient(circle at 20% 0%, rgba(139, 92, 246, .10), transparent 26%), linear-gradient(180deg, #0b0e14, #0a0d13);
    font-family: Georgia, "Times New Roman", serif
}

button,
a {
    font: inherit
}

button {
    cursor: pointer
}

.container {
    width: min(100% - 30px, 1200px);
    margin: 0 auto
}

.home-header {
    padding: 28px 0 18px;
    border-bottom: 1px solid var(--line);
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.home-header h1 {
    margin: 0;
    font-size: clamp(22px, 3vw, 30px)
}

.home-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    padding: 30px 0 55px
}

.card {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: 15px;
    background: linear-gradient(180deg, rgba(23, 27, 36, 0.8), rgba(21, 24, 32, 0.8));
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 28px #00000033;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-decoration: none;
    display: block;
    color: inherit
}

.card:hover {
    transform: translateY(-5px);
    border-color: rgba(139, 92, 246, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, .3), 0 0 20px rgba(139, 92, 246, 0.15);
}

.thumb {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: linear-gradient(135deg, #05060a, #171221 48%, #090b10)
}

.thumb-image,
.thumb-video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #080a0f;
    pointer-events: none;
}

.thumb-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, .04), rgba(0, 0, 0, .42));
    pointer-events: none
}

.thumb-play {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 64px;
    height: 64px;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    background: rgba(50, 52, 58, .72);
    box-shadow: 0 10px 26px rgba(0, 0, 0, .26);
    transition: .18s;
    z-index: 2;
}

.thumb-play:hover {
    transform: translate(-50%, -50%) scale(1.07);
    background: rgba(255, 79, 104, .85)
}

.play-triangle {
    width: 0;
    height: 0;
    margin-left: 4px;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 16px solid #fff
}

.card-body {
    padding: 16px
}

.card-title {
    margin: 0 0 8px;
    font-size: 16px;
    line-height: 1.35;
    font-weight: 700
}

.card-meta {
    display: flex;
    gap: 18px;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 15px
}

.download {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 18px;
    border-radius: 999px;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    box-shadow: 0 8px 20px rgba(255, 79, 104, .17)
}

.player {
    width: 100%;
    max-width: 980px;
    margin: 20px auto;
    border: 1px solid rgba(255, 255, 255, .10);
    border-radius: 20px;
    background: linear-gradient(180deg, #131823, #0d1118);
    box-shadow: 0 28px 90px rgba(0, 0, 0, .55)
}

.player-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 18px;
    border-bottom: 1px solid var(--line)
}

.player-top h2 {
    margin: 0;
    font-size: 19px;
    max-width: calc(100% - 55px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

.close {
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: #fff;
    background: #1a202c;
    font-size: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.player-main {
    padding: 18px
}

.player-wrap {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    background: #000
}

.player-video {
    display: block;
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: contain;
    background: #000
}

.player-poster {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    z-index: 1;
    transition: opacity .25s
}

.player-poster.hidden {
    opacity: 0;
    visibility: hidden
}

.center-toggle {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 3;
    width: 82px;
    height: 82px;
    transform: translate(-50%, -50%);
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .40);
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, rgba(139, 92, 246, .94), rgba(236, 72, 153, .94));
    box-shadow: 0 16px 45px rgba(0, 0, 0, .42), 0 0 0 7px rgba(255, 255, 255, .07);
    transition: .18s
}

.center-toggle:hover {
    transform: translate(-50%, -50%) scale(1.06)
}

.center-toggle.playing {
    opacity: .05;
    transform: translate(-50%, -50%) scale(.86)
}

.player-wrap:hover .center-toggle.playing,
.center-toggle:focus-visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1)
}

.icon-play {
    width: 0;
    height: 0;
    margin-left: 5px;
    border-top: 14px solid transparent;
    border-bottom: 14px solid transparent;
    border-left: 21px solid #fff
}

.icon-pause {
    display: none;
    gap: 6px
}

.icon-pause i {
    display: block;
    width: 7px;
    height: 25px;
    border-radius: 2px;
    background: #fff
}

.center-toggle.playing .icon-play {
    display: none
}

.center-toggle.playing .icon-pause {
    display: flex
}

.player-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    flex-wrap: wrap
}

.status {
    color: var(--muted);
    font-size: 12px
}

.sponsor-note {
    padding: 7px 11px;
    border-radius: 999px;
    color: #e8dfff;
    background: rgba(139, 92, 246, .12);
    border: 1px solid rgba(139, 92, 246, .24);
    font-size: 11px;
    font-weight: 700
}

.player-actions {
    display: flex;
    justify-content: center;
    margin-top: 15px
}

.player-actions a {
    min-width: 180px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 18px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent2))
}

.popup-note {
    margin-top: 9px;
    color: var(--muted);
    text-align: center;
    font-size: 11px;
    min-height: 16px
}

@media(max-width:900px) {
    .home-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }
}

@media(max-width:620px) {
    .container {
        width: min(100% - 18px, 1200px)
    }

    .home-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding-top: 20px
    }

    .player {
        width: 100%;
        height: 100%;
        max-height: none;
        border: 0;
        border-radius: 0;
        margin: 0;
    }

    .player-main {
        padding: 12px
    }

    .center-toggle {
        width: 68px;
        height: 68px
    }

    .icon-play {
        border-top-width: 11px;
        border-bottom-width: 11px;
        border-left-width: 17px
    }

    .icon-pause i {
        width: 6px;
        height: 21px
    }

    .player-actions a {
        width: 100%
    }
}

.cw-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: rgba(0, 0, 0, .78);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    border-radius: 15px;
    text-align: center;
    padding: 24px
}

.cw-overlay.show {
    display: flex
}

.cw-icon {
    font-size: 38px;
    line-height: 1
}

.cw-title {
    font-size: 17px;
    font-weight: 800;
    color: #fff;
    margin: 0
}

.cw-sub {
    font-size: 12px;
    color: rgba(255, 255, 255, .55);
    margin: 0
}

.cw-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 13px 32px;
    border: none;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 800;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, var(--violet), var(--accent));
    box-shadow: 0 8px 28px rgba(255, 79, 104, .35);
    transition: .18s;
    letter-spacing: .02em
}

.cw-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 34px rgba(255, 79, 104, .48)
}

.cw-btn-triangle {
    width: 0;
    height: 0;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-left: 11px solid #fff
}

.post-navigation {
    display: flex;
    justify-content: space-between;
    max-width: 980px;
    margin: 20px auto;
    gap: 10px;
}

.post-navigation a {
    padding: 12px 24px;
    background: linear-gradient(180deg, #171b24, #151820);
    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: 10px;
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    box-shadow: 0 10px 20px rgba(0, 0, 0, .2);
    transition: 0.2s;
    display: inline-block;
}

.post-navigation a:hover {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 10px 20px rgba(255, 79, 104, .3);
}

.popular-posts-header {
    max-width: 980px;
    margin: 40px auto 10px;
    font-size: 20px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 10px;
}

.popular-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    max-width: 980px;
    margin: 0 auto 40px;
}

@media(max-width:900px) {
    .popular-posts-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }
}

@media(max-width:620px) {
    .popular-posts-grid {
        grid-template-columns: 1fr
    }
}

.admin-container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 20px;
    background: #131823;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--line);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stat-box {
    background: #1a202c;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-box h3 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: var(--muted);
}

.stat-box .value {
    font-size: 24px;
    font-weight: bold;
    color: var(--accent);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th,
td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

th {
    background: rgba(0, 0, 0, 0.2);
}

td a {
    color: var(--violet);
    text-decoration: none;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
}

.form-group input {
    width: 100%;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #0a0d13;
    color: #fff;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    background: var(--violet);
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.btn-danger {
    background: #ff4757;
}

/* Sidebar Layout UI */
.admin-layout {
    display: flex;
    min-height: 100vh;
    background: #0a0d13;
}

.admin-sidebar {
    width: 260px;
    background: #11151e;
    border-right: 1px solid var(--line);
    padding: 30px 0;
    display: flex;
    flex-direction: column;
}

.admin-sidebar h2 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 30px;
    color: #fff;
    font-size: 20px;
}

.admin-nav-item {
    padding: 16px 25px;
    color: var(--muted);
    text-decoration: none;
    font-weight: bold;
    border-left: 4px solid transparent;
    cursor: pointer;
    transition: 0.2s;
    background: transparent;
    border-top: none;
    border-right: none;
    border-bottom: none;
    text-align: left;
    width: 100%;
    font-size: 15px;
    display: block;
}

.admin-nav-item:hover,
.admin-nav-item.active {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border-left-color: var(--violet);
}

.admin-content {
    flex: 1;
    padding: 40px;
    max-height: 100vh;
    overflow-y: auto;
}

.admin-section {
    display: none;
    animation: fadeIn 0.3s;
    max-width: 1100px;
    margin: 0 auto;
}

.admin-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.toggle-status-btn {
    padding: 5px 10px;
    border-radius: 4px;
    border: none;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    color: #fff;
    display: inline-block;
}

.status-active {
    background: #2ed573;
}

.status-disabled {
    background: #ffa502;
    color: #000;
}

/* Custom Video Player Controls */
.custom-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(0deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 100%);
    padding: 20px 15px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 6;
    opacity: 0;
    transition: opacity 0.3s;
}

.player-wrap:hover .custom-controls {
    opacity: 1;
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    transition: height 0.2s;
}

.progress-bar-container:hover {
    height: 8px;
}

.progress-bar-filled {
    height: 100%;
    background: var(--violet);
    border-radius: 3px;
    width: 0%;
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
}

.controls-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.ctrl-btn {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    transition: transform 0.2s;
}

.ctrl-btn:hover {
    transform: scale(1.1);
    color: var(--violet);
}

.volume-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.volume-slider {
    width: 70px;
    cursor: pointer;
    accent-color: var(--violet);
}

.time-display {
    color: white;
    font-size: 13px;
    font-family: monospace;
}

@media (max-width: 500px) {
    .volume-slider { width: 40px; }
    .controls-row { gap: 10px; }
}