* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-blue: #2563eb;
    --primary-red: #dc2626;
    --gradient: linear-gradient(135deg, var(--primary-blue), var(--primary-red));
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: var(--gradient);
    color: white;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

.logo {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.logo-icon {
    font-size: 3rem;
    opacity: 0.9;
}

.logo-text h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.logo-text p {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Main Layout */
.main-layout {
    display: flex;
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    gap: 2rem;
    padding: 2rem;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--bg-primary);
    border-radius: 12px;
    box-shadow: var(--shadow);
    height: fit-content;
    position: sticky;
    top: 2rem;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h3 {
    color: var(--text-primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.channels-nav ul {
    list-style: none;
    padding: 1rem 0;
}

.channels-nav li {
    margin: 0.25rem 0;
}

.channels-nav a {
    display: block;
    padding: 0.75rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.channels-nav a:hover,
.channels-nav a.active {
    background: var(--bg-tertiary);
    color: var(--primary-blue);
    font-weight: 500;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.btn-refresh {
    width: 100%;
    padding: 0.75rem;
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-refresh:hover {
    opacity: 0.9;
}

/* Main Content */
.main-content {
    flex: 1;
    min-width: 0;
}

/* Search Container */
.search-container {
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.search-box {
    position: relative;
    margin-bottom: 1rem;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-blue);
}

.clear-search {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    display: none;
}

.clear-search:hover {
    background: var(--bg-tertiary);
}

.filter-options {
    display: flex;
    gap: 1rem;
}

.filter-options select {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: white;
    font-size: 0.9rem;
}

/* Videos Grid */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.video-card {
    background: var(--bg-primary);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.video-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.video-thumbnail {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-duration {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.video-info {
    padding: 1rem;
}

.video-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-channel {
    color: var(--primary-blue);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.video-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* Loading */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error Message */
.error-message {
    text-align: center;
    padding: 2rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #dc2626;
    margin: 1rem 0;
}

/* Load More Button */
.load-more-container {
    text-align: center;
    margin: 2rem 0;
}

.btn-load-more {
    padding: 0.75rem 2rem;
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.btn-load-more:hover {
    opacity: 0.9;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-layout {
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
    }

    .sidebar {
        width: 100%;
        position: static;
    }

    .logo {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .logo-text h1 {
        font-size: 2rem;
    }

    .videos-grid {
        grid-template-columns: 1fr;
    }

    .filter-options {
        flex-direction: column;
    }

    .header {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .videos-grid {
        gap: 1rem;
    }

    .video-card {
        border-radius: 8px;
    }

    .search-container {
        padding: 1rem;
    }
}