/* --- Global Styles --- */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    background-color: #f4f4f4;
    color: #333;
}

header {
    background-color: #ff0000;
    color: white;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

header h1 {
    margin: 0 0 10px 0;
}

.search-container {
    width: 100%;
    max-width: 600px;
}

#search-bar {
    width: 100%;
    padding: 10px;
    border-radius: 20px;
    border: none;
    font-size: 1rem;
}

a {
    text-decoration: none;
    color: inherit;
}

.hidden {
    display: none;
}

/* --- Homepage Styles (index.html) --- */
.homepage-main {
    padding: 20px;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.video-card {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.video-card .thumbnail {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}

.video-card .video-title {
    padding: 10px;
    margin: 0;
    font-size: 1rem;
    font-weight: bold;
}

#no-results {
    text-align: center;
    font-size: 1.2rem;
    color: #666;
    margin-top: 40px;
}


/* --- Watch Page Styles (watch.html) --- */
.main-container {
    display: flex;
    flex-wrap: wrap;
    padding: 20px;
}

.video-player-section {
    flex: 3;
    min-width: 300px;
    padding-right: 20px;
}

#main-video-player {
    width: 100%;
    background-color: #000;
    border-radius: 8px;
}

#video-title {
    margin-top: 15px;
    margin-bottom: 5px;
}

#video-description {
    margin-top: 0;
    color: #666;
}

.video-list-section {
    flex: 1;
    min-width: 250px;
    max-height: 80vh;
    overflow-y: auto;
}

.video-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    background-color: #fff;
    border-radius: 5px;
    transition: background-color 0.2s ease;
}

.video-item:hover {
    background-color: #e9e9e9;
}

.video-item img {
    width: 120px;
    height: 70px;
    object-fit: cover;
    border-radius: 5px 0 0 5px;
}

.video-item .info {
    padding: 10px;
}

.video-item .info h4 {
    margin: 0;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
    }
    .video-player-section {
        padding-right: 0;
    }
    .video-list-section {
        max-height: none;
        margin-top: 20px;
    }
}

/* --- Header Navigation --- */
header {
    flex-direction: row; /* Change header layout */
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Allow wrapping on small screens */
}
.main-nav {
    display: flex;
    align-items: center;
    gap: 15px;
}
.main-nav a {
    color: white;
    text-decoration: none;
    font-weight: bold;
}
.main-nav .btn-register {
    background-color: white;
    color: #ff0000;
    padding: 8px 15px;
    border-radius: 20px;
}

/* --- Form Styles (for Register & Login) --- */
.form-container {
    max-width: 400px;
    margin: 40px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.form-container h2 {
    text-align: center;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box; /* Important for padding */
}

.btn {
    width: 100%;
    padding: 10px;
    background-color: #ff0000;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn:hover {
    background-color: #cc0000;
}

.form-container p {
    text-align: center;
    margin-top: 15px;
}