* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #FF6B35;
  --secondary: #004E89;
  --accent: #F77F00;
  --dark: #1A1A2E;
  --light: #EAEAEA;
  --card-bg: #16213E;
  --text: #FFFFFF;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, var(--dark) 0%, #0F3460 100%);
  color: var(--text);
  min-height: 100vh;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.header {
  background: rgba(26, 26, 46, 0.95);
  backdrop-filter: blur(10px);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 2px solid var(--primary);
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo h1 {
  font-size: 1.8rem;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.ai-toggle {
  background: var(--secondary);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 25px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  transition: all 0.3s;
}

.ai-toggle:hover {
  background: var(--primary);
  transform: translateY(-2px);
}

/* Main Content */
.main-content {
  padding: 40px 20px;
}

/* Video Grid */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 30px;
}

.video-card {
  background: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s;
  border: 2px solid transparent;
}

.video-card:hover {
  transform: translateY(-8px);
  border-color: var(--primary);
  box-shadow: 0 10px 30px rgba(255, 107, 53, 0.3);
}

.video-thumbnail {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--dark);
}

.video-details {
  padding: 15px;
}

.video-details h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: var(--text);
}

.video-details p {
  font-size: 0.9rem;
  color: var(--light);
  opacity: 0.8;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  overflow-y: auto;
}

.modal.active {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  background: var(--card-bg);
  border-radius: 12px;
  max-width: 1000px;
  width: 100%;
  margin: 20px;
  position: relative;
  padding: 20px;
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--primary);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 10;
}

.close-btn:hover {
  background: var(--accent);
}

.video-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 8px;
  margin-bottom: 20px;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.video-info {
  margin-bottom: 30px;
}

.video-info h2 {
  font-size: 1.8rem;
  margin-bottom: 10px;
  color: var(--primary);
}

/* Comments Section */
.comments-section {
  border-top: 2px solid var(--dark);
  padding-top: 20px;
}

.comments-section h3 {
  margin-bottom: 20px;
  color: var(--accent);
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 30px;
}

.comment-form input,
.comment-form textarea {
  background: var(--dark);
  border: 2px solid var(--secondary);
  color: var(--text);
  padding: 12px;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
}

.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: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: bold;
  align-self: flex-start;
  transition: all 0.3s;
}

.comment-form button:hover {
  background: var(--accent);
  transform: translateY(-2px);
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.comment {
  background: var(--dark);
  padding: 15px;
  border-radius: 8px;
  border-left: 3px solid var(--primary);
}

.comment-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.comment-author {
  font-weight: bold;
  color: var(--accent);
}

.comment-date {
  font-size: 0.85rem;
  color: var(--light);
  opacity: 0.6;
}

.comment-text {
  color: var(--light);
  line-height: 1.5;
}

/* AI Panel */
.ai-panel {
  position: fixed;
  right: -400px;
  top: 0;
  width: 400px;
  height: 100vh;
  background: var(--card-bg);
  box-shadow: -5px 0 20px rgba(0, 0, 0, 0.5);
  transition: right 0.3s;
  z-index: 999;
  display: flex;
  flex-direction: column;
}

.ai-panel.active {
  right: 0;
}

.ai-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 2px solid var(--dark);
  background: var(--secondary);
}

.ai-header h3 {
  color: white;
}

.close-ai {
  background: transparent;
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-chat {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.ai-message {
  padding: 12px 16px;
  border-radius: 12px;
  max-width: 85%;
  line-height: 1.5;
}

.ai-message.user {
  background: var(--primary);
  align-self: flex-end;
  margin-left: auto;
}

.ai-message.assistant {
  background: var(--dark);
  align-self: flex-start;
  border: 1px solid var(--secondary);
}

.ai-input-container {
  display: flex;
  gap: 10px;
  padding: 20px;
  border-top: 2px solid var(--dark);
}

.ai-input-container input {
  flex: 1;
  background: var(--dark);
  border: 2px solid var(--secondary);
  color: var(--text);
  padding: 12px;
  border-radius: 8px;
  font-size: 1rem;
}

.ai-input-container input:focus {
  outline: none;
  border-color: var(--primary);
}

.ai-input-container button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s;
}

.ai-input-container button:hover {
  background: var(--accent);
}

/* Footer */
.footer {
  background: rgba(26, 26, 46, 0.95);
  padding: 20px;
  text-align: center;
  border-top: 2px solid var(--primary);
  margin-top: 60px;
}

/* Responsive */
@media (max-width: 768px) {
  .video-grid {
    grid-template-columns: 1fr;
  }
  
  .ai-panel {
    width: 100%;
    right: -100%;
  }
  
  .modal-content {
    margin: 10px;
  }
}
