/* style.css */
:root {
    --bs-dark-rgb: 18, 18, 18;
    /* #121212 */
    --bs-body-bg: #121212;
    --bs-body-color: #e0e0e0;
    --primary-accent: #0d6efd;
    /* Bootstrap primary blue */
    --card-bg: #1e1e1e;
    /* Slightly lighter than body for cards */
    --border-color: #333;
    --text-muted-custom: #8c8c8c;
    --font-family-sans-serif: 'Inter', sans-serif;
}

body {
    font-family: var(--font-family-sans-serif);
    background-color: var(--bs-body-bg) !important;
    color: var(--bs-body-color) !important;
}

.bg-black {
    /* True black for navbar/footer */
    background-color: #000 !important;
}

.bg-darker {
    /* For cards, slightly lighter than body */
    background-color: var(--card-bg) !important;
}

/* Navbar */
.navbar {
    border-bottom: 1px solid var(--border-color);
}

.navbar-brand {
    letter-spacing: 0.5px;
    font-weight: 700 !important;
}

.nav-link {
    color: #b0b0b0 !important;
    transition: color 0.2s ease-in-out, background-color 0.2s ease-in-out;
    padding-left: 0.8rem !important;
    padding-right: 0.8rem !important;
    border-radius: 0.3rem;
}

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

.navbar-toggler {
    border-color: rgba(255, 255, 255, 0.1);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.7%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}


/* Search Form */
.form-control-sm.bg-darker {
    background-color: #2a2a2a !important;
    border-color: var(--border-color) !important;
    color: var(--bs-body-color) !important;
}

.form-control-sm.bg-darker::placeholder {
    color: var(--text-muted-custom);
}

.form-control-sm.bg-darker:focus {
    background-color: #303030 !important;
    border-color: var(--primary-accent) !important;
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
    /* Use Bootstrap primary color */
    color: #fff !important;
}

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

.btn-primary:hover {
    background-color: #0b5ed7;
    /* Darker shade of primary */
    border-color: #0a58ca;
}

/* Page Titles */
.page-main-title {
    color: #fff;
    font-weight: 500;
    border-bottom: 2px solid var(--primary-accent);
    padding-bottom: 0.5rem;
    display: inline-block;
}

.category-group-title {
    color: #e0e0e0;
    font-weight: 500;
}

/* Video Card */
.video-card {
    transition: transform 0.25s ease-in-out, box-shadow 0.25s ease-in-out;
    border-radius: 0.5rem !important;
    overflow: hidden;
    /* Crucial for trailer and image fitting */
}

.video-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 0 2px var(--primary-accent) !important;
    z-index: 10;
}

.video-card .thumbnail-container {
    background-color: #000;
    /* Fallback */
}

.video-card .video-thumbnail,
.video-card .video-trailer {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Ensures the image covers the area, might crop */
    transition: opacity 0.3s ease-in-out;
}

.video-card.is-playing-trailer .video-thumbnail {
    opacity: 0;
    visibility: hidden;
}

.video-card.is-playing-trailer .video-trailer {
    display: block !important;
    /* Override inline style from JS */
    opacity: 1;
    visibility: visible;
}

.video-card .video-duration-badge {
    font-size: 0.7rem;
    font-weight: 500;
    padding: 0.2em 0.5em;
}

.video-card .card-body {
    padding: 0.75rem;
    /* Slightly less padding */
}

.video-card .video-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: #f5f5f5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 2.7em;
    /* Approx 2 lines */
    line-height: 1.35em;
}

.video-card .video-meta {
    font-size: 0.75rem;
    color: var(--text-muted-custom) !important;
}

/* Category Cards */
.category-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 0.5rem !important;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.category-thumb {
    height: 120px;
    /* Fixed height for category thumbs */
    object-fit: cover;
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
}

.category-name {
    font-size: 1rem;
    font-weight: 500;
}

/* Watch Page */
.video-watch-title {
    color: #fff;
    font-weight: 600;
}

#video-player-container {
    background-color: #000;
    border-radius: 0.5rem;
    overflow: hidden;
}

.video-description {
    background-color: #222;
    /* Slightly different from card-bg */
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Related Videos List */
.related-videos-list .list-group-item {
    transition: background-color 0.2s ease;
}

.related-videos-list .list-group-item:hover {
    background-color: #2c2c2c !important;
    /* Darker hover for related items */
}

.related-thumbnail {
    width: 120px;
    /* Fixed width for related video thumbnails */
    height: 67.5px;
    /* 16:9 aspect ratio */
    object-fit: cover;
}

.related-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: #e0e0e0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3em;
    max-height: 2.6em;
    /* for 2 lines */
}

.related-meta,
.related-duration {
    font-size: 0.7rem;
    color: var(--text-muted-custom);
}

/* Pagination */
.pagination .page-link {
    background-color: var(--card-bg);
    border-color: var(--border-color);
    color: var(--primary-accent);
    margin: 0 3px;
    border-radius: 0.3rem;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.pagination .page-link:hover {
    background-color: var(--primary-accent);
    color: #fff;
    border-color: var(--primary-accent);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-accent);
    border-color: var(--primary-accent);
    color: #fff;
    z-index: 3;
}

.pagination .page-item.disabled .page-link {
    background-color: #222;
    border-color: #333;
    color: #666;
}

/* Footer */
footer {
    font-size: 0.9rem;
}

footer p {
    margin-bottom: 0.25rem;
}

/* Utility */
.shadow-lg {
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, .35) !important;
    /* Softer, larger shadow */
}