/* Dark Theme CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #1a1a1a;
    color: #fff;
    line-height: 1.6;
}

/* Container */
.container {
    max-width: 1400px;
    width: 80%;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navbar */
.navbar {
    background: #000;
    padding: 20px 0 0 0;
    position: relative;
    overflow: visible;
    z-index: 1000;
}

.navbar .container {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    overflow: visible;
}

/* Navbar Top - Logo & Search */
.navbar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    width: 100%;
    padding-bottom: 20px;
}

.navbar-brand {
    font-size: 28px;
    font-weight: bold;
    color: #de2600;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.navbar-search {
    flex: 1;
    max-width: 600px;
}

.navbar-search form {
    display: flex;
    gap: 0;
    width: 100%;
}

.navbar-search .search-wrapper {
    position: relative;
    flex: 1;
}

.navbar-search input {
    padding: 14px 20px;
    border: 2px solid #333;
    background: #2a2a2a;
    color: #fff;
    border-radius: 8px 0 0 8px;
    width: 100%;
    font-size: 16px;
    transition: all 0.3s;
}

.navbar-search input:focus {
    outline: none;
    border-color: #de2600;
    background: #333;
}

.navbar-search .search-btn {
    padding: 14px 30px;
    background: #de2600;
    border: none;
    color: #fff;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
}

.navbar-search .search-btn:hover {
    background: #b51f00;
}

.navbar-search .search-btn svg {
    flex-shrink: 0;
}

/* Navbar Menu - Links */
.navbar-menu {
    display: flex;
    gap: 8px;
    justify-content: flex-start;
    flex-wrap: wrap;
    align-items: center;
    padding: 18px 0;
    border-top: 2px solid #de2600;
    position: relative;
    z-index: 1;
}

.nav-link {
    color: #ccc;
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 0;
    transition: all 0.2s ease;
    font-size: 15px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    line-height: 1.2;
    position: relative;
    border-bottom: 2px solid transparent;
}

.nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    color: #fff;
    background: transparent;
    border-bottom: 2px solid #de2600;
    font-weight: 600;
}

.nav-link.active:hover {
    background: rgba(222, 38, 0, 0.1);
}

/* Dropdown Menu */
.nav-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
    z-index: 1001;
}

.dropdown-toggle {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.dropdown-arrow {
    font-size: 10px;
    margin-left: 5px;
    transition: transform 0.3s;
    display: inline-block;
}

.nav-dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 1002;
    margin-top: 5px;
    min-width: 800px;
    max-width: 90vw;
    padding: 20px;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s, visibility 0.2s;
    overflow: visible;
}

/* Only show on click (active class), not on hover */
.nav-dropdown.active .dropdown-menu {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Prevent hover from showing dropdown (only when not active) */
.nav-dropdown:not(.active):hover .dropdown-menu {
    display: none !important;
}

.dropdown-content {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px 20px;
}

/* User Dropdown - Vertical Menu */
.user-dropdown .dropdown-menu {
    min-width: 200px;
}

.user-dropdown .dropdown-content {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 5px 0;
}

.user-dropdown .dropdown-content a {
    padding: 12px 20px;
    border-radius: 0;
    text-align: left;
    border-bottom: 1px solid #333;
}

.user-dropdown .dropdown-content a:last-child {
    border-bottom: none;
}

.user-dropdown .dropdown-content a:hover {
    background: #de2600;
}

.dropdown-content a {
    color: #fff;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s;
    white-space: nowrap;
}

.dropdown-content a:hover {
    background: #de2600;
    color: #fff;
}

/* Suggest Results */
.suggest-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #2a2a2a;
    border: 1px solid #333;
    border-radius: 6px;
    margin-top: 5px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
}

.suggest-item {
    padding: 12px 15px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid #333;
}

.suggest-item:last-child {
    border-bottom: none;
}

.suggest-item:hover {
    background: #333;
}

.suggest-name {
    color: #fff;
    font-size: 14px;
}

/* Video Grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 25px;
    margin: 30px 0;
    align-items: start;
}

.video-item {
    position: relative;
    /* Remove background and border-radius for open layout */
    transition: none;
}

.favorite-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    z-index: 10;
    transition: all 0.3s;
}

.favorite-btn:hover {
    background: rgba(222, 38, 0, 0.9);
    transform: scale(1.1);
}

.favorite-btn.active {
    background: #de2600;
    color: #fff;
}

.favorite-btn.not-logged-in {
    cursor: pointer;
}

.favorite-btn.not-logged-in:hover::after {
    content: 'Login to save';
    position: absolute;
    top: 100%;
    right: 0;
    background: #000;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    margin-top: 5px;
}

.favorite-btn-main {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.8);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    z-index: 100;
    transition: all 0.3s;
}

.favorite-btn-main:hover {
    background: rgba(222, 38, 0, 0.9);
    transform: scale(1.1);
}

.favorite-btn-main.active {
    background: #de2600;
    color: #fff;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state p {
    margin: 10px 0;
    font-size: 16px;
}

.empty-state a {
    color: #de2600;
    text-decoration: none;
    font-weight: 600;
}

.empty-state a:hover {
    text-decoration: underline;
}

/* Toast Notification */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #2a2a2a;
    color: #fff;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10000;
    min-width: 250px;
    max-width: 400px;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
    border-left: 4px solid #de2600;
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-notification.toast-success {
    border-left-color: #4caf50;
}

.toast-notification.toast-error {
    border-left-color: #de2600;
}

.toast-icon {
    font-size: 20px;
    font-weight: bold;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.toast-success .toast-icon {
    color: #4caf50;
}

.toast-error .toast-icon {
    color: #de2600;
}

.toast-message {
    font-size: 14px;
    line-height: 1.4;
    flex: 1;
}

/* Mobile toast */
@media (max-width: 768px) {
    .toast-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        min-width: auto;
        max-width: none;
        transform: translateY(-100px);
    }
    
    .toast-notification.show {
        transform: translateY(0);
    }
}
    width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.video-item:hover {
    transform: none;
    box-shadow: none;
}

.video-item a {
    text-decoration: none;
    color: inherit;
    display: block;
    width: 100%;
}

.video-thumb {
    width: 100%;
    padding-top: 56.25%; /* 16:9 aspect ratio */
    position: relative;
    background: #000;
    overflow: hidden;
    flex-shrink: 0;
}

.video-thumb img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 0.9;
    transition: opacity 0.3s;
    display: block;
}

.video-item:hover .video-thumb img {
    opacity: 1;
}

.video-thumb .duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 4px 8px;
    border-radius: 0;
    font-size: 12px;
}

.video-title {
    font-size: 14px;
    font-weight: 500;
    margin-top: 8px;
    line-height: 1.4;
    color: #fff;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-uploader {
    margin-top: 6px;
}

.video-uploader a {
    color: #4a9eff;
    font-size: 13px;
    text-decoration: none;
    transition: color 0.3s;
}

.video-uploader a:hover {
    color: #6ab0ff;
    text-decoration: underline;
}

.video-meta {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 40px 0;
    flex-wrap: wrap;
    padding: 0 15px;
}

.pagination a,
.pagination span {
    padding: 8px 12px;
    background: #2a2a2a;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.3s;
    font-size: 14px;
    white-space: nowrap;
}

.pagination a:hover {
    background: #de2600;
}

.pagination .active {
    background: #de2600;
}

.pagination .disabled {
    background: #1a1a1a;
    cursor: not-allowed;
    opacity: 0.5;
    pointer-events: none;
}

.pagination .ellipsis {
    padding: 8px 4px;
    cursor: default;
}

/* Footer */
.footer {
    background: #1a1a1a;
    padding: 0 0 20px;
    margin-top: 40px;
    border-top: 2px solid #333;
}

.footer .container {
    max-width: 1400px;
    padding-top: 40px;
}

.footer-content {
    margin-bottom: 30px;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
}

