/* ------------------------------------- */
/* 1. Global Styles & Background         */
/* ------------------------------------- */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    /* Nice looking background with subtle gradient */
    background: linear-gradient(135deg, #f0f4f8 0%, #d9e2ec 100%);
    color: #333;
    min-height: 100vh;
}

/* ------------------------------------- */
/* 2. Header and Navigation              */
/* ------------------------------------- */

header {
    background-color: #2c3e50; /* Dark blue/charcoal header */
    color: white;
    padding: 20px 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
}

header h1 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 2em;
}

nav {
    padding: 10px 0;
}

nav a {
    color: #ecf0f1; /* Light grey text */
    text-decoration: none;
    margin: 0 12px;
    padding: 8px 15px;
    border-radius: 20px;
    transition: background-color 0.3s, transform 0.2s;
    font-weight: 600;
    display: inline-block;
}

nav a:hover, nav a.active {
    background-color: #34495e; /* Slightly darker on hover/active */
    color: #ffffff;
    transform: translateY(-2px);
}

/* ------------------------------------- */
/* 3. Video Grid Layout (Responsive)     */
/* ------------------------------------- */

.video-grid {
    display: grid;
    /* Default grid for large screens: 4 columns */
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    padding: 30px;
    max-width: 1300px;
    margin: 0 auto;
}

/* ------------------------------------- */
/* 4. Video Card Styling                 */
/* ------------------------------------- */

.video-card {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    cursor: pointer;
    border: 1px solid #ddd;
}

.video-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

.card-content {
    padding: 0;
}

.video-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    border-bottom: 1px solid #eee;
}

.video-card h3 {
    padding: 15px 10px 5px;
    margin: 0;
    font-size: 1.2em;
    font-weight: 700;
    color: #2c3e50;
    text-align: left;
}

/* Description Text Styling */
.video-description {
    padding: 0 15px 15px;
    margin: 0;
    font-size: 0.9em;
    color: #7f8c8d; /* Subtle gray text */
    line-height: 1.4;
}

/* Play Overlay Styling */
.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4em;
    color: white;
    background: rgba(44, 62, 80, 0.8);
    border-radius: 50%;
    width: 80px;
    height: 80px;
    line-height: 80px;
    text-align: center;
    pointer-events: none;
    opacity: 0.9;
    transition: opacity 0.3s;
}

.video-card:hover .play-overlay {
    opacity: 1;
}

/* Hidden elements */
.hidden {
    display: none !important;
}

.video-player-view {
    width: 100%;
    padding: 0; 
}

.video-player-view video {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 12px;
}

/* ------------------------------------- */
/* 5. Mobile Responsiveness (Media Queries) */
/* ------------------------------------- */

/* Tablet View */
@media (max-width: 768px) {
    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
        padding: 20px;
    }

    nav a {
        margin: 0 8px;
        padding: 6px 12px;
    }
}

/* Mobile View */
@media (max-width: 480px) {
    header {
        padding: 15px 0;
    }
    
    .video-grid {
        grid-template-columns: 1fr;
        padding: 15px;
    }

    .video-card {
        width: 100%;
    }

    nav {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    nav a {
        width: 80%;
        margin: 5px 0;
        text-align: center;
    }
}