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

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

/* Header */
.header {
    background: white;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 0.8rem 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: #2454A2;
    font-size: 1.5rem;
    font-weight: 700;
    white-space: nowrap;
}

.logo-image {
    height: 40px;
    width: auto;
    margin-right: 10px;
    vertical-align: middle;
}

.logo-icon {
    font-size: 2rem;
    color: #ff0000;
}

.search-container {
    flex: 1;
    max-width: 600px;
}

.search-form {
    display: flex;
    border: 1px solid #ccc;
    border-radius: 40px;
    overflow: hidden;
    background: white;
}

.search-input {
    flex: 1;
    padding: 0.6rem 1rem;
    border: none;
    font-size: 1rem;
    outline: none;
}

.search-button {
    padding: 0.6rem 1.5rem;
    background: #f8f8f8;
    border: none;
    border-left: 1px solid #d3d3d3;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background 0.3s;
}

.search-button:hover {
    background: #f0f0f0;
}

/* Main Content */
.main-content {
    max-width: 1800px;
    margin: 0 auto;
    padding: 2rem;
    min-height: calc(100vh - 150px);
}

/* Home Layout with Sidebar */
.home-layout {
    display: flex;
    gap: 2rem;
    max-width: 1800px;
    margin: 0 auto;
    padding: 2rem;
}

.categories-sidebar {
    width: 240px;
    flex-shrink: 0;
}

.sidebar-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #0f0f0f;
    padding: 0 0.5rem;
}

.category-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.category-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.6rem 0.75rem;
    color: #0f0f0f;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.2s;
    font-size: 0.95rem;
}

.category-link:hover {
    background: #f2f2f2;
}

.category-link.active {
    background: #f2f2f2;
    font-weight: 600;
}

.category-icon {
    font-size: 1.2rem;
}

.category-name {
    flex: 1;
}

.main-area {
    flex: 1;
    min-width: 0;
}

/* Featured Sections */
.featured-section {
    margin-bottom: 3rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #0f0f0f;
}

/* Category Header */
.category-header {
    margin-bottom: 2rem;
}

.category-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #0f0f0f;
}

.category-description {
    font-size: 1rem;
    color: #606060;
}

/* Video Grid */
.video-library {
    padding: 1rem 0;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem 1.5rem;
}

.video-card {
    cursor: pointer;
    transition: transform 0.2s;
}

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

.video-thumbnail-link {
    display: block;
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

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

.video-thumbnail-link:hover .video-thumbnail {
    transform: scale(1.05);
}

.video-thumbnail-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder-icon {
    font-size: 4rem;
    opacity: 0.5;
}

.video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
}

.video-info {
    padding: 0 0.25rem;
}

.video-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.video-title a {
    color: #0f0f0f;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-title a:hover {
    color: #065fd4;
}

.video-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: #606060;
    margin-bottom: 0.5rem;
}

.video-description {
    font-size: 0.85rem;
    color: #606060;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Empty State */
.empty-library {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty-library h2 {
    color: #0f0f0f;
    margin-bottom: 0.5rem;
}

.empty-library p {
    color: #606060;
}

/* Watch Page */
.watch-page {
    max-width: 1400px;
    margin: 0 auto;
}

.video-player-container {
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.video-player {
    width: 100%;
    max-height: 720px;
    display: block;
}

.video-details {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.video-details .video-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #0f0f0f;
}

.video-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-top: 1px solid #e5e5e5;
    border-bottom: 1px solid #e5e5e5;
}

.stats-left {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.stat-item {
    font-size: 0.95rem;
    color: #606060;
    font-weight: 500;
}

.like-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.5rem;
    background: #f2f2f2;
    border: none;
    border-radius: 24px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: background 0.3s;
}

.like-button:hover {
    background: #e5e5e5;
}

.like-button.liked {
    background: #065fd4;
    color: white;
}

.like-button:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.like-icon {
    font-size: 1.2rem;
}

.video-description {
    margin-top: 1rem;
}

.video-description h3 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    color: #0f0f0f;
}

.video-description p {
    color: #0f0f0f;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* Related Videos */
.related-videos {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
}

.related-videos h2 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    color: #0f0f0f;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.related-card {
    display: flex;
    gap: 0.75rem;
}

.related-thumbnail-link {
    position: relative;
    flex-shrink: 0;
    width: 168px;
    height: 94px;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.related-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-thumbnail-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    opacity: 0.5;
}

.related-duration {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 600;
}

.related-info {
    flex: 1;
}

.related-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.related-title a {
    color: #0f0f0f;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-title a:hover {
    color: #065fd4;
}

.related-meta {
    font-size: 0.85rem;
    color: #606060;
    display: flex;
    gap: 0.75rem;
}

/* Search Results */
.search-results {
    padding: 1rem 0;
}

.search-results h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: #0f0f0f;
}

.results-count {
    color: #606060;
    margin-bottom: 2rem;
}

.no-results {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 12px;
}

.no-results-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.no-results h2 {
    color: #0f0f0f;
    margin-bottom: 0.5rem;
}

.no-results p {
    color: #606060;
    margin-bottom: 2rem;
}

.btn-back {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: #065fd4;
    color: white;
    text-decoration: none;
    border-radius: 24px;
    font-weight: 600;
    transition: background 0.3s;
}

.btn-back:hover {
    background: #0456b8;
}

/* Footer */
.footer {
    background: white;
    border-top: 1px solid #e5e5e5;
    margin-top: 3rem;
}

.footer-container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 2rem;
    text-align: center;
    color: #606060;
}

/* Responsive */
@media (max-width: 1024px) {
    .home-layout {
        flex-direction: column;
    }
    
    .categories-sidebar {
        width: 100%;
    }
    
    .category-nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .category-link {
        flex: 0 0 auto;
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .search-container {
        width: 100%;
    }
    
    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.5rem 1rem;
    }
    
    .related-grid {
        grid-template-columns: 1fr;
    }
    
    .main-content,
    .home-layout {
        padding: 1rem;
    }
}
