* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #4f46e5;
  --primary-dark: #4338ca;
  --secondary-color: #10b981;
  --bg-color: #f8fafc;
  --surface-color: rgba(255, 255, 255, 0.7);
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --border-color: #e2e8f0;
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  min-height: 100vh;
  color: var(--text-primary);
  padding: 20px;
  position: relative;
  overflow-x: hidden;
}

.video-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

.video-background video {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%);
  object-fit: cover;
}

.video-background::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
}

.container {
  max-width: 1400px;
  margin: 0 auto;
}

header {
  color: white;
  margin-bottom: 30px;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.header-content > div:first-child {
  flex: 1;
  text-align: center;
}

.auth-section {
  flex-shrink: 0;
}

.auth-status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.auth-status.connected .status-indicator {
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
  animation: pulse 2s infinite;
}

.auth-status.disconnected .status-indicator {
  background: #ef4444;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.btn-primary,
.btn-secondary {
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
}

.btn-primary {
  background: var(--secondary-color);
  color: white;
}

.btn-primary:hover {
  background: #059669;
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  margin-left: 8px;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.3);
}

.btn-disabled {
  position: relative;
  background-color: #cccccc;
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-disabled:hover {
  background-color: #cccccc;
  transform: none;
}

.btn-disabled .tooltip {
  visibility: hidden;
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #333;
  color: #fff;
  text-align: center;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s;
}

.btn-disabled .tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: #333 transparent transparent transparent;
}

.btn-disabled:hover .tooltip {
  visibility: visible;
  opacity: 1;
}

.auth-notice {
  background: #fef3c7;
  border-left: 4px solid #f59e0b;
  padding: 16px;
  border-radius: 8px;
  color: #78350f;
  margin-bottom: 16px;
}

.auth-success {
  background: #d1fae5;
  border-left: 4px solid var(--secondary-color);
  padding: 16px;
  border-radius: 8px;
  color: #065f46;
  margin-bottom: 16px;
}

header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 10px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tagline {
  font-size: 1.1rem;
  opacity: 0.95;
}

main {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 20px;
  align-items: start;
}

.chat-container {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  height: 600px;
  overflow: hidden;
}

.welcome-message {
  padding: 40px;
  text-align: center;
  color: var(--text-secondary);
}

.welcome-content h2 {
  color: #1e3a8a;
  margin-bottom: 20px;
  font-size: 1.8rem;
}

.welcome-content ul {
  list-style: none;
  margin: 20px 0;
}

.welcome-content li {
  padding: 10px;
  margin: 8px 0;
  background: var(--bg-color);
  border-radius: 8px;
  text-align: left;
}

.welcome-content li::before {
  content: "✓ ";
  color: var(--secondary-color);
  font-weight: bold;
  margin-right: 8px;
}

.get-started {
  margin-top: 30px;
  font-weight: 600;
  color: var(--primary-color);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: none;
}

.chat-messages.active {
  display: block;
}

.message {
  margin-bottom: 16px;
  display: flex;
  gap: 12px;
}

.message.user {
  flex-direction: row-reverse;
}

.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.message.user .message-avatar {
  background: var(--primary-color);
  color: white;
}

.message.assistant .message-avatar {
  background: var(--secondary-color);
  color: white;
}

.message-content {
  max-width: 70%;
  padding: 12px 16px;
  border-radius: 12px;
  line-height: 1.5;
  position: relative;
}

.copy-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 6px 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  color: var(--text-secondary);
}

.copy-btn:hover {
  background: white;
  color: var(--primary-color);
  border-color: var(--primary-color);
  transform: scale(1.05);
}

.copy-btn.copied {
  color: var(--secondary-color);
  border-color: var(--secondary-color);
}

.copy-btn svg {
  display: block;
}

.message.user .message-content {
  background: var(--primary-color);
  color: white;
  border-bottom-right-radius: 4px;
}

.message.assistant .message-content {
  background: var(--bg-color);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.message-title {
  font-weight: 600;
  color: #1e3a8a;
}

.major-section {
  font-size: 1.2em;
  font-weight: 700;
  color: #1e3a8a;
  margin: 16px 0 8px 0;
  padding-bottom: 4px;
  border-bottom: 2px solid #1e3a8a;
  display: block;
}

.message-time {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 4px;
  opacity: 0.7;
}

.chat-input-container {
  padding: 20px;
  border-top: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.input-wrapper {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

#messageInput {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  font-size: 1rem;
  font-family: inherit;
  resize: none;
  max-height: 120px;
  transition: border-color 0.2s;
}

#messageInput:focus {
  outline: none;
  border-color: var(--primary-color);
}

.send-btn {
  width: 48px;
  height: 48px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, transform 0.1s;
  flex-shrink: 0;
}

.send-btn:hover {
  background: var(--primary-dark);
}

.send-btn:active {
  transform: scale(0.95);
}

.send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.info-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.info-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  padding: 24px;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
}

.info-card.hover-card {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  min-height: 180px;
}

.info-card.hover-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.95) 0%, rgba(118, 75, 162, 0.95) 100%);
  opacity: 1;
  transition: opacity 0.3s ease;
  z-index: 1;
  pointer-events: none;
}

