/* 
   JAV CMS - Premium Theme Stylesheet 
   Design System: Dark Matte Slate with Emerald Neon Gradient Accents
*/

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
    --bg-dark: #08080c;
    --bg-card: #111116;
    --bg-navbar: rgba(8, 8, 12, 0.85);
    --border-color: rgba(255, 255, 255, 0.05);
    
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    
    --accent-color: #10b981;
    --accent-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --accent-hover: #34d399;
    --accent-glow: rgba(16, 185, 129, 0.25);
    
    --danger-color: #ef4444;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    
    --font-heading: 'Outfit', sans-serif;
    --font-sans: 'Plus Jakarta Sans', sans-serif;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --transition-speed: 0.25s;
}

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

/* Premium Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: #1e1e24;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

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

a {
    color: inherit;
    text-decoration: none;
    transition: all var(--transition-speed);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
}

/* NAVBAR (Glassmorphism) */
.navbar {
    position: sticky;
    top: 0;
    background-color: var(--bg-navbar);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    gap: 20px;
}

.logo {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 4px;
}

.logo span {
    color: var(--accent-color);
    text-shadow: 0 0 12px var(--accent-glow);
}

.logo-img {
    height: 34px;
    width: auto;
    display: block;
}

.taxonomy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.taxonomy-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background-color: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--border-radius);
    padding: 12px 16px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.taxonomy-chip:hover {
    border-color: var(--accent-color);
    color: #fff;
    transform: translateY(-2px);
}

.taxonomy-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.taxonomy-count {
    flex-shrink: 0;
    background: var(--accent-gradient);
    color: #000;
    font-size: 11px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 10px;
}

.logo-badge {
    background: var(--accent-gradient);
    color: #000;
    font-size: 11px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-links {
    display: flex;
    gap: 24px;
    align-items: center;
    list-style: none;
}

.nav-link {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.nav-link:hover, .nav-link.active {
    color: var(--accent-hover);
}

.search-box {
    position: relative;
    width: 320px;
    flex-shrink: 1;
}

.search-box input {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 8px 16px 8px 42px;
    color: #fff;
    font-family: var(--font-sans);
    font-size: 13.5px;
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-color);
    background-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.15);
}

.search-box svg {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    fill: var(--text-muted);
    pointer-events: none;
}

/* MAIN CONTENT */
main {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 24px 20px;
}

/* ALERTS */
.alert-container {
    margin-bottom: 20px;
}

.alert {
    padding: 12px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 12px;
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: blur(8px);
}

.alert-success { background-color: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.2); color: #a7f3d0; }
.alert-danger { background-color: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.2); color: #fecaca; }
.alert-warning { background-color: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.2); color: #fef08a; }
.alert-info { background-color: rgba(59, 130, 246, 0.1); border: 1px solid rgba(59, 130, 246, 0.2); color: #bfdbfe; }

/* VIDEO GRID */
.video-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

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

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

.video-card {
    background-color: transparent;
    border-radius: 10px;
    overflow: hidden;
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    position: relative;
}

.video-card:hover {
    transform: translateY(-5px);
}

.video-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 66.66%; /* 2:3 portrait (matches jav.guru cover ratio) -> fills width, no left/right bars, no crop */
    background-color: #000;
    border-radius: 10px;
    overflow: hidden;
}

.video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* fills the whole box, zero empty space; box ratio matches portrait covers so no crop */
    background-color: #000;
    transition: filter var(--transition-speed);
}

.video-card:hover .video-thumbnail img {
    filter: brightness(1.06);
}

/* Bottom gradient for badge legibility (jav.guru style) */
.video-thumbnail::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0) 55%, rgba(0,0,0,0.55) 100%);
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-speed);
    z-index: 1;
}

.video-card:hover .video-thumbnail::after {
    opacity: 1;
}

/* Play button overlay on hover */
.play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.85);
    width: 52px;
    height: 52px;
    background: var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55);
    pointer-events: none;
    z-index: 2;
}

.play-btn svg {
    width: 24px;
    height: 24px;
    fill: #04130d;
    margin-left: 3px;
}

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

.badge-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background-color: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(4px);
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 700;
    border-radius: 4px;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 3;
}

.badge-actress {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    color: #fff;
    padding: 3px 8px;
    font-size: 10px;
    font-weight: 700;
    border-radius: 4px;
    border-right: 3px solid var(--accent-hover);
    letter-spacing: 0.3px;
    z-index: 3;
    max-width: 60%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.badge-code {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    color: #fff;
    padding: 3px 8px;
    font-size: 10px;
    font-weight: 800;
    border-radius: 4px;
    border-left: 3px solid var(--accent-color);
    letter-spacing: 0.4px;
    z-index: 3;
}

.video-info {
    padding: 10px 4px 0;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.video-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    min-height: 38px;
    text-decoration: none;
    letter-spacing: 0.2px;
}

.video-title:hover {
    color: var(--accent-hover);
}

.video-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: auto;
}

.video-genre-chip {
    font-size: 9.5px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 600;
    letter-spacing: 0.2px;
    text-transform: uppercase;
    white-space: nowrap;
    transition: background 0.2s ease, color 0.2s ease;
}

.video-genre-chip:hover {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
}

/* PAGINATION */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 30px;
}

.page-btn {
    padding: 8px 14px;
    border-radius: var(--border-radius-sm);
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 13px;
    transition: all var(--transition-speed);
}

.page-btn:hover:not(.disabled) {
    background-color: var(--accent-color);
    color: #000;
    font-weight: 700;
    border-color: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-glow);
}

