@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --primary-bg: #121212;
    --secondary-bg: #1e1e1e;
    --card-bg: #2a2a2a;
    --text-primary: #e0e0e0;
    --text-secondary: #b3b3b3;
    --accent-color: #00b8d4; /* A modern teal */
    --accent-hover: #008394;
    --tag-blue-bg: #005f73; /* Defined blue for tags */
    --border-color: #333;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--primary-bg);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

/* Navbar */
.navbar {
    background-color: var(--secondary-bg);
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
    position: sticky; 
    top: 0;
    z-index: 1000;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    font-size: 1.8em;
    font-weight: 700;
    color: var(--accent-color);
    text-decoration: none;
}

.search-bar input[type="search"] {
    padding: 10px 15px;
    border-radius: 25px;
    border: 1px solid var(--border-color);
    background-color: var(--card-bg);
    color: var(--text-primary);
    min-width: 250px;
    font-size: 0.9em;
    transition: box-shadow 0.3s ease;
}
.search-bar input[type="search"]:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--accent-color);
}

.search-bar input[type="search"]::placeholder {
    color: var(--text-secondary);
}

/* Telegram Link */
.telegram-link {
    text-align: center;
    padding: 15px 0;
    background-color: var(--accent-color);
    font-size: 1.1em;
}

.telegram-link a {
    color: var(--primary-bg);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s ease;
}
.telegram-link a:hover {
    opacity: 0.85;
}

/* Section Heading */
.section-heading {
    font-size: 1.5em;
    margin: 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent-color);
    display: inline-block;
    color: var(--text-primary);
}

/* Video Grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr); 
    gap: 20px;
}

.video-card {
    background-color: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text-primary);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color); 
}

.video-card:hover {
    transform: translateY(-5px) scale(1.02); 
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    border-color: var(--accent-color); 
}

.video-card .thumbnail {
    position: relative; /* Kept for general good practice, but not strictly needed for a play button overlay here now */
}

.video-card .thumbnail img {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
    border-bottom: 1px solid var(--border-color);
    /* transition: transform 0.3s ease; */ /* This zoom can be kept or removed, independent of overlay */
}
/* If you want image zoom on card hover (without specific play button interaction on thumbnail): */
.video-card:hover .thumbnail img {
    transform: scale(1.05);
}


.video-card .video-info {
    padding: 10px 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.video-card .video-title {
    font-size: 0.95em;
    font-weight: 500;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 2.8em; 
    color: var(--text-primary);
}
.video-card .video-title:hover {
    color: var(--accent-color); 
}


/* Video Card Meta Tags - Homepage and Related */
.video-card .video-meta {
    display: flex;
    justify-content: space-between;
    align-items: center; 
    font-size: 0.8em; 
    margin-top: auto; 
    padding-top: 8px; 
}

.video-card .video-meta .meta-tag {
    background-color: var(--tag-blue-bg); 
    color: var(--text-primary); 
    padding: 4px 10px; 
    border-radius: 15px; 
    font-size: 0.9em; 
    font-weight: 500;
    display: inline-flex; 
    align-items: center;
    line-height: 1.2; 
}

/* Pagination */
.pagination {
    text-align: center;
    margin: 30px 0;
}

.pagination button, .pagination span {
    background-color: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 8px 15px;
    margin: 0 3px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
    font-weight: 500;
}

.pagination button:hover, .pagination button.active {
    background-color: var(--accent-color);
    color: var(--primary-bg);
    border-color: var(--accent-color);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: var(--secondary-bg);
    border-color: var(--border-color);
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px 0;
    margin-top: 30px;
    background-color: var(--secondary-bg);
    border-top: 1px solid var(--border-color);
    font-size: 0.9em;
    color: var(--text-secondary);
}

/* Video Player Page Specifics */
.video-player-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
}

.video-player-wrapper {
    background-color: #000; 
    width: 100%;
    max-width: 800px; 
    aspect-ratio: 16/9;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
    border-radius: 8px;
    position: relative; 
    border: 2px solid var(--border-color); 
    overflow: hidden; 
}
.video-player-wrapper .video-placeholder-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px; 
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

/* Play Button Overlay for Main Video Placeholder - STYLES KEPT FOR VIDEO PAGE */
.video-player-wrapper .play-button-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px; 
    height: 80px;
    background-color: var(--accent-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    opacity: 0.85; 
    transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.3s ease;
    z-index: 5;
}

