* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  :root {
    --primary-blue: #2563eb;
    --primary-teal: #0d9488;
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    /* Light theme variables */
    --bg-primary: #f8fafc;
    --bg-secondary: rgba(255, 255, 255, 0.8);
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --message-bg: #ffffff;
    --input-bg: #ffffff;
    --gradient-bg: linear-gradient(135deg, #f8fafc 0%, #dbeafe 100%);
  }

  [data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: rgba(30, 41, 59, 0.8);
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --border-light: #475569;
    --message-bg: #1e293b;
    --input-bg: #1e293b;
    --gradient-bg: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);
  }
  
  body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--gradient-bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
  }
  
  .app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 1200px;
    margin: 0 auto;
  }
  
  /* PWA Install Banner */
  .install-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-teal));
    color: white;
    z-index: 1000;
    padding: 12px 16px;
    box-shadow: var(--shadow-lg);
  }
  
  .install-content {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 1200px;
    margin: 0 auto;
  }
  
  .install-icon {
    font-size: 24px;
  }
  
  .install-text h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
  }
  
  .install-text p {
    font-size: 12px;
    opacity: 0.9;
  }
  
  .install-actions {
    margin-left: auto;
    display: flex;
    gap: 8px;
  }
  
  .install-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
  }
  
  .install-btn:hover {
    background: rgba(255, 255, 255, 0.3);
  }
  
  .dismiss-btn {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
  }
  
  .dismiss-btn:hover {
    background: rgba(255, 255, 255, 0.2);
  }
  
  .hidden {
    display: none !important;
  }
  
  /* Header */
  .header {
    background: var(--bg-secondary);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 24px 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
  }
  
  .header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
  }
  
  .brand {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  
  .brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-teal));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
  }
  
  .brand-text h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    transition: color 0.3s ease;
  }
  
  .brand-text p {
    font-size: 14px;
    color: var(--text-secondary);
    transition: color 0.3s ease;
  }
  
  .toggle-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--border-light);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
  }
  
  .toggle-btn:hover {
    background: var(--border-color);
  }
  
  .toggle-btn.active {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
  }

  .theme-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--border-light);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    margin-left: 8px;
  }
  
  .theme-toggle:hover {
    background: var(--border-color);
  }
  
  .theme-toggle.active {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
  }
  
  /* Chat Container */
  .chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px 16px;
  }
  
  .chat-messages {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 1000px;
    margin: 0 auto;
  }
  
  .welcome-message {
    text-align: center;
    padding: 48px 24px;
  }
  
  .welcome-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #dbeafe, #a7f3d0);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: var(--primary-blue);
  }
  
  .welcome-message h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--slate-800);
    margin-bottom: 8px;
  }
  
  .welcome-message p {
    color: var(--slate-600);
    max-width: 400px;
    margin: 0 auto;
  }
  
  .message-container {
    display: flex;
    animation: slideIn 0.3s ease-out;
  }
  
  .message-container.user-message {
    justify-content: flex-end;
  }
  
  .message-container.ai-message {
    justify-content: flex-start;
  }
  
  .message-bubble {
    max-width: 80%;
    padding: 16px 20px;
    border-radius: 16px;
    position: relative;
    word-wrap: break-word;
  }
  
  .user-bubble {
    background: linear-gradient(135deg, var(--primary-blue), #1d4ed8);
    color: white;
    border-bottom-right-radius: 4px;
  }
  
  .ai-bubble {
    background: var(--message-bg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    border-bottom-left-radius: 4px;
    color: var(--text-primary);
    transition: all 0.3s ease;
  }
  
  .language-tag {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 500;
    margin-bottom: 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
  }
  
  .message-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
    transition: border-color 0.3s ease;
  }
  
  .action-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
  }
  
  .action-btn:hover {
    background: var(--border-light);
    color: var(--text-primary);
  }
  
  /* Typing Animation */
  .typing-animation {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-right: 8px;
  }
  
  .typing-dot {
    width: 8px;
    height: 8px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
    transition: background-color 0.3s ease;
  }
  
  .typing-dot:nth-child(1) {
    animation-delay: -0.32s;
  }
  .typing-dot:nth-child(2) {
    animation-delay: -0.16s;
  }
  
  .typing-text {
    color: var(--text-secondary);
    font-size: 14px;
    transition: color 0.3s ease;
  }
  
  @keyframes typing {
    0%,
    80%,
    100% {
      transform: scale(0.8);
      opacity: 0.5;
    }
    40% {
      transform: scale(1);
      opacity: 1;
    }
  }
  
  /* Input Area */
  .input-area {
    background: var(--bg-secondary);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-color);
    padding: 16px;
    position: sticky;
    bottom: 0;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
  }
  
  .input-form {
    display: flex;
    gap: 12px;
    max-width: 800px;
    margin: 0 auto;
  }
  
  .input-container {
    flex: 1;
    position: relative;
  }
  
  .input-container textarea {
    width: 100%;
    min-height: 60px;
    max-height: 120px;
    padding: 16px;
    padding-right: 80px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    resize: none;
    background: var(--input-bg);
    color: var(--text-primary);
    transition: all 0.3s;
  }
  
  .input-container textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  }
  
  .language-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--border-light);
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 500;
    transition: all 0.3s ease;
  }
  
  .send-btn {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-teal));
    border: none;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .send-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
  }
  
  .send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }
  
  .footer-text {
    text-align: center;
    margin-top: 12px;
  }
  
  .footer-text p {
    font-size: 12px;
    color: var(--text-muted);
    transition: color 0.3s ease;
  }
  
  /* Toast Notification */
  .toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--slate-800);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 1000;
    animation: toastIn 0.3s ease-out;
  }
  
  @keyframes slideIn {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  @keyframes toastIn {
    from {
      opacity: 0;
      transform: translateX(-50%) translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateX(-50%) translateY(0);
    }
  }
  
  /* Mobile Responsive */
  @media (max-width: 768px) {
    .header {
      padding: 16px;
    }
  
    .header-content {
      flex-direction: column;
      gap: 12px;
    }

    .header-controls {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }
  
    .brand-text h1 {
      font-size: 20px;
    }
  
    .brand-text p {
      font-size: 12px;
    }
  
    .chat-container {
      padding: 16px;
    }
  
    .message-bubble {
      max-width: 90%;
    }
  
    .input-area {
      padding: 12px;
    }
  
    .input-container textarea {
      min-height: 50px;
      padding: 12px;
      padding-right: 60px;
    }
  
    .send-btn {
      width: 50px;
      height: 50px;
    }
  
    .welcome-message {
      padding: 24px 16px;
    }
  
    .welcome-message h2 {
      font-size: 20px;
    }
  }
  
  @media (max-width: 480px) {
    .brand {
      gap: 8px;
    }
  
    .brand-icon {
      width: 32px;
      height: 32px;
    }
  
    .brand-text h1 {
      font-size: 18px;
    }
  
    .toggle-btn,
    .theme-toggle {
      font-size: 11px;
      padding: 6px 10px;
    }

    .theme-toggle {
      margin-left: 0;
    }
  }
  