body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f0f2f5;
    margin: 0;
    /* Remove padding from body to allow header to be full-width */
}

/* --- NEW NAVIGATION HEADER STYLES --- */
.main-header {
    background-color: #2c3e50;
    color: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.main-header .logo {
    font-size: 1.5em;
    font-weight: bold;
}

.main-header nav a.nav-link {
    color: white;
    text-decoration: none;
    margin-left: 20px;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.main-header nav a.nav-link:hover {
    background-color: #34495e;
}

/* Add padding to the main content area */
main {
    padding: 20px;
}
/* --- END NEW STYLES --- */

h1 {
    text-align: center;
    color: #333;
}

.search-container {
    /* (Styles are the same as before) */
    text-align: center;
    margin: 20px 0;
}

#search-input {
    /* (Styles are the same as before) */
    width: 50%;
    max-width: 400px;
    padding: 10px 15px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 20px;
    outline: none;
}

#search-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}
/* --- END NEW STYLES --- */

/* The Grid Container */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    max-width: 1200px;
    margin: 20px auto;
}

.video-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    /* Add flexbox to help position the footer */
    display: flex;
    flex-direction: column;
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.video-card img {
    width: 100%;
    height: auto;
    display: block;
}

.video-card .video-title {
    padding: 10px;
    margin: 0;
    font-size: 14px;
    color: #333;
    text-align: center;
    /* This makes sure the title takes up available space, pushing the footer down */
    flex-grow: 1;
}

.card-footer {
    padding: 10px;
    background-color: #f7f7f7;
    text-align: center;
    border-top: 1px solid #eee;
}

.youtube-link {
    text-decoration: none;
    color: #c4302b; /* YouTube Red */
    font-weight: 500;
    font-size: 14px;
    transition: color 0.2s;
}

.youtube-link:hover {
    color: #ff0000;
    text-decoration: underline;
} 

#video-player-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#video-player-container.hidden {
    display: none;
}

#video-player-container video {
    max-width: 90%;
    max-height: 90%;
    border: 3px solid white;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: white;
    cursor: pointer;
}

.statistics-content {
    max-width: 900px;
    margin: 20px auto;
    background-color: #fff;
    padding: 20px 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.statistics-content section {
    margin-bottom: 40px;
}

.statistics-content h2 {
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 15px;
    color: #2c3e50;
}

table {
    width: 100%;
    border-collapse: collapse; /* Removes space between borders */
    margin-top: 15px;
}

th, td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

thead {
    background-color: #f2f2f2;
    font-weight: bold;
}

/* Zebra-striping for better readability */
tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}
