/* General Body and Layout */
body {
    font-family: 'Roboto', Arial, sans-serif;
    margin: 0;
    background-color: #000; /* Dark black background */
    color: #f0f0f0; /* Light text color */
    line-height: 1.6;
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header */
.main-header {
    background-color: #111;
    padding: 20px 0;
    border-bottom: 2px solid #ff4500; /* Accent color */
    text-align: center;
}
.main-header .container {
    display: flex;
    flex-direction: column; /* Stack elements vertically */
    align-items: center; /* Center horizontally */
    gap: 0px; /* Tightly packed header elements */
}
.main-header .logo {
    color: #fff;
    font-size: 2.5em;
    font-weight: bold;
    text-decoration: none;
    margin-bottom: 10px;
}
.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 30px; /* Space between menu items on large screens */
}
.main-nav a {
    color: #f0f0f0;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1em;
    transition: color 0.3s ease;
}
.main-nav a:hover {
    color: #ff4500;
}
.search-bar {
    display: flex;
    width: 100%;
    max-width: 400px;
    margin-top: 10px;
}
.search-bar input {
    flex-grow: 1;
    padding: 10px;
    border: none;
    border-radius: 4px 0 0 4px;
    outline: none;
    background-color: #333;
    color: #fff;
}
.search-bar button {
    padding: 10px 15px;
    background-color: #ff4500;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.search-bar button:hover {
    background-color: #e63900;
}

/* Main Content */
.main-content {
    padding: 30px 0;
}
.no-videos {
    text-align: center;
    font-size: 1.2em;
    color: #888;
    padding: 50px 0;
}

/* Video Grid (Homepage, Tags, and 'Next' videos) */
.video-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* Explicitly 5 columns for desktop */
    gap: 20px;
}

.video-card {
    background-color: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    position: relative;
}
.video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.6);
}

.video-thumbnail {
    width: 100%;
    height: 150px;
    overflow: hidden;
    position: relative;
    background-color: #000;
}
.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}
.video-card:hover .video-thumbnail img {
    transform: scale(1.05);
}

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3em;
    color: white;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}
.video-card:hover .play-overlay {
    opacity: 1;
}

.video-title {
    font-size: 1.1em;
    margin: 15px;
    color: #f0f0f0;
    line-height: 1.3;
    max-height: 2.6em; /* Limit to 2 lines */
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Pagination */
.pagination {
    margin-top: 40px;
    text-align: center;
}
.pagination a {
    display: inline-block;
    padding: 8px 15px;
    margin: 0 5px;
    background-color: #333;
    color: #f0f0f0;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}
.pagination a:hover,
.pagination a.active {
    background-color: #ff4500;
    color: white;
}

/* Tag Page Title / Related Videos Section Title */
.tag-page-title, .related-videos-section .section-title {
    color: #ff4500;
    font-size: 2em;
    text-align: center;
    margin: 40px 0 30px;
    border-bottom: 1px solid #333;
    padding-bottom: 20px;
}

/* Responsive Adjustments (General) */
@media (max-width: 1200px) {
    .video-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {
    .video-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0px;
    }
    .main-nav li {
        margin: 0 10px;
    }
}

@media (max-width: 768px) {
    .video-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .tag-page-title, .related-videos-section .section-title {
        font-size: 1.6em;
        margin: 30px 0 20px;
    }
}

@media (max-width: 480px) {
    .video-grid {
        grid-template-columns: 1fr;
    }
    .main-header .logo {
        font-size: 2em;
    }
    .main-nav ul {
        flex-direction: column;
        align-items: center;
        margin-bottom: 10px;
    }
    .main-nav li {
        margin: 5px 0;
    }
    .search-bar {
        width: 90%;
    }
    .video-card {
        max-width: 300px;
        margin-left: auto;
        margin-right: auto;
    }
}