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

:root {
    --primary: #ff4444;
    --primary-dark: #cc0000;
    --bg-dark: #0f0f0f;
    --bg-card: #1a1a1a;
    --bg-hover: #272727;
    --text-primary: #ffffff;
    --text-secondary: #aaaaaa;
    --border-color: #333;
    --success: #4caf50;
    --warning: #ff9800;
    --danger: #f44336;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* Header */
.header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 10px 0;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: bold;
    color: var(--text-primary);
    cursor: pointer;
}

.logo svg { fill: var(--primary); }

.search-box {
    flex: 1;
    max-width: 600px;
    display: flex;
}

.search-box input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 20px 0 0 20px;
    background: var(--bg-dark);
    color: var(--text-primary);
    font-size: 14px;
}

.search-box button {
    padding: 10px 20px;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-left: none;
    border-radius: 0 20px 20px 0;
    color: var(--text-primary);
    cursor: pointer;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--bg-hover); color: var(--text-primary); }
.btn-secondary:hover { background: #333; }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-small { padding: 6px 12px; font-size: 12px; }

/* Main Layout */
.main-content {
    display: flex;
    min-height: calc(100vh - 60px);
}

.sidebar {
    width: 240px;
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    padding: 20px 0;
    position: sticky;
    top: 60px;
    height: calc(100vh - 60px);
    overflow-y: auto;
}

.sidebar-menu { list-style: none; }

.sidebar-menu li a,
.sidebar-menu li button {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 24px;
    color: var(--text-primary);
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.sidebar-menu li a:hover,
.sidebar-menu li button:hover,
.sidebar-menu li.active a {
    background: var(--bg-hover);
    text-decoration: none;
}

.sidebar-section {
    padding: 10px 24px;
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-top: 10px;
}

.content-area {
    flex: 1;
    padding: 20px;
}

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

.video-card {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s;
    cursor: pointer;
}

.video-card:hover { transform: translateY(-5px); }

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

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

.video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.8);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.video-info { padding: 12px; }

.video-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.video-author { color: var(--text-secondary); }
.video-stats { display: flex; gap: 10px; }

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.badge-public { background: var(--success); color: white; }
.badge-private { background: var(--warning); color: black; }

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active { display: flex; }

.modal-content {
    background: var(--bg-card);
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header h2 { font-size: 18px; }

.modal-close {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
}

.modal-body { padding: 20px; }

/* Forms */
.form-group { margin-bottom: 20px; }

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-dark);
    color: var(--text-primary);
    font-size: 14px;
}

.form-group textarea { min-height: 100px; resize: vertical; }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

/* Video Player Page */
.video-page {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 24px;
}

.video-player-container {
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}

.video-player {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
}

.video-details { padding: 16px 0; }

.video-details h1 {
    font-size: 20px;
    margin-bottom: 10px;
}

.video-actions {
    display: flex;
    gap: 10px;
    margin: 15px 0;
    padding: 15px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.video-description {
    background: var(--bg-hover);
    padding: 15px;
    border-radius: 8px;
    font-size: 14px;
    white-space: pre-wrap;
}

/* User Profile */
.user-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 30px;
    background: var(--bg-card);
    border-radius: 12px;
    margin-bottom: 20px;
}

.user-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    font-weight: bold;
}

.user-info h1 { font-size: 24px; margin-bottom: 5px; }
.user-stats { display: flex; gap: 20px; margin-top: 10px; }
.user-stat { text-align: center; }
.user-stat-value { font-size: 20px; font-weight: bold; }
.user-stat-label { font-size: 12px; color: var(--text-secondary); }

/* Admin Panel */
.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.admin-tab {
    padding: 10px 20px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    border-radius: 4px;
}

.admin-tab.active {
    background: var(--primary);
    color: white;
}

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

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

.admin-table th {
    background: var(--bg-hover);
    font-weight: 600;
}

.admin-table tr:hover { background: var(--bg-hover); }

.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
}

.stat-card-value {
    font-size: 32px;
    font-weight: bold;
    color: var(--primary);
}

.stat-card-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 5px;
}

/* Upload Progress */
.upload-progress {
    margin: 20px 0;
}

.progress-bar {
    height: 8px;
    background: var(--bg-hover);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-success { background: rgba(76, 175, 80, 0.2); border: 1px solid var(--success); }
.alert-error { background: rgba(244, 67, 54, 0.2); border: 1px solid var(--danger); }
.alert-info { background: rgba(33, 150, 243, 0.2); border: 1px solid #2196f3; }

/* Filters */
.filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filters select {
    padding: 8px 15px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
}

/* Loading */
.loading {
    display: flex;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state svg {
    width: 100px;
    height: 100px;
    margin-bottom: 20px;
    opacity: 0.5;
}

/* Responsive */
@media (max-width: 1200px) {
    .video-page { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar { display: none; }
    .header-content { flex-wrap: wrap; }
    .search-box { order: 3; max-width: 100%; flex: 100%; margin-top: 10px; }
    .video-grid { grid-template-columns: 1fr; }
}

/* Hide elements */
.hidden { display: none !important; }

/* Page sections */
.page-section { display: none; }
.page-section.active { display: block; }

.page-title {
    font-size: 24px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}
