/* ==================== RESET & BASE ==================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --secondary: #ec4899;
  --background: #0f172a;
  --surface: #1e293b;
  --surface-light: #334155;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #334155;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--background);
  color: var(--text);
  overflow-x: hidden;
  line-height: 1.6;
}

/* ==================== ANIMATED BACKGROUND ==================== */
.particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--primary);
  border-radius: 50%;
  opacity: 0.3;
  animation: float 20s infinite ease-in-out;
}

.particle:nth-child(1) {
  left: 10%;
  animation-delay: 0s;
  animation-duration: 15s;
}

.particle:nth-child(2) {
  left: 30%;
  animation-delay: 2s;
  animation-duration: 18s;
}

.particle:nth-child(3) {
  left: 50%;
  animation-delay: 4s;
  animation-duration: 22s;
}

.particle:nth-child(4) {
  left: 70%;
  animation-delay: 6s;
  animation-duration: 20s;
}

.particle:nth-child(5) {
  left: 90%;
  animation-delay: 8s;
  animation-duration: 16s;
}

@keyframes float {
  0%, 100% {
    transform: translateY(100vh) scale(0);
    opacity: 0;
  }
  10% {
    opacity: 0.3;
  }
  90% {
    opacity: 0.3;
  }
  50% {
    transform: translateY(-10vh) scale(1);
    opacity: 0.5;
  }
}

/* ==================== MAIN CONTAINER ==================== */
.main-container {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

/* ==================== HEADER ==================== */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  margin-bottom: 30px;
  animation: slideDown 0.6s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  font-size: 36px;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.logo-text {
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  gap: 30px;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  position: relative;
  transition: color 0.3s;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width 0.3s;
}

.nav-link:hover {
  color: var(--text);
}

.nav-link:hover::after {
  width: 100%;
}

/* ==================== CHAT CONTAINER ==================== */
.chat-container {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 24px;
  margin-bottom: 60px;
  animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==================== CHAT WINDOW ==================== */
.chat-window {
  background: var(--surface);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 700px;
  transition: transform 0.3s, box-shadow 0.3s;
}

.chat-window:hover {
  transform: translateY(-4px);
  box-shadow: 0 25px 70px rgba(99, 102, 241, 0.2);
}

/* ==================== CHAT HEADER ==================== */
.chat-window-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bot-avatar {
  position: relative;
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(255, 255, 255, 0);
  }
}

.status-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  background: var(--success);
  border-radius: 50%;
  border: 2px solid white;
  animation: blink 2s infinite;
}

@keyframes blink {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

.header-info h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 2px;
}

.bot-status {
  font-size: 13px;
  opacity: 0.9;
}

.header-actions {
  display: flex;
  gap: 8px;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

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

/* ==================== MESSAGES AREA ==================== */
.messages-area {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: var(--background);
  scroll-behavior: smooth;
}

.messages-area::-webkit-scrollbar {
  width: 8px;
}

.messages-area::-webkit-scrollbar-track {
  background: var(--surface);
}

.messages-area::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 10px;
}

