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

:root {
    --accent-color: #3366FF; /* Darker Blue to match favicon */
    --focus-color: #7344ff;
    --text-primary: #FFFFFF;
    --text-secondary: #aaaaaa;
    --background-primary: #0f0f0f;
    --background-secondary: #1a1a1a;
    --background-tertiary: #333333;
    --border-color: #333333;
    --navbar-bg: #0f0f0f;
}

body.light-theme {
    --text-primary: #0f0f0f;
    --text-secondary: #606060;
    --background-primary: #ffffff;
    --background-secondary: #f2f2f2;
    --background-tertiary: #e5e5e5;
    --border-color: #e5e5e5;
    --navbar-bg: #ffffff;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--background-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

.logo {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: var(--text-primary);
}

.logo-text {
    font-size: 2.5rem; /* Increased font size for a bigger logo */
    font-weight: bold;
    letter-spacing: -1px;
}

.logo-text .logo-x {
    color: var(--accent-color);
}

.logo-text .logo-p {
    color: var(--text-primary);
}

.logo-text .logo-videos {
    color: var(--text-primary);
    margin-left: -0.15em; /* Reduces the space after XP */
}

/* Navigation */
.navbar {
    background: var(--navbar-bg);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.nav-container {
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-container {
    flex-grow: 1;
    max-width: 500px;
    margin: 0 2rem;
    position: relative;
}

.search-bar {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    background: var(--background-secondary);
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}
 
.search-bar:focus {
    border-color: #7344ff;
}

.search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: #23025d;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 20px;
    color: white;
    cursor: pointer;
    transition: background 0.3s ease;
}

.actions-menu-container {
    position: relative;
    display: flex;
    align-items: center;
}

.actions-menu-toggle {
    display: none; /* Hidden on desktop */
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
}

.nav-actions {
    display: flex;
    align-items: center;
}

.theme-toggle-btn {
    background: var(--background-tertiary);
    color: var(--text-primary);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.login-btn {
    background-color: var(--accent-color);
    color: var(--background-primary);
    padding: 0.6rem 1.5rem;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 500;
    margin-left: 1rem;
    transition: all 0.3s ease;
}

.login-btn:hover {
    opacity: 0.85;
}

.submit-video-btn {
    background-color: transparent;
    color: var(--text-secondary);
    padding: 0.6rem 1.5rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    text-decoration: none;
    font-weight: 500;
    margin-left: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
}
.submit-video-btn::before {
    content: 'Submit Video'; /* Default text */
}



.user-profile-icon {
    border-radius: 50%;
}

.video-actions {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.action-btn, .reaction-btn {
    background-color: var(--background-tertiary);
    border: none;
    height: 44px; /* Set a fixed height for all buttons */
    color: var(--text-primary);
    border-radius: 20px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center; /* Center content horizontally */
    font-size: 1rem;
    padding: 0 1.2rem; /* Use padding for horizontal spacing only */
}

.action-btn:hover, .reaction-btn:hover {
    background-color: #4d4d4d;
}

.action-btn {
    gap: 0.5rem;
}

.action-btn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.action-btn.liked {
    background-color: var(--accent-color);
    color: var(--background-primary);
}

.reactions {
    display: flex;
    gap: 0.5rem;
}

.reaction-btn {
    font-size: 1.4rem;
    width: 44px;
    height: 44px;
    justify-content: center;
    padding: 0; /* Override the shared padding for circular buttons */
    border-radius: 50%;
    opacity: 0.7;
    border: 2px solid transparent;
    transition: all 0.2s ease-in-out;
}

.reaction-btn.selected {
    opacity: 1;
    transform: scale(1.1);
    border-color: var(--accent-color);
    background-color: var(--background-secondary);
}

.search-btn:hover {
    background: #2f1aa7;
}

/* Categories Navigation */
.categories-nav {
    background: var(--background-secondary);
    padding: 1rem 0;
}

.category-menu-toggle {
    display: none; /* Hidden by default on desktop */
    background: var(--accent-color);
    color: var(--background-primary);
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.category-menu-toggle .hamburger-icon {
    width: 24px;
    height: 24px;
    fill: currentColor;
}


.categories-container {
    padding: 0 2rem;
}

.category-tabs {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

/* --- Custom Scrollbar for Category Tabs --- */
.category-tabs::-webkit-scrollbar {
    height: 6px;
}

.category-tabs::-webkit-scrollbar-track {
    background: transparent;
}

.category-tabs::-webkit-scrollbar-thumb {
    background: var(--background-tertiary);
    border-radius: 3px;
}
.category-tab {
    background: var(--background-tertiary);
    color: var(--text-primary);
    padding: 0.7rem 1.5rem;
    border-radius: 20px;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-size: 0.9rem;
}

.category-tab:hover,
.category-tab.active {
    background: var(--accent-color);
    color: var(--background-primary);
}

/* Main Content */
.main-container {
    padding: 2rem;
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: #fff;
}

/* Video Grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.video-card {
    background: var(--background-secondary);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.video-thumbnail {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.video-card:hover .video-thumbnail img {
    transform: scale(1.05);
}

.duration-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

.video-info {
    padding: 1rem;
}

.video-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-meta {
    color: var(--text-secondary);
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.provider-badge {
    background: var(--background-tertiary);
    color: var(--text-secondary);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    display: none; /* This will hide the provider badge */
}

/* Watch Page */
.watch-container {
    display: none;
    padding: 2rem;
    max-width: 1280px; /* Constrain width for better viewing on large screens */
    margin: 0 auto;    /* Center the container */
}

.watch-layout {
    display: flex;
    gap: 2rem;
}

.video-main {
    flex: 3; /* Takes up 3/4 of the space */
    min-width: 0; /* Prevents flex item from overflowing */
}

.related-videos-container {
    flex: 1; /* Takes up 1/4 of the space */
    min-width: 280px; /* Minimum width for the sidebar */
    background-color: var(--background-secondary);
    padding: 1.5rem;
    border-radius: 12px;
    align-self: flex-start; /* Keeps it from stretching vertically */
    height: fit-content; /* Ensures it only takes up the space it needs */
}

.video-player {
    position: relative;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 2rem;
    margin-top: 1rem;
}

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

.video-details {
    background: var(--background-secondary);
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.video-title-large {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.video-stats {
    display: flex;
    gap: 2rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.back-btn {
    background: var(--background-tertiary);
    color: var(--text-primary);
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s ease;
}

.back-btn:hover {
    background: var(--accent-color);
}

/* No Results */
.no-results {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
    padding: 3rem;
}

.load-more-container {
    text-align: center;
    margin-bottom: 2rem;
}

.load-more-btn {
    background-color: var(--accent-color);
    color: var(--background-primary);
    border: none;
    padding: 0.8rem 2.5rem;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.load-more-btn:hover {
    transform: scale(1.05);
}
/* Related Videos Sidebar */
.related-videos-container h3 {
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.related-video-card {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 1rem;
    cursor: pointer;
    background: transparent;
    transition: background 0.2s ease;
    border-radius: 8px;
}

.related-video-card:hover {
    background: var(--background-secondary);
}

.related-video-thumbnail {
    width: 168px;
    height: 94px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
}

.related-video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-video-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.related-video-title {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.3rem;
}

.related-video-meta {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    color: var(--text-secondary);
}
/* Responsive Design */
@media (max-width: 1024px) {
    .watch-layout {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .logo-text {
        font-size: 1.8rem;
    }

    .nav-container {
        padding: 0 1rem;
    }

    .search-container {
        margin: 0 1rem;
    }

    .video-grid {
        gap: 1rem;
    }

    .main-container, .watch-container {
        padding: 1rem;
    }

    .video-stats {
        flex-direction: column;
        gap: 0.5rem;
    }

    .category-menu-toggle {
        display: inline-flex; /* Show the button on mobile */
    }

    .categories-container {
        position: relative; /* Needed for absolute positioning of the menu */
    }

    .category-tabs {
        display: none; /* Hide the horizontal scroll by default on mobile */
        position: absolute;
        top: 100%;
        left: 2rem; /* Align with container padding */
        right: 2rem;
        flex-direction: column;
        background: var(--background-secondary);
        border-radius: 12px;
        padding: 1rem;
        box-shadow: 0 8px 16px rgba(0,0,0,0.2);
        z-index: 101; /* Ensure it's above other content */
        max-height: 300px; /* Prevent it from being too long */
    }
}

@media (max-width: 480px) {
    .category-tab {
        padding: 0.6rem 1.2rem;
        font-size: 0.85rem;
    }

    .video-thumbnail {
        height: 180px;
    }

    .video-details {
        padding: 1.5rem;
    }

    .logo-text {
        font-size: 1.4rem; /* Further reduce logo size on small screens */
    }

    .logo-videos {
        display: none; /* Hide "VIDEOS" text on very small screens */
    }

    .nav-container {
        gap: 0.5rem;
    }

    .category-tabs {
        left: 1rem; /* Adjust for smaller padding */
        right: 1rem;
    }

    .actions-menu-toggle {
        display: block; /* Show hamburger on mobile */
        padding: 8px;
    }

    .actions-menu-toggle .hamburger-icon {
        width: 28px;
        height: 28px;
        fill: currentColor;
    }

    .actions-menu {
        display: none; /* Hide menu by default on mobile */
        position: absolute;
        top: calc(100% + 10px); /* Position below the navbar */
        right: 0;
        background: var(--background-secondary);
        border-radius: 12px;
        padding: 1rem;
        box-shadow: 0 8px 16px rgba(0,0,0,0.3);
        z-index: 101;
        width: 200px;
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .actions-menu .submit-video-btn,
    .actions-menu .login-btn,
    .actions-menu #userProfileLink {
        display: block;
        width: 100%;
        text-align: center;
        margin: 0;
        padding: 0.8rem;
    }

    .search-container {
        flex-grow: 0.8; /* Allow it to shrink more */
        margin: 0 0.5rem; /* Reduce side margins */
        min-width: 120px; /* Prevent it from becoming too small */
    }

    .submit-video-btn {
        display: none; /* Hide original button on mobile */
    }
    .login-btn {
        display: none; /* Hide original button on mobile */
    }
}

.spinner {
    border: 3px solid #333;
    border-top: 3px solid #ff4458;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Comment Section */
.comment-section {
    background-color: var(--background-secondary);
    padding: 2rem;
    border-radius: 12px;
    margin-top: 2rem;
}

.comment-section h2 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

#comment-form input,
#comment-form textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-sizing: border-box;
    background-color: var(--background-primary);
    color: var(--text-primary);
    font-size: 1rem;
}

#comment-form button {
    background-color: var(--accent-color);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    float: right;
}

#comment-list {
    margin-top: 3rem;
}

.comment {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--background-tertiary);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

/* --- Footer --- */
.site-footer {
    background-color: var(--background-secondary);
    color: var(--text-secondary);
    padding: 20px;
    margin-top: 40px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}
.footer-container {
    max-width: 1280px;
    margin: 0 auto;
}

/* --- Age Verification Gate --- */
.age-gate-overlay {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.age-gate-content {
    background: var(--background-secondary);
    padding: 2.5rem;
    border-radius: 16px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.age-gate-content h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.age-gate-content p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.7;
}

.age-gate-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.age-gate-btn {
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    flex-grow: 1;
    transition: all 0.2s ease;
}

.age-gate-btn.enter {
    background-color: var(--accent-color);
    color: white;
}

.age-gate-btn.exit {
    background-color: var(--background-tertiary);
    color: var(--text-primary);
}

.age-gate-btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

/* --- Submit Video Modal --- */
.submit-modal-overlay {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1500;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.submit-modal-content {
    background: var(--background-secondary);
    padding: 2rem;
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.submit-modal-content h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.submit-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--background-primary);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
}

.input-group select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23aaaaaa' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
    padding-right: 2.5rem;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--accent-color);
}
