/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background-color: #0f0f0f;
    color: #ffffff;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Navigation Styles */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(15, 15, 15, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #333;
    z-index: 1000;
    padding: 0 20px;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 40px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 24px;
    font-weight: 800;
    color: #ff6b6b;
}

.logo i {
    font-size: 28px;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-link {
    color: #ccc;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.nav-center {
    flex: 1;
    max-width: 600px;
    margin: 0 40px;
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

#searchInput {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    border-radius: 25px;
    color: #ffffff;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

#searchInput:focus {
    border-color: #ff6b6b;
    background: rgba(255, 255, 255, 0.15);
}

#searchInput::placeholder {
    color: #999;
}

.search-btn {
    position: absolute;
    right: 8px;
    background: #ff6b6b;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-btn:hover {
    background: #ff5252;
    transform: scale(1.05);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.upload-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #ff6b6b, #ff8a80);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.3);
}

.user-menu {
    position: relative;
}

.user-avatar {
    background: none;
    border: none;
    color: #ccc;
    font-size: 24px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.user-avatar:hover {
    color: #ff6b6b;
}

.user-dropdown {
    position: absolute;
    top: 40px;
    right: 0;
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 12px 0;
    min-width: 180px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.user-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #ccc;
    text-decoration: none;
    transition: all 0.3s ease;
}

.user-dropdown a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

/* Main Content */
.main-content {
    margin-top: 70px;
    padding: 0 20px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* Hero Section */
.hero-section {
    position: relative;
    height: 500px;
    border-radius: 20px;
    overflow: hidden;
    margin: 30px 0;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
}

.hero-content {
    position: absolute;
    top: 50%;
    left: 50px;
    transform: translateY(-50%);
    z-index: 2;
    max-width: 500px;
}

.hero-content h1 {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #ff6b6b, #ff8a80);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-content p {
    font-size: 18px;
    color: #ccc;
    margin-bottom: 30px;
    line-height: 1.5;
}

.cta-btn {
    background: linear-gradient(135deg, #ff6b6b, #ff8a80);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cta-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(255, 107, 107, 0.4);
}

.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.hero-video::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.3));
    z-index: 1;
}

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

/* Categories Filter */
.categories-filter {
    margin: 40px 0;
}

.filter-container {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding: 10px 0;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #ccc;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.filter-btn:hover,
.filter-btn.active {
    background: #ff6b6b;
    color: white;
    transform: translateY(-2px);
}

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 40px 0 20px 0;
}

.section-header h2 {
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header i {
    color: #ff6b6b;
}

.view-all-btn {
    background: none;
    border: 1px solid #333;
    color: #ccc;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-all-btn:hover {
    border-color: #ff6b6b;
    color: #ff6b6b;
}

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

.video-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

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

.video-thumbnail {
    position: relative;
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    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);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 107, 107, 0.9);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.video-card:hover .play-overlay {
    opacity: 1;
}

.play-overlay i {
    color: white;
    font-size: 24px;
    margin-left: 3px;
}

.video-info {
    padding: 20px;
}

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

.video-meta {
    display: flex;
    justify-content: space-between;
    color: #999;
    font-size: 14px;
}

/* Trending Carousel */
.trending-carousel {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 20px 0;
}

.trending-card {
    min-width: 250px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.trending-card:hover {
    transform: scale(1.05);
}

/* Recent Grid */
.recent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 60px;
}

.recent-card {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.recent-card:hover {
    background: rgba(255, 255, 255, 0.1);
}

.recent-thumbnail {
    width: 120px;
    height: 80px;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    flex-shrink: 0;
}

.recent-info {
    padding: 15px;
    flex: 1;
}

.recent-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 5px;
    line-height: 1.3;
}

.recent-progress {
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    margin-top: 8px;
}

.recent-progress-bar {
    height: 100%;
    background: #ff6b6b;
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Modal Styles */
.video-modal,
.upload-modal,
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.video-modal.active,
.upload-modal.active,
.auth-modal.active {
    opacity: 1;
    visibility: visible;
}

.video-modal-content {
    background: #1a1a1a;
    border-radius: 20px;
    padding: 30px;
    max-width: 90%;
    max-height: 90%;
    width: 1000px;
    position: relative;
}

.upload-modal-content,
.auth-modal-content {
    background: #1a1a1a;
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    position: relative;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: #ccc;
    font-size: 24px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: #ff6b6b;
}

/* Video Player */
.video-player-container {
    width: 100%;
    margin-bottom: 20px;
}

#videoPlayer {
    width: 100%;
    height: 400px;
    border-radius: 10px;
    background: #000;
}

.video-info h3 {
    font-size: 24px;
    margin-bottom: 10px;
}

.video-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    color: #999;
}

.video-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #ccc;
    padding: 10px 15px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.like-btn.active {
    background: #ff6b6b;
    color: white;
}

.video-description {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 10px;
    line-height: 1.6;
}

/* Upload Form */
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.upload-area {
    border: 2px dashed #333;
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
}

.upload-area i {
    font-size: 48px;
    color: #ff6b6b;
    margin-bottom: 15px;
}

.browse-btn {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    margin-top: 15px;
    transition: all 0.3s ease;
}

.browse-btn:hover {
    background: #ff5252;
}

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

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

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: #ff6b6b;
}

.form-group textarea {
    height: 100px;
    resize: vertical;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.cancel-btn {
    background: none;
    border: 1px solid #333;
    color: #ccc;
    padding: 12px 24px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cancel-btn:hover {
    border-color: #ff6b6b;
    color: #ff6b6b;
}

.upload-submit-btn {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-submit-btn:hover {
    background: #ff5252;
}

/* Auth Modal */
.auth-tabs {
    display: flex;
    margin-bottom: 30px;
    border-bottom: 1px solid #333;
}

.auth-tab {
    flex: 1;
    background: none;
    border: none;
    color: #ccc;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
}

.auth-tab.active {
    color: #ff6b6b;
    border-bottom-color: #ff6b6b;
}

.auth-form h3 {
    margin-bottom: 25px;
    text-align: center;
}

.auth-btn {
    width: 100%;
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 15px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.auth-btn:hover {
    background: #ff5252;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

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

.loading-spinner i {
    font-size: 48px;
    color: #ff6b6b;
    margin-bottom: 15px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        flex-wrap: wrap;
        height: auto;
        padding: 15px 0;
    }
    
    .nav-left {
        gap: 20px;
    }
    
    .nav-links {
        display: none;
    }
    
    .nav-center {
        order: 3;
        width: 100%;
        margin: 15px 0 0 0;
    }
    
    .hero-content h1 {
        font-size: 32px;
    }
    
    .hero-content {
        left: 20px;
        max-width: calc(100% - 40px);
    }
    
    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 15px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .filter-container {
        gap: 10px;
    }
    
    .video-modal-content {
        padding: 20px;
        max-width: 95%;
    }
    
    #videoPlayer {
        height: 250px;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 0 15px;
    }
    
    .hero-section {
        height: 300px;
        margin: 20px 0;
    }
    
    .hero-content h1 {
        font-size: 24px;
    }
    
    .video-grid {
        grid-template-columns: 1fr;
    }
    
    .recent-grid {
        grid-template-columns: 1fr;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb {
    background: #ff6b6b;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #ff5252;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.video-card,
.trending-card,
.recent-card {
    animation: fadeIn 0.5s ease forwards;
}

/* Custom Checkbox and Radio Styles */
input[type="checkbox"],
input[type="radio"] {
    accent-color: #ff6b6b;
}

/* Focus Styles for Accessibility */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #ff6b6b;
    outline-offset: 2px;
}