body {
    font-family: sans-serif;
    margin: 0;
    background-color: #f4f4f4; /* Light gray background as a fallback */
    background-image: linear-gradient(to right top, #051937, #004d7a, #008793, #00bf72, #a8eb12); /* Gradient background */
    color: #333;
    line-height: 1.6;
}

header {
    background: #333;
    color: #fff;
    padding: 1rem 0;
    text-align: center;
    margin-bottom: 20px;
}

header h1 {
    margin: 0;
    font-size: 2.5rem;
}

.video-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* Center items on the line */
    gap: 20px; /* Space between items */
    padding: 20px;
    max-width: 1200px; /* Max width of the container */
    margin: auto; /* Center the container itself */
}

.video-entry {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    width: 360px; /* Fixed width for each video entry */
    text-align: center;
    padding-bottom: 10px;
    transition: transform 0.2s ease-in-out;
}

.video-player-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio (9 / 16 = 0.5625) */
    height: 0;
    overflow: hidden;
    background: #000; /* Background for the wrapper, visible if iframe fails or during load */
    border-top-left-radius: 8px; /* Match card's border radius */
    border-top-right-radius: 8px; /* Match card's border radius */
}

.video-player-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0; /* Remove default iframe border */
}

.video-entry:hover {
    transform: none; /* Disable zoom effect as it might interfere with player controls */
}

.video-entry .video-title {
    font-size: 1.1rem;
    font-weight: bold;
    padding: 5px 10px;
    color: #333;
    min-height: auto; /* Ensure titles have enough space, prevents uneven card heights */
    margin-top: 8px; /* Add some space between player and title */
    line-height: 1.2;
}

footer {
    text-align: center;
    padding: 20px;
    background: #333;
    color: #fff;
    margin-top: 30px;
}

/* Responsive design for smaller screens */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .video-container {
        flex-direction: column; /* Stack items vertically */
        align-items: center; /* Center items when stacked */
    }

    .video-entry {
        width: 90%; /* Make cards wider on small screens */
        max-width: 400px; /* But not too wide */
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.8rem;
    }
    .video-entry .video-title {
        font-size: 1rem;
        min-height: auto;
        padding: 5px 8px;
    }
}

/* Styles for error.html page */
.error-container {
    text-align: center;
    padding: 40px 20px;
    margin: 20px auto;
    background: rgba(255, 255, 255, 0.1); /* Slight white transparency to make text pop a bit on gradient */
    border-radius: 8px;
    max-width: 600px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.error-container p {
    font-size: 1.2rem;
    color: #fff; /* White text for better contrast on the dark gradient */
    margin-bottom: 15px;
}

.error-container a {
    color: #a8eb12; /* Using one of the prominent gradient colors for the link */
    text-decoration: underline;
}

.error-container a:hover {
    color: #fff;
    text-decoration: none;
}

/* Ensure main content area has some min height if footer is too close */
body > main {
    min-height: calc(100vh - 160px); /* Adjust 160px based on header and footer height */
    /* This helps push footer down if content is short, like on error page */
}