.page-btn.active {
    background-color: var(--accent-color);
    color: #000;
    font-weight: 700;
    border-color: var(--accent-color);
}

.page-btn.disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* VIDEO PLAYER SECTION */
.video-player-container {
    width: 100%;
    margin-bottom: 20px;
}

.video-ratio {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    background-color: #000;
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
}

.video-ratio iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.no-player-alert {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    background: radial-gradient(circle, #102e23 0%, #08080c 100%);
}

.no-player-alert svg {
    width: 44px;
    height: 44px;
    fill: var(--accent-color);
    margin-bottom: 12px;
}

/* SERVER SELECTION TABS */
.server-tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    background-color: var(--bg-card);
    padding: 8px 12px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.server-tab {
    padding: 6px 14px;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--border-radius-sm);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-speed);
}

.server-tab:hover {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--accent-hover);
    border-color: rgba(16, 185, 129, 0.2);
}

.server-tab.active {
    background-color: var(--accent-color);
    color: #000;
    font-weight: 700;
    border-color: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-glow);
}

/* DETAILS PAGE LAYOUT */
.video-content-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 24px;
}

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

.video-detail-info {
    background-color: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 24px;
    border: 1px solid var(--border-color);
}

.video-detail-title {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.4;
    color: #fff;
    margin-bottom: 16px;
}

.metadata-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.metadata-item {
    display: grid;
    grid-template-columns: 110px 1fr;
    font-size: 13.5px;
}

.metadata-label {
    color: var(--text-muted);
    font-weight: 500;
}

.metadata-value {
    color: var(--text-primary);
    font-weight: 600;
}

.metadata-value a {
    color: var(--accent-hover);
}

.metadata-value a:hover {
    text-decoration: underline;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.tag-badge {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11.5px;
    color: var(--text-secondary);
    font-weight: 500;
}

.tag-badge:hover {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--accent-hover);
    border-color: rgba(16, 185, 129, 0.2);
}

/* ACTIONS */
.video-actions {
    display: flex;
    justify-content: flex-end;
}

.btn-report {
    background-color: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.15);
    color: #fecaca;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all var(--transition-speed);
}

.btn-report:hover {
    background-color: var(--danger-color);
    color: #fff;
    border-color: var(--danger-color);
}

/* ADMIN PANEL LAYOUT */
.admin-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 24px;
    min-height: 70vh;
}

@media (max-width: 768px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }
}

.admin-sidebar {
    background-color: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 16px;
    border: 1px solid var(--border-color);
    height: fit-content;
}

.admin-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.admin-menu-item a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--border-radius-sm);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-secondary);
}

.admin-menu-item a:hover, .admin-menu-item.active a {
    background: var(--accent-gradient);
    color: #000;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2);
}

.admin-content {
    background-color: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 20px;
    border: 1px solid var(--border-color);
}

.admin-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* STAT CARDS */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
    text-align: center;
}

.stat-val {
    font-size: 28px;
    font-weight: 800;
    color: var(--accent-hover);
    margin-bottom: 2px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* TABLES */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.admin-table th {
    padding: 10px 14px;
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    color: var(--text-muted);
}

.admin-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.admin-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.01);
}

/* FORMS */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--border-radius-sm);
    padding: 8px 12px;
    color: #fff;
    font-family: var(--font-sans);
    font-size: 13.5px;
    transition: all var(--transition-speed);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.15);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
    cursor: pointer;
}

.form-check input {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-color);
    cursor: pointer;
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--border-radius-sm);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all var(--transition-speed);
    text-align: center;
}

.btn-primary {
    background: var(--accent-gradient);
    color: #000;
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-danger {
    background-color: var(--danger-color);
    color: #fff;
}

.btn-danger:hover {
    background-color: #f87171;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 11.5px;
    border-radius: 4px;
}

/* LOGIN SCREEN */
.login-container {
    max-width: 380px;
    width: 100%;
    margin: 80px auto;
    background-color: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 24px;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

/* AD SLOTS */
.ad-slot {
    margin: 20px auto;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
}

.ad-header { margin: 12px auto; }
.ad-under-player { margin: 16px auto; }
.ad-footer { margin: 24px auto; }

/* FOOTER */
footer {
    background-color: #040406;
    border-top: 1px solid var(--border-color);
    padding: 24px 20px;
    text-align: center;
    margin-top: auto;
    font-size: 12px;
    color: var(--text-muted);
}

/* RECOMMENDATION CARDS */
.rec-card {
    background-color: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    gap: 12px;
    border: 1px solid var(--border-color);
    transition: all var(--transition-speed);
}

.rec-card:hover {
    border-color: rgba(16, 185, 129, 0.25);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transform: translateX(4px);
}

.rec-thumbnail-link {
    width: 112px;
    flex-shrink: 0;
    position: relative;
}

.rec-thumbnail-wrapper {
    width: 100%;
    padding-top: 56.25%; /* 16:9 landscape, full image */
    background: #000;
    overflow: hidden;
    position: relative;
    border-radius: 6px;
}

.rec-thumbnail-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain; /* whole image, never cropped */
    background-color: #000;
    transition: filter var(--transition-speed);
}

.rec-card:hover .rec-thumbnail-wrapper img {
    filter: brightness(1.06);
}

.rec-details {
    padding: 8px 12px 8px 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

.rec-title {
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.35;
}

.rec-title:hover {
    color: var(--accent-hover);
}

.rec-code {
    font-size: 10px;
    font-weight: 700;
    color: var(--accent-hover);
}
