.course-video-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 22px;
}

.video-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.video-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.video-info {
  background: white;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.video-info h2 {
  margin-bottom: 5px;
  font-size: 1.5rem;
  color: #1a1a1a;
}

.video-info p {
  color: #666;
  line-height: 1.6;
  margin-bottom: 0;
}

/* Responsive */
@media (max-width: 1024px) {
  .chat-button-fixed {
    bottom: 20px;
    right: 20px;
    width: 55px;
    height: 55px;
  }

  .course-chat-modal {
    bottom: 90px;
    right: 20px;
    width: 360px;
    max-height: 550px;
  }
}

@media (max-width: 768px) {
  .chat-button-fixed {
    bottom: 15px;
    right: 15px;
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
  }

  .course-chat-modal {
    bottom: 75px;
    right: 15px;
    left: 15px;
    width: auto;
    max-height: 500px;
  }

  .chat-messages {
    max-height: 380px;
  }

  .message-bubble {
    font-size: 0.85rem;
  }

  .chat-input {
    font-size: 0.85rem;
    padding: 8px 12px;
  }
}

@media (max-width: 480px) {
  .chat-button-fixed {
    bottom: 10px;
    right: 10px;
    width: 45px;
    height: 45px;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
  }

  .course-chat-modal {
    bottom: 65px;
    right: 10px;
    left: 10px;
    width: auto;
    max-height: 450px;
    border-radius: 8px;
  }

  .chat-header h3 {
    font-size: 0.9rem;
  }

  .chat-messages {
    max-height: 300px;
    padding: 10px;
  }

  .message-bubble {
    font-size: 0.8rem;
    padding: 8px 10px;
  }

  .chat-input {
    font-size: 0.8rem;
    padding: 8px 10px;
  }

  .chat-send-btn {
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
  }
}

/* Chat Button (Fixed Position) */
.chat-button-fixed {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  transition: all 0.3s ease;
  z-index: 999;
}

.chat-button-fixed:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.6);
}

.chat-button-fixed.active {
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* Badge untuk unread messages */
.chat-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ff4757;
  color: white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: bold;
}

/* Chat Modal Styles */
.chat-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  display: none;
  z-index: 1040;
  animation: fadeIn 0.3s ease;
}

.chat-modal-overlay.show {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.course-chat-modal {
  position: fixed;
  bottom: 100px;
  right: 30px;
  width: 400px;
  max-height: 600px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 5px 40px rgba(0, 0, 0, 0.16);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1050;
  animation: slideUp 0.3s ease;
  display: none;
}

.course-chat-modal.show {
  display: flex;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.chat-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.chat-header h3 {
  margin: 0;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-header h3 {
  margin: 0;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-header-icon {
  font-size: 1.2rem;
}

.chat-header-actions {
  display: flex;
  gap: 8px;
}

.chat-header-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.9rem;
  transition: background 0.3s ease;
}

.chat-header-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f9f9f9;
}

.chat-message {
  display: flex;
  gap: 8px;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.message-avatar.user {
  background: #667eea;
  color: white;
}

.message-avatar.assistant {
  background: #e0e0e0;
  color: #666;
}

.message-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.message-bubble {
  background: white;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.4;
  max-width: 100%;
  word-wrap: break-word;
}

.message-user .message-bubble {
  background: #667eea;
  color: white;
  border-radius: 8px 2px 8px 8px;
}

.message-assistant .message-bubble {
  background: #e8e8e8;
  color: #333;
  border-radius: 2px 8px 8px 8px;
}

.message-time {
  font-size: 0.75rem;
  color: #999;
  padding: 0 8px;
}

.chat-input-area {
  padding: 12px;
  border-top: 1px solid #e0e0e0;
  background: white;
  flex-shrink: 0;
}

.chat-input-form {
  display: flex;
  gap: 8px;
}

.chat-input {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 20px;
  padding: 10px 15px;
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.3s ease;
}

.chat-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.chat-input::placeholder {
  color: #999;
}

.chat-send-btn {
  background: #667eea;
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.chat-send-btn:hover:not(:disabled) {
  background: #5568d3;
  transform: scale(1.05);
}

.chat-send-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  opacity: 0.6;
}

.chat-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: #666;
}

.chat-loading-dots {
  display: inline-flex;
  gap: 4px;
}

.chat-loading-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #667eea;
  animation: pulse 1.4s infinite;
}

.chat-loading-dot:nth-child(1) {
  animation-delay: 0s;
}

.chat-loading-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.chat-loading-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes pulse {
  0%, 100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

.chat-error {
  background: #fee;
  color: #c33;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  border-left: 3px solid #c33;
}

.chat-info {
  background: #eef;
  color: #339;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  border-left: 3px solid #339;
  margin-bottom: 10px;
}

.chat-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #999;
  text-align: center;
  padding: 20px;
}

.chat-empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: 10px;
  opacity: 0.5;
}

.chat-empty-state-text {
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Responsive */
@media (max-width: 1024px) {
  .course-video-container {
    grid-template-columns: 1fr;
  }

  .course-chat-widget {
    height: 450px;
  }
}

@media (max-width: 768px) {
  .course-video-container {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .course-chat-widget {
    height: 400px;
  }

  .chat-messages {
    padding: 12px;
  }

  .message-bubble {
    font-size: 0.85rem;
  }

  .chat-input {
    font-size: 0.85rem;
    padding: 8px 12px;
  }
}
