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

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

/* Header Styles */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: 56px;
    background-color: #212121;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s;
    display: none; /* Hidden on desktop */
}

.menu-toggle:hover {
    background-color: #303030;
}

.logo {
    display: flex;
    align-items: center;
    font-family: 'Orbitron', 'Rajdhani', sans-serif;
    font-size: 24px;
    font-weight: 900;
    color: #ffffff;
    text-decoration: none;
    letter-spacing: 2px;
    text-transform: uppercase;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(102, 126, 234, 0.5);
}

.header-center {
    display: flex;
    align-items: center;
    flex: 1;
    max-width: 640px;
    margin: 0 40px;
    gap: 8px;
}

.search-form {
    display: flex;
    flex: 1;
    max-width: 100%;
}

.search-input {
    flex: 1;
    padding: 10px 16px;
    background-color: #121212;
    border: 1px solid #303030;
    color: #ffffff;
    font-size: 16px;
    border-radius: 40px 0 0 40px;
    outline: none;
}

.search-input:focus {
    border-color: #667eea;
}

.search-button {
    padding: 10px 24px;
    background-color: #303030;
    border: 1px solid #303030;
    border-left: none;
    border-radius: 0 40px 40px 0;
    color: #ffffff;
    cursor: pointer;
    transition: background-color 0.2s;
}

.search-button:hover {
    background-color: #404040;
}

.voice-search {
    background-color: #181818;
    border: none;
    color: #ffffff;
    font-size: 18px;
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    margin-left: 8px;
    transition: background-color 0.2s;
}

.voice-search:hover {
    background-color: #303030;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.icon-button {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.icon-button:hover {
    background-color: #303030;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #ffffff;
}

/* Container */
.container {
    display: flex;
    max-width: 100%;
}

/* Sidebar Styles */
.sidebar {
    width: 240px;
    background-color: #212121;
    height: calc(100vh - 56px);
    position: sticky;
    top: 56px;
    overflow-y: auto;
    padding: 12px 0;
    transition: transform 0.3s ease;
}

.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-thumb {
    background-color: #606060;
    border-radius: 4px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 10px 24px;
    color: #ffffff;
    text-decoration: none;
    transition: background-color 0.2s;
    font-size: 14px;
}

.nav-item:hover {
    background-color: #303030;
}

.nav-item.active {
    background-color: rgba(102, 126, 234, 0.1);
    font-weight: 500;
}

.nav-item.active i {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-item i {
    font-size: 20px;
    width: 24px;
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-divider {
    border: none;
    border-top: 1px solid #303030;
    margin: 12px 0;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 24px;
    min-height: calc(100vh - 56px);
}

/* Video Categories */
.video-categories {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: none;
}

.video-categories::-webkit-scrollbar {
    display: none;
}

.category-btn {
    padding: 8px 16px;
    background-color: #303030;
    border: none;
    border-radius: 20px;
    color: #ffffff;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.2s;
}

.category-btn:hover {
    background-color: #404040;
}

.category-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
}

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

/* Video Card */
.video-card {
    cursor: pointer;
    transition: transform 0.2s;
    position: relative;
}

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

.video-thumbnail {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background-color: #181818;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
}

.video-thumbnail img,
.video-thumbnail video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s;
}

.video-thumbnail .thumbnail-preview {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 2;
}

.video-thumbnail .thumbnail-img {
    z-index: 1;
}

.video-thumbnail .play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

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

.video-thumbnail .play-overlay i {
    color: #ffffff;
    font-size: 24px;
    margin-left: 4px;
}

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

.video-info {
    display: flex;
    gap: 12px;
}

.channel-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #303030;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #ffffff;
    font-size: 20px;
}

.video-details {
    flex: 1;
}

.video-title {
    font-size: 16px;
    font-weight: 500;
    color: #ffffff;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.channel-name {
    font-size: 14px;
    color: #aaaaaa;
    margin-bottom: 4px;
}

.video-stats {
    font-size: 14px;
    color: #aaaaaa;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    .header {
        padding: 0 12px;
        height: 50px;
    }
    
    .header-center {
        margin: 0 8px;
        max-width: none;
    }
    
    .search-input {
        font-size: 14px;
        padding: 8px 12px;
    }
    
    .search-button {
        padding: 8px 16px;
        background-color: #303030;
        border: 1px solid #303030;
        border-left: none;
        border-radius: 0 40px 40px 0;
    }
    
    .voice-search {
        display: none;
    }
    
    .sidebar {
        position: fixed;
        left: 0;
        top: 50px;
        height: calc(100vh - 50px);
        transform: translateX(-100%);
        z-index: 99;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.3);
        width: 240px;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        padding: 12px;
        margin-top: 0;
    }
    
    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(100%, 1fr));
        gap: 12px;
    }
    
    .video-categories {
        gap: 8px;
        margin-bottom: 12px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    
    .video-categories::-webkit-scrollbar {
        display: none;
    }
    
    .category-btn {
        padding: 8px 16px;
        font-size: 13px;
        white-space: nowrap;
    }
    
    .video-card {
        border-radius: 12px;
        overflow: hidden;
        background: #181818;
    }
    
    .video-thumbnail {
        border-radius: 12px 12px 0 0;
        margin-bottom: 8px;
    }
    
    .video-info {
        padding: 0 8px 8px 8px;
    }
    
    .video-title {
        font-size: 14px;
        line-height: 1.4;
        margin-bottom: 4px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .channel-name {
        font-size: 12px;
        margin-bottom: 2px;
    }
    
    .video-stats {
        font-size: 11px;
    }
    
    .video-thumbnail .play-overlay {
        width: 50px;
        height: 50px;
    }
    
    .video-thumbnail .play-overlay i {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 0 8px;
        height: 48px;
    }
    
    .logo {
        font-size: 18px;
    }
    
    .logo span {
        display: none;
    }
    
    .header-right .icon-button {
        font-size: 18px;
        padding: 6px;
    }
    
    .main-content {
        padding: 8px;
    }
    
    .video-grid {
        gap: 10px;
    }
    
    .video-categories {
        margin-bottom: 12px;
        padding-bottom: 4px;
    }
    
    .category-btn {
        padding: 6px 14px;
        font-size: 12px;
    }
    
    .video-card {
        border-radius: 10px;
    }
    
    .video-thumbnail {
        border-radius: 10px 10px 0 0;
    }
    
    .video-title {
        font-size: 13px;
    }
    
    .channel-name,
    .video-stats {
        font-size: 11px;
    }
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 98;
}

.sidebar-overlay.active {
    display: block;
}
