:root {
    --primary: #ff0000;
    --dark: #181818;
    --light: #f9f9f9;
    --text: #0f0f0f;
    --gray: #606060;
    --border: #e5e5e5;
    --success: #28a745;
    --error: #dc3545;
}

body {
    font-family: 'Roboto', Arial, sans-serif;
    margin: 0;
    background-color: var(--light);
    color: var(--text);
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 2rem;
    background: white;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 5px rgba(0,0,0,0.1);
}

.logo { font-weight: bold; font-size: 1.2rem; display: flex; align-items: center; gap: 5px; }
.nav-links a { text-decoration: none; color: var(--text); margin-left: 15px; font-size: 0.9rem; }
.nav-links a:hover { color: var(--primary); }

/* Search */
.search-box input {
    padding: 8px 15px;
    border: 1px solid #ccc;
    border-radius: 20px;
    width: 300px;
    font-size: 1rem;
}

/* Container */
.container { max-width: 1400px; margin: 20px auto; padding: 0 20px; }

/* Alerts */
.alert { padding: 12px 20px; border-radius: 5px; margin-bottom: 20px; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* Filters */
.filters { margin-bottom: 20px; display: flex; gap: 10px; overflow-x: auto; padding-bottom: 10px; }
.filter-btn {
    background: #e5e5e5;
    border: none;
    padding: 8px 15px;
    border-radius: 15px;
    cursor: pointer;
    font-weight: 500;
    transition: 0.2s;
}
.filter-btn:hover, .filter-btn.active { background: var(--text); color: white; }

/* Video Grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.video-card { cursor: pointer; transition: transform 0.2s; }
.video-card:hover { transform: translateY(-3px); }

.thumbnail {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}

.thumbnail img {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover;
    opacity: 0.9;
}

.play-icon {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.7);
    color: white;
    width: 50px; height: 50px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
}

.video-info h3 { font-size: 1rem; margin: 10px 0 5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.badge { font-size: 0.8rem; color: var(--gray); background: #eee; padding: 2px 8px; border-radius: 4px; }

/* Admin Styles */
.admin-panel { background: white; padding: 25px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); margin-bottom: 30px; }
.admin-panel h2 { margin-top: 0; border-bottom: 2px solid var(--border); padding-bottom: 10px; }
.admin-form { display: flex; gap: 10px; margin-bottom: 30px; flex-wrap: wrap; }
.admin-form input, .admin-form select { padding: 10px; border: 1px solid #ddd; border-radius: 4px; flex: 1; min-width: 200px; }
.admin-form button { padding: 10px 20px; background: var(--primary); color: white; border: none; border-radius: 4px; cursor: pointer; }
.admin-form button:hover { background: #cc0000; }

.admin-table { width: 100%; border-collapse: collapse; margin-top: 15px; }
.admin-table th, .admin-table td { text-align: left; padding: 12px; border-bottom: 1px solid #eee; }
.admin-table th { background: #f8f9fa; font-weight: 600; }
.btn-delete { color: var(--error); text-decoration: none; font-weight: bold; }
.btn-delete:hover { text-decoration: underline; }
.text-gray { color: var(--gray); font-size: 0.9rem; }

/* Login */
.login-box { max-width: 400px; margin: 80px auto; background: white; padding: 30px; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); text-align: center; }
.login-box h2 { margin-top: 0; }
.login-box input { width: 90%; padding: 12px; margin-bottom: 15px; border: 1px solid #ddd; border-radius: 4px; }
.login-box button { width: 100%; padding: 12px; background: var(--dark); color: white; border: none; border-radius: 4px; cursor: pointer; }
.login-box a { color: var(--gray); text-decoration: none; }

/* Modal */
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.9); }
.modal-content { margin: 5% auto; width: 80%; max-width: 900px; background: #000; padding: 20px; border-radius: 8px; position: relative; }
.close { position: absolute; top: -30px; right: 0; color: white; font-size: 30px; cursor: pointer; }
.video-wrapper { position: relative; padding-bottom: 56.25%; height: 0; }
.video-wrapper iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
#modalTitle { color: white; margin-top: 15px; }

.no-content { text-align: center; color: var(--gray); padding: 50px; font-size: 1.2rem; }

@media (max-width: 600px) {
    .navbar { flex-direction: column; gap: 10px; }
    .search-box input { width: 100%; box-sizing: border-box; }
    .modal-content { width: 95%; margin: 10% auto; }
    .admin-form { flex-direction: column; }
    .admin-form input, .admin-form select, .admin-form button { width: 100%; }
}