.footer-section h4 {
    color: #fff;
    font-size: 16px;
    margin-bottom: 15px;
    font-weight: 600;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: #999;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.footer-section ul li a:hover {
    color: #de2600;
}

.footer-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-cloud {
    display: inline-block;
    padding: 4px 10px;
    background: #2a2a2a;
    color: #999;
    text-decoration: none;
    border-radius: 4px;
    font-size: 12px;
    border: 1px solid #333;
    transition: all 0.3s;
}

.tag-cloud:hover {
    background: #333;
    color: #de2600;
    border-color: #de2600;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid #2a2a2a;
    margin-top: 40px;
}

.footer-bottom p {
    color: #888;
    font-size: 14px;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: #de2600;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    z-index: 999;
    box-shadow: 0 4px 12px rgba(222, 38, 0, 0.4);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
}

.back-to-top.show {
    display: flex;
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: #b51f00;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(222, 38, 0, 0.6);
}

.back-to-top:active {
    transform: translateY(-1px);
}

.back-to-top svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        width: 100%;
        padding: 0 5px;
    }
    
    .navbar {
        padding: 15px 0 0 0;
    }
    
    .navbar .container {
        flex-direction: column;
        gap: 0;
    }
    
    /* Mobile: Logo on top - centered */
    .navbar-top {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        width: 100%;
        padding-bottom: 15px;
    }
    
    .navbar-brand {
        text-align: center;
        font-size: 24px;
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    /* Mobile: Search full width with icon button - centered */
    .navbar-search {
        width: 100%;
        max-width: none;
        padding: 0 10px;
    }
    
    .navbar-search form {
        width: 100%;
    }
    
    .navbar-search input {
        padding: 12px 16px;
        font-size: 16px;
        border-radius: 8px 0 0 8px;
    }
    
    .navbar-search .search-btn {
        padding: 12px 16px;
        border-radius: 0 8px 8px 0;
        min-width: 50px;
    }
    
    .navbar-search .search-btn-text {
        display: none; /* Hide text on mobile, show icon only */
    }
    
    /* Mobile: Navbar menu - centered */
    .navbar-menu {
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
        padding: 15px 10px;
        border-top: 2px solid #de2600;
    }
    
    .nav-link {
        padding: 8px 14px;
        font-size: 14px;
        display: inline-flex;
        align-items: center;
    }
    
    /* Mobile: Dropdown Menu */
    .nav-dropdown {
        width: auto;
        display: inline-flex;
    }
    
    .dropdown-toggle {
        display: inline-flex;
        align-items: center;
    }
    
    /* Mobile: Disable hover completely */
    .nav-dropdown:hover .dropdown-menu {
        display: none !important;
        visibility: hidden !important;
    }
    
    /* Mobile: Show dropdown only when active */
    .nav-dropdown.active .dropdown-menu {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .dropdown-menu {
        position: absolute;
        top: 100%;
        left: 50%;
        transform: translateX(-50%);
        min-width: calc(100vw - 40px);
        max-width: 500px;
        width: calc(100vw - 40px);
        margin: 10px 0 0 0;
        border-radius: 8px;
        transition: none;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8);
        z-index: 1002;
    }
    
    .dropdown-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px 12px;
    }
    
    .dropdown-content a {
        padding: 10px 8px;
        font-size: 13px;
    }
    
    .video-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        width: 100%;
    }
    
    .pagination {
        gap: 8px;
    }
    
    .pagination a,
    .pagination span {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .pagination .ellipsis {
        padding: 10px 4px;
    }
    
    .footer-links {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
    
    .footer-section h4 {
        font-size: 14px;
    }
    
    .footer-section ul li a {
        font-size: 12px;
    }
    
    .footer-tags {
        gap: 6px;
    }
    
    .tag-cloud {
        font-size: 11px;
        padding: 3px 8px;
    }
}

/* Mobile: Back to Top Button */
@media (max-width: 768px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    .back-to-top svg {
        width: 20px;
        height: 20px;
    }
}

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

@media (min-width: 1025px) and (max-width: 1400px) {
    .video-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

