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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #0f0f0f;
    color: #f1f1f1;
    line-height: 1.6;
}

a {
    color: #3ea6ff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.header {
    background: #202020;
    border-bottom: 1px solid #303030;
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 24px;
    font-weight: bold;
}

.logo a {
    color: #ff0000;
    text-decoration: none;
}

.search-bar {
    flex: 1;
    max-width: 600px;
    margin: 0 40px;
}

.search-bar form {
    display: flex;
}

.search-bar input {
    flex: 1;
    padding: 8px 12px;
    background: #121212;
    border: 1px solid #303030;
    color: #f1f1f1;
    border-radius: 2px 0 0 2px;
}

.search-bar button {
    padding: 8px 20px;
    background: #303030;
    border: 1px solid #303030;
    color: #f1f1f1;
    cursor: pointer;
    border-radius: 0 2px 2px 0;
}

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

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-menu a {
    color: #f1f1f1;
    text-decoration: none;
    transition: color 0.2s;
}

.user-menu a:hover {
    color: #ff0000;
    text-decoration: none;
}

.btn-upload {
    background: #ff0000;
    color: white !important;
    padding: 8px 16px;
    border-radius: 2px;
    text-decoration: none;
}

.btn-upload:hover {
    background: #cc0000;
    color: white !important;
    text-decoration: none;
}

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

.sidebar {
    width: 240px;
    background: #181818;
    padding: 20px;
    border-radius: 4px;
    position: sticky;
    top: 80px;
    height: fit-content;
}

.categories h3 {
    margin-bottom: 15px;
    color: #aaa;
    font-size: 14px;
    text-transform: uppercase;
}

.categories ul {
    list-style: none;
}

.categories li {
    margin-bottom: 10px;
}

.categories a {
    color: #f1f1f1;
    display: block;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background 0.2s;
}

.categories a:hover,
.categories a.active {
    background: #303030;
    text-decoration: none;
}

.content {
    flex: 1;
}

.content h2 {
    margin-bottom: 20px;
}

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

.video-card {
    background: #181818;
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

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

.video-card .thumbnail {
    position: relative;
    padding-bottom: 56.25%;
    background: #000;
}

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

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

.video-info {
    padding: 12px;
}

.video-info h3 {
    font-size: 14px;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.video-info .meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: #aaa;
}

.video-info .meta span {
    display: block;
}

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-box {
    background: #181818;
    padding: 40px;
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
}

.auth-box h2 {
    margin-bottom: 30px;
    text-align: center;
}

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

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    background: #121212;
    border: 1px solid #303030;
    color: #f1f1f1;
    border-radius: 4px;
    font-size: 14px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #aaa;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.btn-primary {
    background: #ff0000;
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: #cc0000;
}

.alert {
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert-error {
    background: #ff00001a;
    border: 1px solid #ff0000;
    color: #ff6b6b;
}

.alert-success {
    background: #00ff001a;
    border: 1px solid #00ff00;
    color: #51cf66;
}

.auth-link {
    text-align: center;
    margin-top: 20px;
    color: #aaa;
}

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

.video-player-section {
    flex: 1;
}

.video-player {
    background: #000;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 20px;
}

.video-player video {
    width: 100%;
    height: auto;
    max-height: 720px;
}

.video-details {
    background: #181818;
    padding: 20px;
    border-radius: 4px;
}

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

.video-stats {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px 0;
    border-bottom: 1px solid #303030;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.video-stats .views,
.video-stats .date {
    color: #aaa;
    font-size: 14px;
}

.video-actions {
    margin-left: auto;
    display: flex;
    gap: 10px;
}

.inline-form {
    display: flex;
    gap: 10px;
}

.btn-like,
.btn-dislike {
    padding: 8px 16px;
    background: #303030;
    border: none;
    color: #f1f1f1;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-like:hover,
.btn-dislike:hover {
    background: #3a3a3a;
}

.video-meta {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #303030;
}

.video-meta > div {
    margin-bottom: 8px;
}

.video-description {
    color: #f1f1f1;
}

.video-description h3 {
    margin-bottom: 12px;
    font-size: 16px;
}

.video-description p {
    color: #aaa;
    line-height: 1.6;
}

.related-videos {
    width: 350px;
}

.related-videos h3 {
    margin-bottom: 16px;
}

.related-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.related-video-card {
    display: flex;
    gap: 12px;
    background: #181818;
    padding: 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.related-video-card:hover {
    background: #252525;
}

.related-video-card a {
    display: flex;
    gap: 12px;
    width: 100%;
    color: inherit;
}

.related-video-card a:hover {
    text-decoration: none;
}

.related-video-card .thumbnail {
    width: 168px;
    height: 94px;
    position: relative;
    flex-shrink: 0;
}

.related-video-card .thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.related-video-card .thumbnail .duration {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 2px 4px;
    border-radius: 2px;
    font-size: 11px;
    font-weight: 500;
}

.related-video-card .info {
    flex: 1;
}

.related-video-card h4 {
    font-size: 14px;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.related-video-card .meta {
    font-size: 12px;
    color: #aaa;
}

.related-video-card .meta span {
    display: block;
    margin-top: 4px;
}

.upload-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 20px;
}

.upload-box {
    background: #181818;
    padding: 40px;
    border-radius: 8px;
}

.upload-box h2 {
    margin-bottom: 30px;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 40px;
}

.page-info {
    color: #aaa;
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #aaa;
}

@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        position: static;
    }
    
    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .watch-container {
        flex-direction: column;
    }
    
    .related-videos {
        width: 100%;
    }
    
    .header-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-bar {
        width: 100%;
        margin: 10px 0;
    }
}