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

:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --accent-color: #3b82f6;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --background: #ffffff;
    --surface: #f9fafb;
    --border: #e5e7eb;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
    --transition: all 0.2s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--background);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.header {
    background: var(--background);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 700;
    font-size: 1.25rem;
}

.logo img {
    width: 32px;
    height: 32px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--text-light);
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-toggle span {
    width: 20px;
    height: 2px;
    background: var(--text-color);
    margin: 2px 0;
    transition: var(--transition);
}

/* Hero */
.hero {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-content p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background: white;
    color: var(--primary-color);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-color);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--background);
    border-color: var(--primary-color);
}

/* Sections */
section {
    padding: 4rem 0;
}

section h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-align: center;
}

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

.video-card {
    background: var(--background);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.video-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.video-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.video-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.video-info {
    padding: 1.5rem;
}

.video-info h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.video-info .channel {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-light);
    flex-wrap: wrap;
}

.meta span {
    background: var(--surface);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* Category Grid */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.category-card {
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
    text-align: center;
}

.category-card:hover {
    background: var(--background);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.category-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

/* Search and Filters */
.search-section {
    background: var(--surface);
    padding: 2rem 0;
}

.search-container {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}

.search-input {
    flex: 1;
    max-width: 400px;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    font-size: 1rem;
}

.filter-select {
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    font-size: 1rem;
    background: var(--background);
}

/* Video Detail */
.video-detail {
    max-width: 800px;
    margin: 0 auto;
}

.video-embed {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%;
    margin-bottom: 2rem;
}

.video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: var(--border-radius);
}

.video-meta {
    display: flex;
    gap: 2rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.video-meta .meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.video-meta .meta-label {
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.video-meta .meta-value {
    font-size: 1rem;
}

.video-description {
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--border-radius);
    margin: 2rem 0;
}

.topics {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 1rem 0;
}

.topic-tag {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    text-decoration: none;
}

.topic-tag:hover {
    background: var(--secondary-color);
    color: white;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-color);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

/* Footer */
.footer {
    background: var(--text-color);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
    color: white;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
}

/* Content Pages */
.content-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 0;
}

.content-page h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.content-page h2 {
    font-size: 2rem;
    margin: 2rem 0 1rem;
    color: var(--primary-color);
}

.content-page h3 {
    font-size: 1.5rem;
    margin: 1.5rem 0 0.75rem;
}

.content-page p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.content-page ul,
.content-page ol {
    margin: 1rem 0 1rem 2rem;
}

.content-page li {
    margin-bottom: 0.5rem;
}

.contact-info {
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--border-radius);
    margin: 2rem 0;
}

.contact-info h3 {
    margin-top: 0;
    color: var(--primary-color);
}

.contact-info p {
    margin-bottom: 0.5rem;
}

.contact-info a {
    color: var(--primary-color);
    text-decoration: none;
}

.contact-info a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--background);
        border-top: 1px solid var(--border);
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-toggle {
        display: flex;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    section h2 {
        font-size: 2rem;
    }

    .video-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .search-container {
        flex-direction: column;
        align-items: stretch;
    }

    .search-input {
        max-width: none;
    }

    .video-meta {
        flex-direction: column;
        gap: 1rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.75rem;
    }

    .hero {
        padding: 2rem 0;
    }

    section {
        padding: 2rem 0;
    }

    .video-info {
        padding: 1rem;
    }

    .category-card {
        padding: 1.5rem;
    }
}

/* Hidden class for filtering */
.hidden {
    display: none !important;
}

/* Loading states */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
}

/* Error states */
.error {
    background: #fee2e2;
    color: #dc2626;
    padding: 1rem;
    border-radius: var(--border-radius);
    margin: 1rem 0;
}

/* Success states */
.success {
    background: #d1fae5;
    color: #065f46;
    padding: 1rem;
    border-radius: var(--border-radius);
    margin: 1rem 0;
}