.info-card.hover-card::after {
  content: 'Hover to view setup instructions';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-weight: 600;
  font-size: 0.95rem;
  text-align: center;
  z-index: 2;
  opacity: 1;
  transition: opacity 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
}

.info-card.hover-card:hover::before,
.info-card.hover-card:hover::after {
  opacity: 0;
}

.info-card.hover-card > * {
  position: relative;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 3;
}

.info-card.hover-card:hover > * {
  opacity: 1;
}

.info-card h3 {
  margin-bottom: 16px;
  color: white;
  font-size: 1.2rem;
}

.scrollable-tips {
  max-height: 400px;
  overflow-y: auto;
  padding-right: 8px;
}

.scrollable-tips::-webkit-scrollbar {
  width: 6px;
}

.scrollable-tips::-webkit-scrollbar-track {
  background: var(--bg-color);
  border-radius: 3px;
}

.scrollable-tips::-webkit-scrollbar-thumb {
  background: #1e3a8a;
  border-radius: 3px;
}

.scrollable-tips::-webkit-scrollbar-thumb:hover {
  background: #1e40af;
}

.tip {
  padding: 12px;
  margin: 12px 0;
  background: var(--bg-color);
  border-radius: 8px;
  border-left: 3px solid var(--secondary-color);
}

.tip strong {
  color: #1e3a8a;
  display: block;
  margin-bottom: 4px;
}

.info-card ol {
  margin-left: 20px;
  color: var(--text-secondary);
}

.info-card ol li {
  margin: 8px 0;
}

.info-card code {
  background: var(--bg-color);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9rem;
  color: var(--primary-color);
}

/* Expandable Card Styles */
.expandable-card {
  cursor: pointer;
  transition: all 0.3s ease;
}

.expandable-card .expandable-content {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.4s ease, opacity 0.3s ease, margin-top 0.3s ease;
}

.expandable-card:hover .expandable-content {
  max-height: 1000px;
  opacity: 1;
  margin-top: 16px;
}

.expandable-card h3::after {
  content: " ▼";
  font-size: 0.8em;
  transition: transform 0.3s ease;
  display: inline-block;
  margin-left: 8px;
}

.expandable-card:hover h3::after {
  transform: rotate(180deg);
}

.example-section {
  background: #f8fafc;
  border-left: 3px solid var(--primary-color);
  padding: 12px 16px;
  margin-bottom: 12px;
  border-radius: 4px;
}

.example-section h4 {
  color: #1e3a8a;
  font-size: 0.95em;
  margin-bottom: 8px;
  font-weight: 600;
}

.example-section p {
  font-size: 0.9em;
  line-height: 1.5;
  margin-bottom: 6px;
  color: var(--text-secondary);
}

.example-section p:last-child {
  margin-bottom: 0;
}

.example-section strong {
  color: var(--text-primary);
  font-weight: 600;
}

.expandable-content .note {
  background: #eff6ff;
  border-left: 3px solid var(--secondary-color);
  padding: 12px 16px;
  border-radius: 4px;
  font-size: 0.9em;
  margin-top: 12px;
  color: var(--text-primary);
  font-weight: 500;
}

.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  background: var(--text-secondary);
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%, 60%, 100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-10px);
  }
}

@media (max-width: 1024px) {
  main {
    grid-template-columns: 1fr;
  }
  
  .info-panel {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    display: grid;
  }
}

@media (max-width: 640px) {
  body {
    padding: 10px;
  }

  header h1 {
    font-size: 1.5rem;
  }

  .tagline {
    font-size: 0.9rem;
  }

  .header-content {
    flex-direction: column;
    gap: 15px;
  }

  .auth-section {
    display: none;
  }

  .auth-status {
    padding: 8px 12px;
    font-size: 0.85rem;
  }

  .btn-primary,
  .btn-secondary {
    padding: 6px 12px;
    font-size: 0.85rem;
  }
  
  .chat-container {
    height: calc(100vh - 250px);
    min-height: 400px;
  }

  .welcome-message {
    padding: 20px;
  }

  .welcome-content h2 {
    font-size: 1.4rem;
  }

  .welcome-content li {
    font-size: 0.9rem;
    padding: 8px;
  }
  
  .message-content {
    max-width: 85%;
    font-size: 0.95rem;
  }

  .message-avatar {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }

  .chat-input-container {
    padding: 12px;
  }

  #messageInput {
    font-size: 0.95rem;
    padding: 10px 12px;
  }

  .send-btn {
    width: 40px;
    height: 40px;
  }

  .info-card {
    padding: 16px;
  }

  .info-card h3 {
    font-size: 1rem;
  }

  .tip {
    padding: 10px;
    font-size: 0.9rem;
  }

  .scrollable-tips {
    max-height: 300px;
  }

  .expandable-card .expandable-content {
    max-height: 0;
    opacity: 0;
  }

  .expandable-card:hover .expandable-content {
    max-height: 1000px;
    opacity: 1;
    margin-top: 16px;
  }

  .expandable-card h3::after {
    content: " ▼";
  }

  .expandable-card:hover h3::after {
    transform: rotate(180deg);
  }
}