.video-player-wrapper .play-button-overlay::before { 
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-top: 18px solid transparent;
    border-bottom: 18px solid transparent;
    border-left: 28px solid var(--primary-bg);
    margin-left: 7px;
}

.video-player-wrapper:hover .play-button-overlay {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1); 
    background-color: var(--accent-hover); 
}
.video-player-wrapper:hover .video-placeholder-img {
    opacity: 0.5; 
}
/* END OF STYLES FOR VIDEO PAGE PLAY BUTTON */


.video-title-page {
    font-size: 1.8em;
    font-weight: 600;
    margin: 10px 0 15px 0;
    text-align: center;
    color: var(--text-primary);
    max-width: 800px; 
    padding: 0 10px; 
}

.video-meta-page {
    display: flex;
    justify-content: space-between; 
    align-items: center;
    width: 100%;
    max-width: 800px; 
    font-size: 1em; 
    margin-bottom: 20px;
    padding: 0 10px; 
}

.video-meta-page .meta-tag {
    background-color: var(--tag-blue-bg); 
    color: var(--text-primary); 
    padding: 6px 12px; 
    border-radius: 20px; 
    font-size: 0.9em; 
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    line-height: 1.2;
}

.play-now-btn {
    background-color: var(--accent-color);
    color: var(--primary-bg);
    border: none;
    padding: 12px 30px;
    font-size: 1.2em;
    font-weight: 600;
    border-radius: 25px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.3s ease, transform 0.2s ease;
    display: inline-block; 
    margin-bottom: 30px;
    text-align: center;
}

.play-now-btn:hover {
    background-color: var(--accent-hover);
    transform: scale(1.05);
}
.play-now-btn:active {
    transform: scale(0.98);
}

.related-videos-section .video-grid {
    grid-template-columns: repeat(5, 1fr);
}


/* Responsiveness */
@media (max-width: 1200px) { 
    .video-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .related-videos-section .video-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) { 
    .video-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .related-videos-section .video-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) { 
    .navbar .container {
        flex-direction: column;
        gap: 10px;
    }
    .search-bar {
        width: 100%;
        padding: 0 10px; 
    }
    .search-bar input[type="search"] {
        width: 100%;
        min-width: auto;
    }
    .video-grid { 
        grid-template-columns: repeat(2, 1fr); 
        gap: 15px; 
    }
    .related-videos-section .video-grid { 
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    .video-title-page {
        font-size: 17px;
    }
    .play-now-btn {
        font-size: 1.1em;
        padding: 10px 25px;
    }
    .section-heading {
        font-size: 1.3em;
    }
}

@media (max-width: 480px) { 
    .logo a {
        font-size: 1.5em;
    }
    .telegram-link {
        font-size: 1em;
        padding: 10px 0;
    }
    .video-grid { 
        grid-template-columns: 1fr; 
    }
    .related-videos-section .video-grid {
        grid-template-columns: 1fr; 
    }

    .video-card .video-title {
        font-size: 0.9em;
        min-height: 2.6em; 
    }
    .video-card .video-meta .meta-tag {
        padding: 3px 8px;
        font-size: 0.85em; 
        border-radius: 12px; 
    }
    .video-meta-page .meta-tag {
        padding: 5px 10px;
        font-size: 0.85em;
        border-radius: 15px;
    }
    .play-now-btn {
        font-size: 1em;
        padding: 10px 20px;
    }
   
    /* --- PAGINATION ADJUSTMENTS FOR MOBILE --- */
    .pagination {
        margin: 20px 0; /* Slightly reduce top/bottom margin */
        display: flex; /* Use flexbox for better control */
        flex-wrap: wrap; /* Allow buttons to wrap to the next line if needed */
        justify-content: center; /* Center the wrapped lines */
        gap: 5px; /* Add a small gap between wrapped items */
    }
    .pagination button, .pagination span {
        padding: 5px 8px;  /* Reduce padding inside buttons */
        font-size: 0.85em; /* Slightly smaller font for page numbers */
        margin: 2px;       /* Reduce margin around buttons */
        flex-shrink: 0; /* Prevent buttons from shrinking too much if flexbox tries to fit them */
    }
    /* Optionally hide ellipsis on very small screens if it still feels crowded,
       though flex-wrap should mostly solve it. The JS already limits page numbers. */
    /*
    .pagination span { 
        display: none; 
    }
    */
    /* --- END OF PAGINATION ADJUSTMENTS --- */

    .container {
        width: 95%; 
    }
}