/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-family: 'Helvetica Neue', Arial, sans-serif; -webkit-text-size-adjust: 100%; }
body { background: #181818; color: #ccc; font-size: 14px; line-height: 1.5; }
a { color: #D19625; text-decoration: none; }
a:hover { color: #e8ad3a; }
img { max-width: 100%; height: auto; }
.clear { clear: both; }
.row { max-width: 1200px; margin: 0 auto; padding: 0 10px; }

/* Header */
.site-header { background: #222; border-bottom: 3px solid #D19625; }
.site-branding { display: flex; align-items: center; flex-wrap: wrap; padding: 15px 10px; }
.site-branding .logo { flex: 1; }
.site-title { margin: 0; font-size: 0; }
.site-title a { font-family: 'Lora', serif; font-size: 36px; color: #D19625; font-weight: 700; }
.site-title a:hover { color: #e8ad3a; }
.site-title a i { margin-right: 8px; }
.site-description { color: #999; font-size: 13px; margin-top: 2px; }
.header-search { margin-left: auto; }
.header-search form { display: flex; }
.header-search input { background: #333; border: 1px solid #444; color: #fff; padding: 8px 12px; border-radius: 3px 0 0 3px; width: 220px; font-size: 13px; outline: none; }
.header-search input:focus { border-color: #D19625; }
.header-search button { background: #D19625; border: none; color: #fff; padding: 8px 14px; border-radius: 0 3px 3px 0; cursor: pointer; }
.header-search button:hover { background: #e8ad3a; }
.happy-header, .happy-header-mobile { text-align: center; margin: 10px 0; }

/* Navigation */
.main-navigation { background: #2a2a2a; border-top: 1px solid #333; }
.main-navigation ul { list-style: none; display: flex; flex-wrap: wrap; max-width: 1200px; margin: 0 auto; padding: 0; }
.main-navigation ul li a { display: block; padding: 12px 18px; color: #ddd; font-size: 14px; font-weight: 600; transition: background 0.2s; }
.main-navigation ul li a:hover, .main-navigation ul li a.active { background: #D19625; color: #fff; }
.main-navigation ul li a i { margin-right: 5px; }
.button-nav { display: none; padding: 12px 18px; color: #ddd; cursor: pointer; font-weight: 600; }

/* Content Area */
.site-content { display: flex; flex-wrap: wrap; padding-top: 20px; padding-bottom: 20px; }
#primary.has-sidebar { width: 75%; padding-right: 20px; }
#primary.full-width { width: 100%; }

/* Video Grid */
.videos-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; }
.loop-video { background: #222; border-radius: 5px; overflow: hidden; transition: transform 0.2s; }
.loop-video:hover { transform: translateY(-3px); }
.loop-video a { display: block; color: #ccc; }
.loop-video a:hover { color: #fff; }
.post-thumbnail { position: relative; overflow: hidden; }
.post-thumbnail-container { position: relative; padding-bottom: 56.25%; background: #111; }
.post-thumbnail-container img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.video-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: linear-gradient(transparent 60%, rgba(0,0,0,0.7)); }
.hd-video { position: absolute; top: 8px; left: 8px; background: #D19625; color: #fff; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 3px; }
.views { position: absolute; bottom: 8px; left: 8px; color: #fff; font-size: 11px; text-shadow: 1px 1px 2px rgba(0,0,0,0.8); }
.duration { position: absolute; bottom: 8px; right: 8px; background: rgba(0,0,0,0.8); color: #fff; font-size: 11px; padding: 2px 6px; border-radius: 3px; }
.duration i { margin-right: 3px; }
.rating-bar { height: 4px; background: #444; margin: 0; }
.rating-bar-meter { height: 100%; background: #4CAF50; }
.rating-bar i, .rating-bar span { display: none; }
.loop-video .entry-header { padding: 10px; }
.loop-video .entry-header span { font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Single Video */
.single-video .video-player { background: #000; margin-bottom: 10px; }
.single-video .video-player video, .single-video .video-player iframe { width: 100%; aspect-ratio: 16/9; display: block; }
.single-video .video-placeholder img { width: 100%; display: block; }
.title-block { background: #222; padding: 15px; border-radius: 5px; margin-bottom: 15px; }
.entry-title { font-size: 20px; color: #fff; }
.happy-under-player, .happy-under-player-mobile { text-align: center; margin: 10px 0; }
.entry-content { background: #222; padding: 15px; border-radius: 5px; margin-bottom: 15px; display: flex; flex-wrap: wrap; gap: 15px; }
#rating-col { width: 25%; min-width: 150px; }
#video-views { color: #999; font-size: 13px; margin-bottom: 10px; }
#video-views span { color: #fff; font-size: 18px; font-weight: 700; }
.entry-content .rating-bar { height: 6px; border-radius: 3px; margin-bottom: 8px; }
.rating-result .percentage { font-size: 24px; color: #4CAF50; font-weight: 700; }
.rating-result .likes { color: #999; font-size: 13px; margin-top: 5px; }
.rating-result .likes i { margin: 0 3px; }
.tab-content { flex: 1; min-width: 200px; }
#video-about { color: #bbb; }
.video-description { margin-bottom: 10px; line-height: 1.6; }
#video-date { color: #888; font-size: 13px; margin-bottom: 8px; }
.tags a, .categories-list a { display: inline-block; background: #333; color: #D19625; padding: 4px 10px; margin: 3px; border-radius: 3px; font-size: 12px; }
.tags a:hover, .categories-list a:hover { background: #D19625; color: #fff; }

/* Title Block - original RetroTube style */
.title-block { background: #282828; border-left: 6px solid #D19625; overflow: hidden; margin: 1.25em 0; padding: 0.5em 0.75em 0; border-radius: 0; }
.title-block h1.entry-title { margin: 0; padding: 0 0 0.5em; font-size: 1.45em; border-bottom: 1px solid #151515; font-weight: normal; color: #eee; }

/* Rating in title block */
#rating { padding: 0.6em 0 0.4em; display: flex; align-items: center; gap: 4px; }
.vote-link { display: inline-flex; align-items: center; gap: 6px; color: #eee; text-decoration: none; font-size: 1.3em; font-weight: 600; padding: 6px 14px; border-radius: 4px; transition: all 0.2s; }
.vote-like-link i { font-size: 1.3em; }
.vote-dislike-link i { font-size: 1.2em; color: #aaa; }
.vote-link:hover { color: #D19625; background: rgba(209,150,37,0.1); }
.vote-link.voted { color: #D19625; }
.vote-dislike-link.voted { color: #e74c3c; }
.vote-dislike-link:hover { color: #e74c3c; }

/* Rating column in entry-content */
#rating-col { float: left; width: 30%; padding-right: 1em; }
#video-views { font-size: 0.875em; padding-bottom: 0.4em; color: #aaa; }
#video-views span { font-size: 1.25em; font-weight: bold; color: #eee; }
.entry-content .rating-bar { width: 80%; background: #333; border: 1px solid #333; height: 1.5em; text-align: center; font-size: 75%; }
.entry-content .rating-bar-meter { height: 1.3em; box-shadow: inset 0 0 2px 0 #000; }
.rating-result { width: 80%; margin-top: 0.4em; overflow: hidden; }
.rating-result .percentage { float: left; font-size: 0.875em; color: #4CAF50; }
.rating-result .likes { float: right; font-size: 0.875em; color: #aaa; text-align: right; }
.rating-result .likes_count { margin-right: 0.4em; }

/* Video about tab */
#video-about.width70 { width: 70%; float: left; }

/* Related Videos */
.related-videos { margin-top: 20px; }
.related-videos .widget-title { color: #fff; font-size: 18px; margin-bottom: 15px; padding-bottom: 8px; border-bottom: 2px solid #D19625; }

/* Sidebar */
#sidebar { width: 25%; }
.sidebar-ad { margin-bottom: 20px; text-align: center; }
.widget { background: #222; border-radius: 5px; padding: 15px; margin-bottom: 20px; }
.widget .widget-title { color: #fff; font-size: 16px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 2px solid #D19625; }
.popular-videos { list-style: none; }
.popular-videos li { margin-bottom: 10px; }
.popular-videos li a { display: flex; gap: 10px; align-items: center; color: #ccc; }
.popular-videos li a:hover { color: #D19625; }
.popular-videos li a img { width: 120px; height: 68px; object-fit: cover; border-radius: 3px; flex-shrink: 0; }
.popular-videos li a span { font-size: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tagcloud a { display: inline-block; background: #333; color: #999; padding: 4px 10px; margin: 3px; border-radius: 3px; font-size: 12px; }
.tagcloud a:hover { background: #D19625; color: #fff; }
.tagcloud-page a { font-size: 14px; padding: 6px 14px; margin: 4px; }

/* Categories Grid */
.categories-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.category-block { display: block; background: #222; border-radius: 5px; overflow: hidden; text-align: center; transition: transform 0.2s; }
.category-block:hover { transform: translateY(-3px); }
.category-block img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.cat-placeholder { background: #333; padding: 40px; }
.cat-placeholder i { font-size: 48px; color: #555; }
.cat-name { display: block; color: #fff; font-weight: 600; padding: 10px 10px 2px; }
.cat-count { display: block; color: #888; font-size: 12px; padding: 0 10px 10px; }

/* Page Header */
.page-header { margin-bottom: 20px; }
.page-header .widget-title { color: #fff; font-size: 20px; padding-bottom: 8px; border-bottom: 2px solid #D19625; }

/* Pagination */
.pagination { text-align: center; margin: 25px 0 10px; }
.pagination a { display: inline-block; padding: 8px 14px; margin: 2px; background: #333; color: #ccc; border-radius: 3px; font-size: 14px; }
.pagination a:hover, .pagination a.active { background: #D19625; color: #fff; }

/* SEO Block */
.seo-block { margin-top: 25px; padding: 15px; background: #222; border-radius: 5px; }
.seo-block .widget-title { color: #fff; font-size: 18px; margin-bottom: 10px; }
.seo-block .archive-description { color: #888; font-size: 13px; line-height: 1.7; }

/* Footer */
.site-footer { background: #222; border-top: 3px solid #D19625; margin-top: 20px; padding: 20px 0; }
.site-footer .row { text-align: center; }
.site-info { color: #666; font-size: 12px; margin-top: 15px; }
.happy-footer, .happy-footer-mobile { margin-bottom: 15px; }

/* 404 */
.error-404 { text-align: center; padding: 60px 20px; }
.error-404 h1 { font-size: 72px; color: #D19625; }
.error-404 p { color: #888; font-size: 18px; margin: 15px 0 25px; }
.error-404 .button { display: inline-block; background: #D19625; color: #fff; padding: 12px 24px; border-radius: 5px; font-weight: 600; }
.error-404 .button:hover { background: #e8ad3a; }

/* Page Content */
.page-content { background: #222; padding: 25px; border-radius: 5px; }
.page-content .entry-title { color: #fff; font-size: 24px; margin-bottom: 15px; padding-bottom: 10px; border-bottom: 2px solid #D19625; }
.page-content .entry-content { color: #bbb; line-height: 1.7; }

/* Back to Top */
#back-to-top { display: none; position: fixed; bottom: 20px; right: 20px; background: #D19625; color: #fff; width: 40px; height: 40px; text-align: center; line-height: 40px; border-radius: 50%; font-size: 16px; z-index: 999; }
#back-to-top:hover { background: #e8ad3a; }

/* No Results */
.no-results { text-align: center; color: #888; padding: 40px; font-size: 16px; }

/* Responsive */
@media (max-width: 768px) {
    .site-branding { flex-direction: column; align-items: flex-start; }
    .header-search { margin: 10px 0 0; width: 100%; }
    .header-search input { width: 100%; }
    .button-nav { display: block; }
    .main-navigation ul { display: none; flex-direction: column; }
    .main-navigation.toggled ul { display: flex; }
    .videos-list { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    #primary.has-sidebar { width: 100%; padding-right: 0; }
    #sidebar { width: 100%; margin-top: 20px; }
    .categories-grid { grid-template-columns: repeat(2, 1fr); }
    .entry-content { display: block; }
    #rating-col { float: none; width: 100%; margin-bottom: 1em; }
    .entry-content .rating-bar, .rating-result { width: 100%; }
    #video-about.width70 { width: 100%; float: none; }
    .site-title a { font-size: 24px; }
}

@media (max-width: 480px) {
    .videos-list { grid-template-columns: repeat(2, 1fr); gap: 6px; }
    .loop-video .entry-header { padding: 6px; }
    .loop-video .entry-header span { font-size: 11px; }
    .categories-grid { grid-template-columns: 1fr; }
}

/* Navigation right items */
.nav-right { margin-left: auto; }
.nav-right + .nav-right { margin-left: 0; }

/* Auth pages */
.auth-box, .profile-box { max-width: 480px; margin: 30px auto; background: #222; padding: 30px; border-radius: 5px; border-left: 6px solid #D19625; }
.auth-box h2, .profile-box h2 { color: #fff; font-size: 1.4em; margin-bottom: 20px; }
.form-group { margin-bottom: 15px; }
.form-group label { display: block; color: #aaa; margin-bottom: 5px; font-size: 0.9em; }
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.profile-form input[type="text"],
.comment-form textarea { width: 100% !important; background: #333 !important; border: 1px solid #444 !important; color: #fff !important; padding: 12px 14px !important; border-radius: 4px !important; font-size: 15px !important; font-family: inherit !important; box-sizing: border-box !important; -webkit-appearance: none !important; appearance: none !important; }
.form-group input:focus,
.profile-form input:focus,
.comment-form textarea:focus { border-color: #D19625 !important; outline: none !important; }
.form-group input:disabled,
.profile-form input:disabled { opacity: 0.5; cursor: not-allowed; background: #2a2a2a !important; }
.auth-btn,
.comment-submit { display: inline-block; background: #D19625 !important; color: #fff !important; border: none !important; padding: 12px 28px !important; border-radius: 4px !important; font-size: 16px !important; font-weight: 600 !important; cursor: pointer !important; font-family: inherit !important; -webkit-appearance: none !important; appearance: none !important; }
.auth-btn:hover,
.comment-submit:hover { background: #e8ad3a !important; }
.auth-link { margin-top: 15px; color: #888; font-size: 0.9em; }
.auth-link a { color: #D19625; }
.auth-error { background: #3a1515; border: 1px solid #e74c3c; color: #e74c3c; padding: 10px 14px; border-radius: 4px; margin-bottom: 15px; font-size: 0.9em; }
.auth-success { background: #1e4620; border: 1px solid #4CAF50; color: #4CAF50; padding: 10px 14px; border-radius: 4px; margin-bottom: 15px; font-size: 0.9em; }
.profile-admin { margin-top: 20px; padding-top: 15px; border-top: 1px solid #333; }
.admin-link { background: #333; }
.admin-link:hover { background: #D19625; }
.my-comments { margin-top: 10px; }
.my-comment { background: #2a2a2a; padding: 12px; border-radius: 4px; margin-bottom: 8px; border-left: 3px solid #D19625; }
.my-comment a { color: #D19625; font-weight: 600; }
.my-comment p { color: #bbb; margin: 6px 0; font-size: 0.9em; }
.my-comment small { color: #666; }

/* Comments */
.comments-section { background: #222; padding: 20px; border-radius: 5px; margin-top: 20px; }
.comments-section .widget-title { color: #fff; font-size: 1.2em; margin-bottom: 15px; padding-bottom: 8px; border-bottom: 2px solid #D19625; }
.comment-form textarea { width: 100%; background: #333; border: 1px solid #444; color: #fff; padding: 10px; border-radius: 4px; font-size: 14px; resize: vertical; font-family: inherit; }
.comment-form textarea:focus { border-color: #D19625; outline: none; }
.comment-submit { background: #D19625; color: #fff; border: none; padding: 10px 20px; border-radius: 4px; font-size: 14px; font-weight: 600; cursor: pointer; margin-top: 8px; }
.comment-submit:hover { background: #e8ad3a; }
.comment-login-hint { color: #888; font-size: 0.95em; padding: 15px 0; }
.comment-login-hint a { color: #D19625; font-weight: 600; }
.comments-list { margin-top: 15px; }
.comment-item { background: #2a2a2a; padding: 12px 15px; border-radius: 4px; margin-bottom: 10px; }
.comment-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.comment-author { color: #D19625; font-size: 0.95em; }
.comment-author i { margin-right: 4px; }
.comment-date { color: #666; font-size: 0.8em; }
.comment-body { color: #ccc; font-size: 0.95em; line-height: 1.5; }
.no-comments { color: #666; font-size: 0.9em; padding: 10px 0; }

/* Admin Styles */
.admin-body { background: #1a1a2e; }
.admin-container { max-width: 900px; margin: 40px auto; padding: 0 20px; }
.admin-header { background: #16213e; padding: 20px; border-radius: 8px 8px 0 0; border-bottom: 3px solid #D19625; display: flex; justify-content: space-between; align-items: center; }
.admin-header h1 { color: #D19625; font-size: 22px; }
.admin-header a { color: #999; font-size: 13px; }
.admin-header a:hover { color: #D19625; }
.admin-nav { background: #16213e; padding: 0; display: flex; flex-wrap: wrap; }
.admin-nav a { padding: 12px 20px; color: #bbb; font-weight: 600; border-bottom: 2px solid transparent; }
.admin-nav a:hover, .admin-nav a.active { color: #D19625; border-bottom-color: #D19625; }
.admin-content { background: #16213e; padding: 25px; border-radius: 0 0 8px 8px; margin-bottom: 30px; }
.admin-content h2 { color: #fff; font-size: 18px; margin-bottom: 20px; }
.admin-content label { display: block; color: #bbb; font-weight: 600; margin-bottom: 5px; font-size: 13px; }
.admin-content textarea { width: 100%; min-height: 120px; background: #0f3460; border: 1px solid #333; color: #fff; padding: 10px; border-radius: 4px; font-family: monospace; font-size: 13px; margin-bottom: 15px; resize: vertical; }
.admin-content input[type="text"], .admin-content input[type="password"] { width: 100%; background: #0f3460; border: 1px solid #333; color: #fff; padding: 10px; border-radius: 4px; font-size: 14px; margin-bottom: 15px; }
.admin-content input:focus, .admin-content textarea:focus { border-color: #D19625; outline: none; }
.btn { display: inline-block; background: #D19625; color: #fff; padding: 10px 24px; border: none; border-radius: 4px; font-size: 14px; font-weight: 600; cursor: pointer; }
.btn:hover { background: #e8ad3a; }
.btn-danger { background: #e74c3c; }
.btn-danger:hover { background: #c0392b; }
.alert { padding: 12px 18px; border-radius: 4px; margin-bottom: 15px; font-size: 14px; }
.alert-success { background: #1e4620; color: #4CAF50; border: 1px solid #4CAF50; }
.alert-error { background: #4a1515; color: #e74c3c; border: 1px solid #e74c3c; }
.alert-info { background: #0f3460; color: #5dade2; border: 1px solid #5dade2; }
.login-box { max-width: 400px; margin: 80px auto; }
.login-box h2 { text-align: center; color: #D19625; margin-bottom: 25px; }
.slot-group { background: #0f3460; padding: 15px; border-radius: 5px; margin-bottom: 15px; }
.slot-group .slot-label { color: #D19625; font-size: 14px; font-weight: 700; margin-bottom: 5px; }
.slot-group .slot-name { color: #666; font-size: 11px; margin-bottom: 8px; }
.slot-group textarea { margin-bottom: 0; }
.sync-result { background: #0f3460; padding: 15px; border-radius: 5px; margin-top: 15px; }
.sync-result dt { color: #D19625; font-weight: 600; }
.sync-result dd { color: #bbb; margin-bottom: 8px; margin-left: 0; }

/* Recent searches */
.recent-searches .search-tag { background: #2a2a2a; border: 1px solid #444; color: #D19625; }
.recent-searches .search-tag:hover { background: #D19625; color: #fff; border-color: #D19625; }
.recent-searches .search-tag i { margin-right: 4px; font-size: 0.85em; }

/* Fallback videos on empty results */
.fallback-videos { margin-top: 30px; padding-top: 20px; border-top: 1px solid #333; }
.fallback-videos .widget-title { color: #fff; font-size: 1.1em; margin-bottom: 15px; padding-bottom: 8px; border-bottom: 2px solid #D19625; }

/* Breadcrumbs */
.breadcrumbs { max-width: 1200px; margin: 0 auto; padding: 10px 10px 0; font-size: 0.85em; color: #666; }
.breadcrumbs a { color: #999; }
.breadcrumbs a:hover { color: #D19625; }
.breadcrumbs .sep { margin: 0 6px; color: #555; }
.breadcrumbs span:last-child { color: #aaa; }

/* Video filters dropdown */
.page-header { position: relative; margin-bottom: 20px; }
#filters { position: absolute; right: 0; top: 0; z-index: 100; }
.filters-select { background: #181818; color: #aaa; padding: 6px 14px; cursor: pointer; font-size: 0.9em; border: 1px solid #333; border-radius: 3px; position: relative; user-select: none; white-space: nowrap; }
.filters-select i { margin-left: 5px; }
.filters-select:hover { color: #D19625; border-color: #D19625; }
.filters-options { display: none; position: absolute; right: 0; top: 100%; background: #222; border: 1px solid #333; border-top: 3px solid #D19625; min-width: 200px; z-index: 999; border-radius: 0 0 4px 4px; box-shadow: 0 4px 12px rgba(0,0,0,0.5); }
.filters-select.open .filters-options { display: block; }
.filters-options a { display: block; padding: 10px 16px; color: #ccc; font-size: 0.9em; border-bottom: 1px solid #2a2a2a; transition: background 0.15s; }
.filters-options a:last-child { border-bottom: none; }
.filters-options a:hover { background: #2a2a2a; color: #D19625; }
.filters-options a.active { color: #D19625; font-weight: 600; }

/* Outgoing nav links - highlighted */
.main-navigation ul li.nav-external a { color: #e8ad3a; }
.main-navigation ul li.nav-external a:hover { background: #e8ad3a; color: #000; }

/* Top bar */
.top-bar { background: #111; border-bottom: 1px solid #282828; font-size: 0.8em; }
.top-bar-content { display: flex; justify-content: flex-end; align-items: center; padding: 6px 10px; }
.membership { display: flex; align-items: center; gap: 4px; }
.membership .welcome { color: #888; margin-right: 6px; }
.membership .welcome i { margin-right: 4px; color: #D19625; }
.membership a { color: #ccc; padding: 2px 8px; }
.membership a:hover { color: #D19625; }
.membership .or { color: #555; font-size: 0.9em; }
.membership .topbar-item-text { }
@media (max-width: 768px) {
    .membership .topbar-item-text { display: none; }
    .top-bar-content { justify-content: center; }
}
