* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #0a0a0a;
    color: #ffffff;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background: #000000;
    border-bottom: 1px solid #333;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

nav {
    display: flex;
    gap: 30px;
}

nav a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    position: relative;
}

nav a:hover {
    color: #888;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: #ffffff;
    transition: width 0.3s;
}

nav a:hover::after {
    width: 100%;
}

.creator {
    font-size: 12px;
    color: #888;
    font-style: italic;
}

main {
    padding: 30px 20px;
}

.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.video-card {
    cursor: pointer;
    transition: transform 0.3s;
}

.video-card:hover {
    transform: translateY(-5px);
}

.thumbnail {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    background: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
}

.thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.9);
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
}

.video-info {
    padding: 12px 0;
}

.video-info h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
    line-height: 1.3;
}

.channel {
    color: #888;
    font-size: 14px;
    margin-bottom: 4px;
}

.stats {
    color: #666;
    font-size: 13px;
}

.ai-assistant {
    background: #111;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 20px;
    height: fit-content;
    position: sticky;
    top: 90px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 120px);
}

.ai-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #333;
}

.ai-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 15px;
    min-height: 300px;
    max-height: 500px;
}

.message {
    margin-bottom: 15px;
    padding: 12px;
    border-radius: 8px;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.ai-message {
    background: #1a1a1a;
    border-left: 3px solid #ffffff;
}

.user-message {
    background: #2a2a2a;
    border-left: 3px solid #666;
}

.message p {
    font-size: 14px;
    line-height: 1.5;
}

.chat-input {
    display: flex;
    gap: 10px;
}

.chat-input input {
    flex: 1;
    background: #1a1a1a;
    border: 1px solid #333;
    color: #ffffff;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 14px;
}

.chat-input input:focus {
    outline: none;
    border-color: #666;
}

.chat-input button {
    background: #ffffff;
    color: #000000;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.chat-input button:hover {
    background: #e0e0e0;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    overflow-y: auto;
}

.modal-content {
    background: #0a0a0a;
    margin: 50px auto;
    padding: 30px;
    max-width: 1200px;
    border-radius: 12px;
    border: 1px solid #333;
}

.close {
    color: #888;
    float: right;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: #ffffff;
}

.video-container {
    margin: 20px 0;
    border-radius: 8px;
    overflow: hidden;
}

.video-details {
    margin: 20px 0;
}

.video-details h2 {
    font-size: 24px;
    margin-bottom: 10px;
}

.video-meta {
    display: flex;
    gap: 20px;
    color: #888;
    font-size: 14px;
}

.comments-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #333;
}

.comments-section h3 {
    margin-bottom: 20px;
    font-size: 20px;
}

.comment-input {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}

.comment-input input {
    flex: 1;
    background: #1a1a1a;
    border: 1px solid #333;
    color: #ffffff;
    padding: 12px 15px;
    border-radius: 6px;
    font-size: 14px;
}

.comment-input input:focus {
    outline: none;
    border-color: #666;
}

.comment-input button {
    background: #ffffff;
    color: #000000;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.comment-input button:hover {
    background: #e0e0e0;
}

.comment {
    background: #111;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 12px;
    border-left: 2px solid #333;
}

.comment-author {
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 14px;
}

.comment-text {
    color: #ccc;
    font-size: 14px;
    line-height: 1.5;
}

.comment-time {
    color: #666;
    font-size: 12px;
    margin-top: 5px;
}

@media (max-width: 1024px) {
    .content-wrapper {
        grid-template-columns: 1fr;
    }
    
    .ai-assistant {
        position: relative;
        top: 0;
    }
}

@media (max-width: 768px) {
    .video-grid {
        grid-template-columns: 1fr;
    }
    
    header .container {
        flex-wrap: wrap;
    }
    
    nav {
        order: 3;
        width: 100%;
        margin-top: 15px;
        justify-content: center;
    }
}
