* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    line-height: 1.6;
    background: #f9f9f9;
}

/* Header */
header {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 1rem 0;
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.logo a {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ff0000;
    text-decoration: none;
}

.nav-links a {
    margin: 0 15px;
    color: #333;
    text-decoration: none;
}

.nav-links a:hover {
    color: #ff0000;
}

.user-menu a {
    margin-left: 15px;
    color: #333;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 3px;
}

.user-menu a:hover {
    background: #f0f0f0;
}

/* Main content */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 20px;
}

/* Video Grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.video-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

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

.video-card a {
    text-decoration: none;
    color: inherit;
}

.thumbnail {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    background: #ddd;
}

.thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eee;
    color: #999;
}

.video-card h3 {
    padding: 10px;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.video-meta {
    padding: 0 10px 10px;
    font-size: 0.85rem;
    color: #666;
}

.video-meta span {
    margin-right: 10px;
}

/* Search bar */
.search-bar {
    margin-bottom: 30px;
}

.search-bar form {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
}

.search-bar input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    font-size: 16px;
}

.search-bar button {
    padding: 10px 20px;
    background: #ff0000;
    color: #fff;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-size: 16px;
}

.search-bar button:hover {
    background: #cc0000;
}

/* Video Player Page */
.video-player-container {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#video-player {
    width: 100%;
    background: #000;
    border-radius: 4px;
}

.video-info {
    margin-top: 20px;
}

.video-info h1 {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.video-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
    color: #666;
}

.video-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.video-actions button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

#like-btn {
    background: #f0f0f0;
}

#like-btn.liked {
    background: #ff0000;
    color: #fff;
}

#share-btn {
    background: #1da1f2;
    color: #fff;
}

.video-description {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 4px;
    line-height: 1.8;
}

/* Login Form */
.login-form {
    max-width: 400px;
    margin: 50px auto;
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.login-form h2 {
    margin-bottom: 20px;
    text-align: center;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

button[type="submit"] {
    width: 100%;
    padding: 10px;
    background: #ff0000;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
}

button[type="submit"]:hover {
    background: #cc0000;
}

/* Upload Form */
.upload-form {
    max-width: 600px;
    margin: 0 auto;
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.upload-form h2 {
    margin-bottom: 20px;
}

/* Admin Panel */
.admin-panel {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.admin-panel h2 {
    margin: 30px 0 15px;
}

.admin-panel h2:first-child {
    margin-top: 0;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.admin-table th {
    background: #f5f5f5;
    font-weight: 600;
}

.admin-table tr:hover {
    background: #f9f9f9;
}

.admin-table a {
    margin-right: 10px;
    color: #0066cc;
    text-decoration: none;
}

.admin-table a:hover {
    text-decoration: underline;
}

.admin-table .approve {
    color: #28a745;
}

.admin-table .reject {
    color: #dc3545;
}

.admin-table .delete {
    color: #dc3545;
}

/* Messages */
.error {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.success {
    background: #d4edda;
    color: #155724;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    background: #fff;
    border-top: 1px solid #eee;
    margin-top: 50px;
}

/* Responsive */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-links {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-links a {
        margin: 5px;
    }
    
    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .video-info h1 {
        font-size: 1.4rem;
    }
    
    .video-stats {
        flex-direction: column;
        gap: 5px;
    }
}

/* Video Player Container - More Compact */
.video-player-container {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-width: 1000px; /* Limit maximum width */
    margin: 0 auto; /* Center the container */
}

/* Make video player smaller */
#video-player {
    width: 100%;
    max-width: 854px; /* Standard 720p width */
    height: auto;
    max-height: 480px; /* Limit height */
    background: #000;
    border-radius: 4px;
    display: block;
    margin: 0 auto; /* Center the video */
}

/* Optional: Add video size controls */
.video-size-controls {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.video-size-btn {
    padding: 5px 10px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.video-size-btn:hover {
    background: #e0e0e0;
}

.video-size-btn.active {
    background: #ff0000;
    color: #fff;
    border-color: #cc0000;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .video-player-container {
        padding: 10px;
    }
    
    #video-player {
        max-height: 300px; /* Even smaller on mobile */
    }
}

/* Optional: Cinema mode (wider) */
.video-player-container.cinema-mode #video-player {
    max-width: 1280px;
    max-height: 720px;
}

/* Compact layout for video info */
.video-info h1 {
    font-size: 1.5rem; /* Smaller title */
    margin: 15px 0 10px;
}

.video-stats {
    font-size: 0.9rem;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.video-description {
    max-height: 150px; /* Limit description height */
    overflow-y: auto; /* Add scroll if too long */
    font-size: 0.95rem;
    padding: 12px;
}