:root {
    --yt-red: #ff0000;
    --yt-red-hover: #cc0000;
    --yt-bg: #0f0f0f;
    --yt-nav: #0f0f0f;
    --yt-card: #1f1f1f;
    --yt-gray: #272727;
    --yt-border: #303030;
    --yt-text: #f1f1f1;
    --yt-text-secondary: #aaaaaa;
    --yt-hover: #2f2f2f;
    --yt-blue: #3ea6ff;
}

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

body {
    font-family: 'Roboto', 'Inter', sans-serif;
    background-color: var(--yt-bg);
    color: var(--yt-text);
    line-height: 1.4;
}

.bg-yt { background-color: var(--yt-bg) !important; }
.bg-yt-nav { background-color: var(--yt-nav) !important; }
.bg-yt-dark { background-color: var(--yt-bg) !important; }
.bg-yt-gray { background-color: var(--yt-gray) !important; }
.text-yt-red { color: var(--yt-red) !important; }
.border-yt { border-color: var(--yt-border) !important; }

/* Typography */
.fw-700 { font-weight: 700; }
.tracking-tight { letter-spacing: -0.5px; }

/* Navigation Bar */
.navbar {
    border-bottom: 1px solid var(--yt-border);
    height: 56px;
    z-index: 1000;
}

.hover-round {
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.hover-round:hover {
    background-color: var(--yt-hover);
}

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

.user-avatar-sm {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    flex-shrink: 0;
}

/* Search Bar */
.yt-search-group .form-control {
    height: 40px;
    font-size: 1rem;
    border: 1px solid var(--yt-border);
    background-color: var(--yt-bg);
    color: white;
}

.yt-search-group .form-control:focus {
    border-color: #1c62b9;
    box-shadow: none;
    outline: none;
}

.btn-yt-search {
    background-color: var(--yt-gray);
    border: 1px solid var(--yt-border);
    border-left: none;
}

.btn-yt-search:hover {
    background-color: var(--yt-hover);
}

/* Main Layout */
.main-container {
    display: flex;
    min-height: calc(100vh - 56px);
}

/* Sidebar Navigation */
.sidebar-nav {
    width: 240px;
    background-color: var(--yt-bg);
    padding: 12px 0;
    position: fixed;
    left: 0;
    top: 56px;
    height: calc(100vh - 56px);
    overflow-y: auto;
    z-index: 100;
}

.nav-section {
    padding: 8px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 10px 24px;
    color: var(--yt-text);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.nav-item:hover {
    background-color: var(--yt-hover);
    color: var(--yt-text);
}

.nav-item.active {
    background-color: var(--yt-hover);
    font-weight: 500;
}

.nav-item i {
    width: 24px;
    text-align: center;
    font-size: 1.1rem;
}

.nav-divider {
    border-top: 1px solid var(--yt-border);
    margin: 12px 16px;
}

.nav-header {
    padding: 8px 24px;
    font-size: 1rem;
    font-weight: 500;
    color: var(--yt-text);
}

.channel-icon-sm {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--yt-red);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 700;
}

/* Content Area */
.content-area {
    flex: 1;
    margin-left: 240px;
    padding-top: 0;
}

@media (max-width: 992px) {
    .content-area {
        margin-left: 0;
    }
}

/* Category Chips */
.category-chips {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: none;
}

.category-chips::-webkit-scrollbar {
    display: none;
}

.chip {
    background-color: var(--yt-gray);
    color: var(--yt-text);
    border: 1px solid var(--yt-border);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.9rem;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
}

.chip:hover {
    background-color: var(--yt-hover);
}

.chip.active {
    background-color: var(--yt-text);
    color: var(--yt-bg);
    border-color: var(--yt-text);
}

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

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

.video-card:hover {
    transform: scale(1.02);
}

.thumb-wrapper {
    position: relative;
    aspect-ratio: 16/9;
    background: #000;
    overflow: hidden;
    border-radius: 12px;
    margin-bottom: 12px;
}

.thumb-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

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

.channel-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.video-details {
    flex: 1;
}

.video-title-text {
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
    color: var(--yt-text);
}

.video-meta {
    font-size: 0.85rem;
    color: var(--yt-text-secondary);
}

/* Player Section - YouTube Style */
.video-player-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}

.video-info-section {
    padding: 0 4px;
}

.video-title-yt {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--yt-text);
}

.video-meta-bar {
    padding: 12px 0;
    border-bottom: 1px solid var(--yt-border);
}

.channel-avatar-lg {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.channel-name {
    font-size: 1rem;
}

.subscriber-count {
    font-size: 0.85rem;
}

.btn-yt-subscribe {
    background-color: var(--yt-text);
    color: var(--yt-bg);
    border-radius: 20px;
    padding: 8px 16px;
    font-weight: 500;
    border: none;
    text-transform: none;
}

.btn-yt-subscribe:hover {
    background-color: #e0e0e0;
}

.video-actions {
    display: flex;
    gap: 8px;
}

.btn-yt-action {
    background-color: var(--yt-gray);
    color: var(--yt-text);
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s;
}

.btn-yt-action:hover {
    background-color: var(--yt-hover);
}

.description-box {
    background-color: var(--yt-gray);
    cursor: pointer;
}

.description-text {
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Related Videos Sidebar */
.related-videos-header {
    font-size: 1.1rem;
    padding-bottom: 8px;
}

.related-videos-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.side-video-card {
    display: flex;
    gap: 8px;
    cursor: pointer;
    padding: 4px;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.side-video-card:hover {
    background-color: var(--yt-hover);
}

.side-thumb {
    flex: 0 0 168px;
    aspect-ratio: 16/9;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.side-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.side-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.side-title {
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
    color: var(--yt-text);
}

.side-meta {
    font-size: 0.8rem;
    color: var(--yt-text-secondary);
}

/* History Section */
#history-section .video-card {
    opacity: 0.9;
    transition: all 0.3s ease;
}

#history-section .video-card:hover {
    opacity: 1;
    transform: translateY(-4px);
}

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

::-webkit-scrollbar-track {
    background: var(--yt-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--yt-gray);
    border-radius: 4px;
}

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

/* Animations */
.reveal-smooth {
    animation: fadeInUp 0.4s ease-out;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 576px) {
    .video-title-text {
        font-size: 0.9rem;
    }
    
    .thumb-wrapper {
        border-radius: 8px;
    }
    
    .side-thumb {
        flex: 0 0 120px;
    }
}

/* Hide sidebar on mobile */
@media (max-width: 992px) {
    .sidebar-nav {
        display: none;
    }
    
    .content-area {
        margin-left: 0;
    }
}

/* Plyr Customization */
.plyr {
    border-radius: 12px;
    overflow: hidden;
}

.plyr--video {
    background: #000;
}