* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Navbar */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px 0;
    margin-bottom: 30px;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand h2 {
    color: #667eea;
    font-size: 24px;
}

.nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-links a {
    color: #333;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 5px;
    transition: all 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    background: #667eea;
    color: white;
}

.username {
    color: #667eea;
    font-weight: 600;
}

.btn-logout {
    background: #ff4757;
    color: white !important;
    padding: 8px 16px;
    border-radius: 5px;
    text-decoration: none;
}

.btn-logout:hover {
    background: #ff3838;
}

/* Auth Container */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-box {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.auth-box h1 {
    color: #667eea;
    margin-bottom: 30px;
    text-align: center;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.btn-primary {
    background: #667eea;
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
    margin-top: 10px;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-danger {
    background: #ff4757;
    color: white;
    padding: 8px 16px;
}

.btn-danger:hover {
    background: #ff3838;
}

.btn-edit {
    background: #2ecc71;
    color: white;
    padding: 8px 16px;
    margin-right: 10px;
}

.btn-edit:hover {
    background: #27ae60;
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-error {
    background: #ffe5e5;
    color: #d63031;
    border: 1px solid #ff7675;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.auth-link {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

.auth-link a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

/* Upload Section */
.upload-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 40px;
}

.upload-section h2 {
    color: #667eea;
    margin-bottom: 25px;
}

.video-resolutions,
.subtitles-section {
    margin: 25px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.video-resolutions h3,
.subtitles-section h3 {
    color: #555;
    margin-bottom: 15px;
    font-size: 18px;
}

.resolution-row,
.subtitle-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 15px;
    margin-bottom: 15px;
    align-items: center;
}

.subtitle-row {
    grid-template-columns: 1fr 1fr;
}

.resolution-row label {
    font-weight: 600;
    color: #667eea;
}

/* Progress Bar */
.progress-container {
    margin: 20px 0;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    height: 30px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.3s;
    width: 0;
}

#progressText {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 600;
    color: #333;
}

/* Videos Section */
.videos-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.videos-section h2 {
    color: #667eea;
    margin-bottom: 25px;
}

.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.video-card {
    background: #f8f9fa;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.video-thumbnail {
    width: 100%;
    height: 160px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 48px;
}

.video-info {
    padding: 15px;
}

.video-info h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 16px;
}

.video-info p {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
}

.video-stats {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: #999;
    margin-top: 10px;
}

.video-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* Player Section */
.player-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.player-section h1 {
    color: #667eea;
    margin-bottom: 20px;
}

.video-player-wrapper {
    margin-bottom: 30px;
}

.video-player-wrapper video {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.quality-selector {
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.quality-selector label {
    font-weight: 600;
    color: #555;
}

.quality-selector select {
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    cursor: pointer;
}

/* Manage Videos */
.manage-videos-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.manage-video-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.manage-video-info h3 {
    color: #333;
    margin-bottom: 10px;
}

.manage-video-info p {
    color: #666;
    font-size: 14px;
}

/* Modal */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    position: relative;
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.loading {
    text-align: center;
    color: #666;
    padding: 40px;
    font-size: 16px;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .resolution-row,
    .subtitle-row {
        grid-template-columns: 1fr;
    }
    
    .videos-grid {
        grid-template-columns: 1fr;
    }
    
    .manage-video-item {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}