/* ==================== WELCOME SCREEN ==================== */
.welcome-screen {
  text-align: center;
  padding: 60px 20px;
  animation: scaleIn 0.6s ease-out;
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.welcome-icon {
  font-size: 64px;
  margin-bottom: 20px;
  animation: rotate 3s infinite ease-in-out;
}

@keyframes rotate {
  0%, 100% {
    transform: rotate(-10deg);
  }
  50% {
    transform: rotate(10deg);
  }
}

.welcome-screen h3 {
  font-size: 28px;
  margin-bottom: 10px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.welcome-screen p {
  color: var(--text-muted);
  margin-bottom: 24px;
}

.welcome-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.tag {
  background: var(--surface-light);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  border: 1px solid var(--border);
  transition: all 0.3s;
  cursor: default;
}

.tag:hover {
  background: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* ==================== CHAT MESSAGES ==================== */
.chat-message {
  margin-bottom: 20px;
  animation: messageSlide 0.4s ease-out;
  display: flex;
  gap: 12px;
}

@keyframes messageSlide {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-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;
}

.chat-message.user .message-avatar {
  background: linear-gradient(135deg, var(--secondary), #f43f5e);
}

.chat-message.bot .message-avatar,
.chat-message.assistant .message-avatar {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.message-content {
  max-width: 70%;
}

.message-bubble {
  padding: 14px 18px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  word-wrap: break-word;
  line-height: 1.6;
}

.message-body {
  white-space: pre-line;
}

.chat-message.user .message-bubble {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: none;
  color: white;
  border-bottom-right-radius: 4px;
}

.chat-message.bot .message-bubble,
.chat-message.assistant .message-bubble {
  border-bottom-left-radius: 4px;
}

.message-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.message-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.copy-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s;
}

.copy-btn:hover {
  background: var(--surface-light);
  color: var(--text);
  border-color: var(--primary);
}

/* ==================== TYPING INDICATOR ==================== */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 14px 18px;
}

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

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

.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% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

/* ==================== INPUT AREA ==================== */
.input-area {
  padding: 20px 24px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.input-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.model-select {
  flex: 1;
  padding: 10px 14px;
  background: var(--surface-light);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s;
  outline: none;
}

.model-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.connection-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.connection-indicator .dot {
  width: 8px;
  height: 8px;
  background: var(--warning);
  border-radius: 50%;
  animation: blink 2s infinite;
}

.connection-indicator.online .dot {
  background: var(--success);
}

.message-input-container {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.message-input {
  flex: 1;
  padding: 14px 18px;
  background: var(--background);
  border: 2px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  resize: none;
  outline: none;
  transition: all 0.3s;
  max-height: 120px;
  line-height: 1.5;
}

.message-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.message-input::placeholder {
  color: var(--text-muted);
}

.send-btn {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: none;
  border-radius: 12px;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  flex-shrink: 0;
}

.send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

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

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

/* ==================== QUICK PROMPTS ==================== */
.quick-prompts {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.quick-prompts button {
  background: var(--surface-light);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s;
  white-space: nowrap;
}

.quick-prompts button:hover {
  background: var(--primary);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* ==================== INFO SIDEBAR ==================== */
.info-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.info-card {
  background: var(--surface);
  border-radius: 18px;
  padding: 24px;
  border: 1px solid var(--border);
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.info-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.1), transparent);
  transition: left 0.6s;
}

.info-card.shimmer:hover::before {
  left: 100%;
}

.info-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.2);
}

.card-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.info-card h3 {
  font-size: 18px;
  margin-bottom: 12px;
  color: var(--primary-light);
}

.info-card ul {
  list-style: none;
  padding: 0;
}

.info-card li {
  padding: 6px 0;
  padding-left: 20px;
  position: relative;
  color: var(--text-muted);
  font-size: 14px;
}

.info-card li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: bold;
}

.info-card p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

/* ==================== FEATURES SECTION ==================== */
.features-section {
  margin-bottom: 60px;
  animation: fadeIn 1s ease-out;
}

.section-title {
  text-align: center;
  font-size: 36px;
  margin-bottom: 40px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
}

.feature-card {
  background: var(--surface);
  padding: 30px;
  border-radius: 18px;
  border: 1px solid var(--border);
  text-align: center;
  transition: all 0.4s;
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s;
}

.feature-card:hover::before {
  transform: scaleX(1);
}

.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 30px rgba(99, 102, 241, 0.3);
  border-color: var(--primary);
}

.feature-icon {
  font-size: 48px;
  margin-bottom: 16px;
  display: inline-block;
  transition: transform 0.4s;
}

.feature-card:hover .feature-icon {
  transform: scale(1.2) rotate(5deg);
}

.feature-card h3 {
  font-size: 20px;
  margin-bottom: 12px;
  color: var(--text);
}

.feature-card p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

/* ==================== ABOUT SECTION ==================== */
.about-section {
  background: var(--surface);
  border-radius: 24px;
  padding: 50px;
  margin-bottom: 40px;
  border: 1px solid var(--border);
  text-align: center;
  animation: fadeIn 1.2s ease-out;
}

.about-content p {
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.8;
  max-width: 800px;
  margin: 0 auto 40px;
}

.about-stats {
  display: flex;
  justify-content: center;
  gap: 60px;
  flex-wrap: wrap;
}

.stat {
  text-align: center;
}

.stat-number {
  font-size: 48px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.stat-label {
  color: var(--text-muted);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ==================== FOOTER ==================== */
.footer {
  text-align: center;
  padding: 30px;
  color: var(--text-muted);
  font-size: 14px;
  border-top: 1px solid var(--border);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
  .chat-container {
    grid-template-columns: 1fr;
  }

  .info-sidebar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
}

@media (max-width: 768px) {
  .header {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }

  .nav-links {
    flex-direction: column;
    gap: 15px;
  }

  .chat-window {
    height: 600px;
  }

  .message-content {
    max-width: 85%;
  }

  .about-stats {
    gap: 30px;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .info-sidebar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .main-container {
    padding: 10px;
  }

  .logo-text {
    font-size: 24px;
  }

  .section-title {
    font-size: 28px;
  }

  .chat-window {
    height: 500px;
    border-radius: 16px;
  }

  .input-area {
    padding: 16px;
  }

  .about-section {
    padding: 30px 20px;
  }

  .stat-number {
    font-size: 36px;
  }
}

/* ==================== LOADING STATES ==================== */
.chat-message.loading {
  opacity: 0.7;
}

.input-area.sending .send-btn {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
