* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0f0f0f;
    --bg-secondary: #272727;
    --bg-tertiary: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #aaaaaa;
    --accent: #ff0000;
    --accent-hover: #cc0000;
    --border: #303030;
    --success: #2ba640;
    --warning: #f9ab00;
}

body.light-mode {
    --bg-primary: #ffffff;
    --bg-secondary: #f9f9f9;
    --bg-tertiary: #e5e5e5;
    --text-primary: #0f0f0f;
    --text-secondary: #606060;
    --border: #e5e5e5;
}

body {
    font-family: 'Roboto', 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 1000;
    border-bottom: 1px solid var(--border);
}
.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s;
}

.menu-btn:hover {
    background: var(--bg-secondary);
}

.logo {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 20px;
    font-weight: bold;
}

.logo i {
    color: var(--accent);
    font-size: 28px;
}

.header-center {
    flex: 1;
    max-width: 600px;
    margin: 0 40px;
}

.search-box {
    display: flex;
    width: 100%;
}

.search-box input {
    flex: 1;
    padding: 10px 16px;
    background: var(--bg-secondary);    border: 1px solid var(--border);
    border-right: none;
    border-radius: 20px 0 0 20px;
    color: var(--text-primary);
    font-size: 16px;
    outline: none;
}

.search-box input:focus {
    border-color: #1c62b9;
}

.search-box button {
    padding: 0 24px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 0 20px 20px 0;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.2s;
}

.search-box button:hover {
    background: var(--bg-secondary);
}

.header-right {
    display: flex;
    gap: 8px;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s;
}

.icon-btn:hover {
    background: var(--bg-secondary);
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;    top: 56px;
    width: 240px;
    height: calc(100vh - 56px);
    background: var(--bg-primary);
    overflow-y: auto;
    padding: 12px 0;
    transition: transform 0.3s;
    z-index: 999;
}

.sidebar.collapsed {
    transform: translateX(-240px);
}

.sidebar-section {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.sidebar-section h3 {
    padding: 8px 24px;
    font-size: 14px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 10px 24px;
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.2s;
    cursor: pointer;
}

.sidebar-item:hover {
    background: var(--bg-secondary);
}

.sidebar-item.active {
    background: var(--bg-secondary);
    font-weight: 500;
}

.sidebar-item i {
    font-size: 20px;
    width: 24px;
}
.setting-item {
    padding: 8px 24px;
}

.setting-item label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.setting-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Main Content */
.main-content {
    margin-left: 240px;
    margin-top: 56px;
    padding: 24px;
    transition: margin-left 0.3s;
}

.main-content.expanded {
    margin-left: 0;
}

/* Fetch Section */
.fetch-section {
    background: linear-gradient(135deg, var(--accent) 0%, #cc0000 100%);
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.3);
}

.fetch-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 32px;
    background: white;    color: var(--accent);
    border: none;
    border-radius: 30px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.fetch-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.fetch-btn:active {
    transform: translateY(0);
}

.fetch-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: white;
    font-size: 14px;
}

.fetch-info span {
    opacity: 0.9;
}

/* Loading Animation */
.loading-animation {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--bg-secondary);
    border-top: 4px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }}

.loading-animation p {
    color: var(--text-secondary);
    font-size: 16px;
}

/* Status Message */
.status-message {
    text-align: center;
    padding: 16px;
    margin-bottom: 24px;
    border-radius: 8px;
    font-size: 14px;
}

.status-message.success {
    background: rgba(43, 166, 64, 0.2);
    color: var(--success);
    border: 1px solid var(--success);
}

.status-message.error {
    background: rgba(255, 0, 0, 0.2);
    color: #ff5252;
    border: 1px solid #ff5252;
}

.status-message.info {
    background: rgba(249, 171, 0, 0.2);
    color: var(--warning);
    border: 1px solid var(--warning);
}

/* Video Grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.video-card {
    cursor: pointer;
    transition: transform 0.2s;
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
}
.video-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.video-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: var(--bg-tertiary);
    overflow: hidden;
}

.video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.video-card:hover .video-thumbnail img {
    transform: scale(1.1);
}

.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.video-card:hover .play-overlay {
    opacity: 1;
}

.play-overlay i {
    font-size: 60px;
    color: white;
}
.video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.video-info {
    display: flex;
    gap: 12px;
    padding: 12px;
}

.channel-avatar-small {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.channel-avatar-small i {
    font-size: 24px;
    color: var(--text-secondary);
}

.video-details-small {
    flex: 1;
}

.video-title {
    font-size: 14px;
    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(--text-primary);
}
.video-meta {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Load More Button */
.load-more-container {
    text-align: center;
    margin: 40px 0;
}

.load-more-btn {
    padding: 14px 32px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border);
    border-radius: 30px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.load-more-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent);
}

/* No Videos */
.no-videos {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-secondary);
}

.no-videos i {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-videos p {
    font-size: 18px;
    margin-bottom: 24px;
}

.primary-btn {
    padding: 12px 24px;
    background: var(--accent);
    color: white;    border: none;
    border-radius: 20px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.primary-btn:hover {
    background: var(--accent-hover);
}

/* Video Modal */
.video-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    overflow-y: auto;
}

.video-modal.active {
    display: block;
}

.modal-content {
    max-width: 1200px;
    margin: 20px auto;
    background: var(--bg-primary);
    border-radius: 12px;
    overflow: hidden;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
}
.video-player-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: black;
}

#videoPlayer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.video-details {
    padding: 24px;
}

.video-details h2 {
    font-size: 20px;
    margin-bottom: 12px;
}

.video-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
}

.video-stats {
    display: flex;
    gap: 16px;
    color: var(--text-secondary);
    font-size: 14px;
}

.action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.action-btn {
    display: flex;
    align-items: center;    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-secondary);
    border: none;
    border-radius: 20px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.2s;
}

.action-btn:hover {
    background: var(--bg-tertiary);
}

.channel-info {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.channel-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.channel-avatar i {
    font-size: 32px;
    color: var(--text-secondary);
}

.channel-details {
    flex: 1;
}

.channel-details h3 {
    font-size: 16px;
    margin-bottom: 4px;
}

.channel-details p {
    font-size: 12px;    color: var(--text-secondary);
}

.subscribe-btn {
    padding: 10px 20px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 20px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.subscribe-btn:hover {
    background: var(--accent-hover);
}

.video-description {
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 12px;
    margin-bottom: 20px;
}

.video-description p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 3000;
    display: none;
    animation: slideIn 0.3s ease-out;
}

.toast.show {
    display: block;
}
@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-240px);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .header-center {
        margin: 0 16px;
    }
    
    .video-grid {
        grid-template-columns: 1fr;
    }
    
    .fetch-section {
        flex-direction: column;
        text-align: center;
    }
    
    .video-actions {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border);
    }
