* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-hover: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border: #334155;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
}

.navbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.logo-icon {
    color: var(--primary);
    font-size: 2rem;
}

.logo-text {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stream {
    font-weight: 400;
}

.ai-btn {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.2s;
}

.ai-btn:hover {
    transform: translateY(-2px);
}

.container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
}

.sidebar {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.5rem;
    height: fit-content;
    position: sticky;
    top: 100px;
}

.sidebar h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.video-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.video-item {
    padding: 1rem;
    background: var(--bg-dark);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.video-item:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
}

.video-item.active {
    border-color: var(--secondary);
    background: var(--bg-hover);
}

.video-item h4 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.video-item p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.video-player {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 16/9;
}

.video-player iframe {
    width: 100%;
    height: 100%;
}

.video-info {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 12px;
}

.video-info h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.video-meta {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.separator {
    margin: 0 0.5rem;
}

.comments-section {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 12px;
}

.comments-section h2 {
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#commentCount {
    background: var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.comment-form input,
.comment-form textarea {
    background: var(--bg-dark);
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.comment-form button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    align-self: flex-start;
    transition: background 0.2s;
}

.comment-form button:hover {
    background: var(--primary-dark);
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.comment {
    background: var(--bg-dark);
    padding: 1rem;
    border-radius: 8px;
    border-left: 3px solid var(--primary);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.comment-author {
    font-weight: 600;
    color: var(--primary);
}

.comment-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.comment-text {
    color: var(--text-primary);
    line-height: 1.5;
}

.ai-assistant {
    position: fixed;
    right: 2rem;
    bottom: 2rem;
    width: 400px;
    height: 500px;
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    display: none;
    flex-direction: column;
    z-index: 1000;
}

.ai-assistant.active {
    display: flex;
}

.ai-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.ai-header h3 {
    font-size: 1.1rem;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.ai-chat {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ai-message {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    max-width: 85%;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-message.user {
    background: var(--primary);
    align-self: flex-end;
    margin-left: auto;
}

.ai-message.bot {
    background: var(--bg-dark);
    align-self: flex-start;
    border: 1px solid var(--border);
}

.ai-input {
    padding: 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.5rem;
}

.ai-input input {
    flex: 1;
    background: var(--bg-dark);
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem;
    color: var(--text-primary);
    font-family: inherit;
}

.ai-input input:focus {
    outline: none;
    border-color: var(--primary);
}

.ai-input button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.ai-input button:hover {
    background: var(--primary-dark);
}

@media (max-width: 1024px) {
    .container {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        position: static;
    }
    
    .ai-assistant {
        width: calc(100% - 2rem);
        right: 1rem;
        left: 1rem;
    }
}
