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

:root {
    --primary-color: #ff0000;
    --secondary-color: #1a1a1a;
    --text-color: #333;
    --light-text: #666;
    --background: #f9f9f9;
    --white: #fff;
    --border-color: #ddd;
    --shadow: 0 2px 5px rgba(0,0,0,0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--background);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.header {
    background: var(--secondary-color);
    color: var(--white);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo a {
    color: var(--white);
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-list a {
    color: var(--white);
    text-decoration: none;
    padding: 0.5rem;
}

.nav-list a:hover,
.nav-list a.active {
    color: var(--primary-color);
}

.search-box form {
    display: flex;
    gap: 0.5rem;
}

.search-box input {
    padding: 0.5rem;
    border: none;
    border-radius: 3px;
    min-width: 250px;
}

.search-box button {
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

.search-box button:hover {
    opacity: 0.9;
}

.main-content {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.video-card {
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
}

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

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

.video-thumbnail {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.video-card:hover .video-thumbnail img {
    transform: scale(1.05);
}

.video-duration {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,0.8);
    color: var(--white);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.8rem;
}

.video-info {
    padding: 1rem;
}

.video-title {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--light-text);
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.pagination a {
    padding: 0.5rem 1rem;
    background: var(--white);
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-color);
    border-radius: 3px;
}

.pagination a:hover,
.pagination a.active {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.video-player-container {
    background: var(--secondary-color);
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.video-player-wrapper {
    max-width: 1000px;
    margin: 0 auto;
}

.video-js {
    width: 100%;
    aspect-ratio: 16/9;
}

.video-details {
    color: var(--white);
    margin-top: 1rem;
}

.video-details .video-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.video-details .video-description {
    background: rgba(255,255,255,0.1);
    padding: 1rem;
    border-radius: 4px;
    margin-top: 1rem;
}

.related-videos h2 {
    margin-bottom: 1rem;
}

.search-header {
    margin-bottom: 2rem;
}

.search-header h1 {
    margin-bottom: 1rem;
}

.search-form {
    max-width: 600px;
    margin: 1rem 0;
}

.search-form input {
    width: 70%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 3px 0 0 3px;
}

.search-form button {
    width: 30%;
    padding: 0.75rem;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 0 3px 3px 0;
    cursor: pointer;
}

.search-info {
    background: #e3f2fd;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.no-results {
    text-align: center;
    padding: 3rem;
    color: var(--light-text);
}

.footer {
    background: var(--secondary-color);
    color: var(--white);
    padding: 2rem 0;
    margin-top: 2rem;
}

.footer-content {
    text-align: center;
}

.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 250px;
    background: var(--secondary-color);
    color: var(--white);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-nav ul {
    list-style: none;
    padding: 1rem 0;
}

.sidebar-nav li a {
    display: block;
    padding: 0.75rem 1.5rem;
    color: var(--white);
    text-decoration: none;
    transition: background 0.3s;
}

.sidebar-nav li a:hover,
.sidebar-nav li a.active {
    background: var(--primary-color);
}

.admin-main {
    flex: 1;
    margin-left: 250px;
    padding: 2rem;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.admin-form {
    max-width: 800px;
    background: var(--white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: var(--light-text);
    font-size: 0.85rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: opacity 0.3s;
}

.btn:hover {
    opacity: 0.9;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
}

.btn-secondary {
    background: var(--light-text);
    color: var(--white);
}

.btn-danger {
    background: #dc3545;
    color: var(--white);
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-small {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
    background: var(--primary-color);
    color: var(--white);
    text-decoration: none;
    border-radius: 3px;
    margin-right: 0.25rem;
}

.data-table {
    width: 100%;
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.data-table thead {
    background: var(--secondary-color);
    color: var(--white);
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table tbody tr:hover {
    background: #f5f5f5;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-label {
    color: var(--light-text);
    margin-top: 0.5rem;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-active {
    background: #28a745;
    color: var(--white);
}

.status-inactive {
    background: #dc3545;
    color: var(--white);
}

.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.bulk-actions {
    margin-bottom: 1rem;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.bulk-actions select {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 3px;
}

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
}

.login-box {
    background: var(--white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.login-box h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--secondary-color);
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .nav-list {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .search-box form {
        width: 100%;
    }
    
    .search-box input {
        flex: 1;
    }
    
    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .admin-layout {
        flex-direction: column;
    }
    
    .admin-sidebar {
        width: 100%;
        height: auto;
        position: static;
    }
    
    .admin-main {
        margin-left: 0;
    }
    
    .sidebar-nav ul {
        display: flex;
        flex-wrap: wrap;
    }
    
    .sidebar-nav li {
        flex: 1 1 auto;
    }
    
    .data-table {
        display: block;
        overflow-x: auto;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn-block-mobile {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .video-grid {
        grid-template-columns: 1fr;
    }
    
    .video-player-container {
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .bulk-actions {
        flex-direction: column;
    }
    
    .bulk-actions select,
    .bulk-actions button {
        width: 100%;
    }
}

.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }