/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #0f0f0f;
    color: #fff;
    line-height: 1.6;
}

/* Login Page */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.login-box h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #fff;
}

.subtitle {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 30px;
}

.input-group input {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 1rem;
    margin-bottom: 20px;
}

.input-group input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.btn-primary {
    background: #ff0000;
    color: white;
}

.btn-primary:hover {
    background: #cc0000;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #272727;
    color: white;
}

.btn-secondary:hover {
    background: #3d3d3d;
}

/* Header */
.header {
    background: #212121;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    color: #ff0000;
    text-decoration: none;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.username {
    color: #aaa;
    font-size: 0.9rem;
}

.logout-btn {
    color: #ff0000;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 5px;
    transition: background 0.3s;
}

.logout-btn:hover {
    background: rgba(255, 0, 0, 0.1);
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}

.videos-container h2 {
    margin-bottom: 20px;
    color: #fff;
}

/* Videos Grid */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

@media (min-width: 768px) {
    .videos-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .videos-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.video-card {
    background: #272727;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.video-card:hover {
    transform: translateY(-5px);
}

.video-card a {
    text-decoration: none;
    color: inherit;
}

.thumbnail-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
}

.video-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-info {
    padding: 15px;
}

.video-title {
    font-size: 1rem;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #aaa;
}

/* Video Player Page */
.video-page {
    max-width: 1400px;
    margin: 20px auto;
    padding: 0 20px;
}

.video-player-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

@media (min-width: 1024px) {
    .video-player-container {
        grid-template-columns: 2fr 1fr;
    }
}

.main-video-section {
    background: #272727;
    border-radius: 10px;
    padding: 20px;
}

.video-player {
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
}

.video-player video {
    width: 100%;
    height: auto;
    border-radius: 10px;
}

.video-details h1 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.video-description {
    color: #aaa;
    margin-bottom: 20px;
    line-height: 1.6;
}

.video-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-top: 1px solid #3d3d3d;
    border-bottom: 1px solid #3d3d3d;
}

.interaction-buttons {
    display: flex;
    gap: 10px;
}

.like-btn, .dislike-btn {
    background: #3d3d3d;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background 0.3s;
}

.like-btn:hover, .dislike-btn:hover {
    background: #4a4a4a;
}

.like-btn.active {
    background: #ff0000;
    color: white;
}

.dislike-btn.active {
    background: #0066ff;
    color: white;
}

/* Comments Section */
.comments-section {
    margin-top: 30px;
}

.comments-section h3 {
    margin-bottom: 20px;
}

.add-comment {
    margin-bottom: 30px;
}

.add-comment textarea {
    width: 100%;
    padding: 15px;
    background: #3d3d3d;
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    margin-bottom: 10px;
    min-height: 100px;
    resize: vertical;
}

.comment-item {
    background: #3d3d3d;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    color: #aaa;
    font-size: 0.9rem;
}

.comment-text {
    color: white;
    line-height: 1.5;
}

/* Related Videos */
.related-videos {
    background: #272727;
    border-radius: 10px;
    padding: 20px;
}

.related-videos h3 {
    margin-bottom: 20px;
}

.related-videos-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.related-video-item {
    display: flex;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    transition: background 0.3s;
    padding: 10px;
    border-radius: 5px;
}

.related-video-item:hover {
    background: #3d3d3d;
}

.related-video-item img {
    width: 120px;
    height: 68px;
    object-fit: cover;
    border-radius: 5px;
}

.related-video-info {
    flex: 1;
}

.related-video-info h4 {
    font-size: 0.9rem;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-video-meta {
    font-size: 0.8rem;
    color: #aaa;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Load More Button */
.load-more-container {
    text-align: center;
    margin: 30px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .video-stats {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .interaction-buttons {
        width: 100%;
    }
    
    .like-btn, .dislike-btn {
        flex: 1;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .videos-grid {
        grid-template-columns: 1fr;
    }
    
    .login-box {
        padding: 20px;
    }
    
    .login-box h1 {
        font-size: 2rem;
    }
}

/* Alert Messages */
.alert {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
}

.alert-error {
    background: rgba(255, 0, 0, 0.1);
    color: #ff4444;
    border: 1px solid #ff4444;
}

.alert-success {
    background: rgba(0, 255, 0, 0.1);
    color: #44ff44;
    border: 1px solid #44ff44;
}