/* TechSpace by DOTR — CSS Design System & Theme Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* Theme variables - Dark Mode (Default) */
  --bg-color: #0a0a0f;
  --bg-gradient: radial-gradient(circle at 10% 10%, rgba(99, 102, 241, 0.15), transparent 45%), 
                 radial-gradient(circle at 90% 90%, rgba(14, 165, 233, 0.15), transparent 45%);
  --sidebar-bg: rgba(15, 15, 22, 0.6);
  --chat-bg: rgba(10, 10, 15, 0.4);
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.05);
  --glass-hover: rgba(255, 255, 255, 0.07);
  --glass-selected: rgba(255, 255, 255, 0.1);
  --text-primary: #f5f5f7;
  --text-secondary: #86868b;
  --text-muted: #48484a;
  --accent-color: #0A84FF;
  --accent-glow: rgba(10, 132, 255, 0.4);
  --accent-green: #30D158;
  --ai-glow-color: #BF5AF2;
  --ai-glow-bg: rgba(191, 90, 242, 0.15);
  
  --shadow-premium: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
  --border-radius: 12px;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --sidebar-width: 280px;
  --members-width: 240px;
}

/* Light Theme Variables */
body.light-theme {
  --bg-color: #f5f5f7;
  --bg-gradient: radial-gradient(circle at 10% 10%, rgba(99, 102, 241, 0.07), transparent 45%), 
                 radial-gradient(circle at 90% 90%, rgba(14, 165, 233, 0.07), transparent 45%);
  --sidebar-bg: rgba(255, 255, 255, 0.7);
  --chat-bg: rgba(245, 245, 247, 0.5);
  --glass-bg: rgba(0, 0, 0, 0.03);
  --glass-border: rgba(0, 0, 0, 0.06);
  --glass-hover: rgba(0, 0, 0, 0.05);
  --glass-selected: rgba(0, 0, 0, 0.08);
  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-muted: #86868b;
  --accent-color: #0071e3;
  --accent-glow: rgba(0, 113, 227, 0.3);
  --shadow-premium: 0 8px 32px 0 rgba(0, 0, 0, 0.08);
}

/* General Resets */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--bg-color);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background 0.5s ease, color 0.3s ease;
}

/* App Container */
#app-root {
  display: flex;
  width: 100vw;
  height: 100vh;
  position: relative;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
body.light-theme ::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* AUTH PORTAL STYLING (index.html) */
.auth-page {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100vw;
  height: 100vh;
  position: relative;
  overflow: hidden;
}

.auth-container {
  width: 440px;
  perspective: 1000px;
  z-index: 10;
}

.auth-card {
  width: 100%;
  background: var(--sidebar-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 40px;
  box-shadow: var(--shadow-premium);
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.auth-card.flipped {
  transform: rotateY(180deg);
}

.auth-header {
  text-align: center;
  margin-bottom: 30px;
}

.auth-logo {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-color);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.auth-logo span {
  background: linear-gradient(135deg, var(--accent-color), #85C1E9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.form-group {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-input {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius);
  padding: 12px 16px;
  font-size: 0.95rem;
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s ease;
}

.form-input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Avatar Emoji Picker */
.avatar-picker-container {
  display: flex;
  flex-direction: column;
  margin-bottom: 20px;
}

.avatar-preview-box {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 5px;
}

.current-avatar-view {
  font-size: 2.2rem;
  width: 55px;
  height: 55px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 10px rgba(255,255,255,0.05);
}

.avatar-options-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  background: var(--glass-bg);
  padding: 10px;
  border-radius: var(--border-radius);
  border: 1px solid var(--glass-border);
  max-height: 120px;
  overflow-y: auto;
}

.avatar-option-btn {
  font-size: 1.5rem;
  background: none;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  padding: 5px;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-option-btn:hover {
  background: var(--glass-hover);
  transform: scale(1.15);
}

.avatar-option-btn.selected {
  border-color: var(--accent-color);
  background: rgba(10, 132, 255, 0.15);
}

/* Premium Buttons */
.btn-primary {
  background: var(--accent-color);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  padding: 14px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  box-shadow: 0 4px 15px var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary:hover {
  background: #3399FF;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(10, 132, 255, 0.5);
}

.btn-primary:active {
  transform: translateY(1px);
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.auth-link {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
}

.auth-link:hover {
  text-decoration: underline;
}

/* Alerts / Errors */
.alert-error {
  background: rgba(255, 69, 58, 0.15);
  border: 1px solid rgba(255, 69, 58, 0.3);
  color: #FF453A;
  padding: 12px;
  border-radius: var(--border-radius);
  font-size: 0.85rem;
  margin-bottom: 20px;
  display: none;
  align-items: center;
  gap: 8px;
}

/* MAIN CHAT APPLICATION STYLING (app.html) */

/* Sidebar (Left) */
.sidebar {
  width: var(--sidebar-width);
  height: 100%;
  background: var(--sidebar-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  z-index: 20;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dotr-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dotr-logo {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
}

.dotr-logo span {
  color: var(--accent-color);
}

.powered-by {
  font-size: 0.65rem;
  color: var(--text-secondary);
  opacity: 0.6;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Theme Toggle Button */
.theme-toggle {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.theme-toggle:hover {
  background: var(--glass-hover);
  transform: rotate(20deg);
}

/* Sidebar Channels List */
.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 15px 10px;
}

.section-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.08em;
  padding-left: 10px;
  margin-bottom: 8px;
}

.channel-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 24px;
}

.channel-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 500;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.channel-item:hover {
  background: var(--glass-hover);
  color: var(--text-primary);
}

.channel-item.active {
  background: var(--glass-selected);
  color: var(--text-primary);
  border-color: var(--glass-border);
}

.channel-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-icon {
  font-size: 1.1rem;
}

/* AI Chatroom glowing space listing */
.channel-item.ai-room-btn {
  background: var(--ai-glow-bg);
  border: 1px solid rgba(191, 90, 242, 0.2);
  color: #E2C2FF;
  position: relative;
  overflow: hidden;
}

.channel-item.ai-room-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  transition: 0.5s;
}

.channel-item.ai-room-btn:hover::before {
  left: 100%;
}

.channel-item.ai-room-btn:hover {
  border-color: rgba(191, 90, 242, 0.4);
  box-shadow: 0 0 10px rgba(191, 90, 242, 0.25);
  color: #f5f5f7;
}

.channel-item.ai-room-btn.active {
  background: rgba(191, 90, 242, 0.25);
  border-color: var(--ai-glow-color);
  box-shadow: 0 0 15px rgba(191, 90, 242, 0.35);
  color: white;
}

.ai-glowing-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--ai-glow-color);
  box-shadow: 0 0 8px var(--ai-glow-color);
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(191, 90, 242, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(191, 90, 242, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(191, 90, 242, 0);
  }
}

/* User Profile Widget (Sidebar Footer) */
.user-profile-widget {
  padding: 15px;
  border-top: 1px solid var(--glass-border);
  background: rgba(10, 10, 15, 0.8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.user-profile-info {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  flex: 1;
}

.user-widget-avatar {
  font-size: 1.8rem;
  width: 42px;
  height: 42px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-widget-details {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.user-widget-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Plan Badge styles */
.plan-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  width: fit-content;
  margin-top: 2px;
  display: inline-block;
  letter-spacing: 0.05em;
}

.plan-badge.free {
  background: rgba(134, 134, 139, 0.15);
  color: var(--text-secondary);
  border: 1px solid rgba(134, 134, 139, 0.3);
}

.plan-badge.pro {
  background: rgba(10, 132, 255, 0.15);
  color: var(--accent-color);
  border: 1px solid rgba(10, 132, 255, 0.3);
  box-shadow: 0 0 5px rgba(10, 132, 255, 0.2);
  animation: glow-pro 3s infinite alternate;
}

@keyframes glow-pro {
  0% { box-shadow: 0 0 3px rgba(10, 132, 255, 0.2); }
  100% { box-shadow: 0 0 10px rgba(10, 132, 255, 0.5); }
}

.user-widget-actions {
  display: flex;
  gap: 4px;
}

.profile-action-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.profile-action-btn:hover {
  background: var(--glass-hover);
  color: var(--text-primary);
}

/* Center Panel (Chat Room) */
.chat-container {
  flex: 1;
  height: 100%;
  background: var(--chat-bg);
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Chat Header */
.chat-header {
  height: 64px;
  padding: 0 20px;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 15, 22, 0.3);
  backdrop-filter: blur(5px);
  z-index: 10;
}

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

.hamburger-btn {
  display: none; /* Desktop hidden */
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
}

.chat-header-title {
  font-weight: 600;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-header-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  border-left: 1px solid var(--glass-border);
  padding-left: 10px;
  margin-left: 10px;
  max-width: 400px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* AI Chatroom welcome banner / stats */
.ai-header-stats {
  display: flex;
  align-items: center;
  gap: 15px;
}

.ai-usage-counter {
  font-size: 0.85rem;
  color: var(--text-secondary);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  padding: 6px 12px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai-usage-counter strong {
  color: var(--accent-color);
}

.btn-clear-ai {
  background: rgba(255, 69, 58, 0.1);
  border: 1px solid rgba(255, 69, 58, 0.2);
  color: #FF453A;
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-clear-ai:hover {
  background: rgba(255, 69, 58, 0.2);
}

/* Messages Area */
.messages-scroller {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.message-item {
  display: flex;
  gap: 14px;
  max-width: 85%;
  animation: fade-in-up 0.3s ease;
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-avatar {
  font-size: 1.8rem;
  width: 40px;
  height: 40px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.message-content-wrapper {
  display: flex;
  flex-direction: column;
}

.message-user-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.message-username {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-primary);
}

.message-time {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.message-bubble {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  padding: 12px 16px;
  border-radius: 0 16px 16px 16px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-primary);
  word-break: break-word;
}

/* AI specific message bubbles style */
.message-item.ai-message {
  align-self: flex-start;
}

.message-item.ai-message .message-bubble {
  background: rgba(191, 90, 242, 0.05);
  border-color: rgba(191, 90, 242, 0.15);
}

.message-item.ai-message .message-username {
  color: #D39CFC;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai-badge {
  background: var(--ai-glow-color);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  text-transform: uppercase;
}

/* Code Syntax Highlighting override */
pre {
  margin: 10px 0;
  border-radius: 8px;
  overflow-x: auto;
  border: 1px solid var(--glass-border);
}

code {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.88rem;
  padding: 2px 4px;
  border-radius: 4px;
  background: rgba(0,0,0,0.2);
}

pre code {
  padding: 15px;
  display: block;
  background: #0d0d13 !important;
}

/* Typing Indicator Area */
.typing-indicator-container {
  height: 20px;
  padding-left: 78px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Composer / Input Area */
.chat-composer {
  padding: 0 24px 24px 24px;
}

.composer-wrapper {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  padding: 6px 12px;
  transition: all 0.2s ease;
}

.composer-wrapper:focus-within {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.composer-textarea {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.95rem;
  padding: 10px 6px;
  resize: none;
  height: 40px;
  max-height: 120px;
}

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

.composer-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.composer-btn:hover {
  background: var(--glass-hover);
  color: var(--text-primary);
}

.composer-btn.btn-send-message {
  color: var(--accent-color);
}

.composer-btn.btn-send-message:hover {
  background: var(--accent-glow);
  color: white;
}

/* Right Panel (Members Panel) */
.members-panel {
  width: var(--members-width);
  height: 100%;
  background: var(--sidebar-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-left: 1px solid var(--glass-border);
  padding: 20px 15px;
  overflow-y: auto;
  z-index: 10;
  transition: transform 0.3s ease;
}

.members-group-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.members-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.member-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.member-item:hover {
  background: var(--glass-hover);
}

.member-avatar {
  font-size: 1.4rem;
  width: 32px;
  height: 32px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.online-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-green);
  border: 2px solid var(--sidebar-bg);
  position: absolute;
  bottom: -1px;
  right: -1px;
}

.member-details {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.member-name {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* PREMIUM MODAL DIALOGS */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 100;
  animation: fade-in 0.25s ease;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  background: rgba(20, 20, 28, 0.95);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  width: 420px;
  padding: 35px;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.8);
  text-align: center;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active {
  display: flex;
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

.modal-icon {
  font-size: 3rem;
  margin-bottom: 18px;
  display: block;
}

.modal-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.modal-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 24px;
}

.modal-actions {
  display: flex;
  gap: 12px;
}

.btn-modal {
  flex: 1;
  padding: 12px;
  border-radius: var(--border-radius);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.btn-modal-cancel {
  background: var(--glass-bg);
  border-color: var(--glass-border);
  color: var(--text-primary);
}

.btn-modal-cancel:hover {
  background: var(--glass-hover);
}

.btn-modal-confirm {
  background: var(--accent-color);
  color: white;
  box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-modal-confirm:hover {
  background: #3399FF;
  box-shadow: 0 6px 20px rgba(10, 132, 255, 0.5);
}

/* Upgrade Pro Modal Specifics */
.modal-upgrade .modal-card {
  border-color: rgba(191, 90, 242, 0.3);
  background: radial-gradient(circle at 50% 0%, rgba(191, 90, 242, 0.12), transparent 60%), rgba(20, 20, 28, 0.98);
}

.modal-upgrade .modal-icon {
  animation: pulse-glow-ai 2s infinite alternate;
}

@keyframes pulse-glow-ai {
  0% { text-shadow: 0 0 5px rgba(191, 90, 242, 0.5); }
  100% { text-shadow: 0 0 20px rgba(191, 90, 242, 0.9); }
}

.modal-upgrade .btn-modal-confirm {
  background: linear-gradient(135deg, var(--ai-glow-color), #8B5CF6);
  border: none;
  box-shadow: 0 4px 15px rgba(191, 90, 242, 0.4);
}

.modal-upgrade .btn-modal-confirm:hover {
  background: linear-gradient(135deg, #cc78fc, #9b72f7);
  box-shadow: 0 6px 20px rgba(191, 90, 242, 0.6);
}

/* AI Particle Canvas Background (Behind AI Space UI) */
#ai-canvas-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.chat-container.ai-active #ai-canvas-bg {
  opacity: 0.15;
}

.chat-container.ai-active .messages-scroller,
.chat-container.ai-active .chat-composer {
  position: relative;
  z-index: 2;
}

/* Profile Edit Modal Form styling */
.profile-modal-grid {
  display: flex;
  flex-direction: column;
  gap: 15px;
  text-align: left;
  margin-bottom: 20px;
}

.settings-plan-card {
  background: var(--glass-bg);
  padding: 15px;
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.btn-plan-toggle {
  flex: none;
  font-size: 0.8rem;
  padding: 8px 14px;
  max-width: 140px;
  margin: 0;
  border-radius: var(--border-radius);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  background: var(--accent-color);
  color: white;
  box-shadow: 0 4px 10px var(--accent-glow);
}

.btn-plan-toggle:hover {
  background: #3399FF;
  box-shadow: 0 6px 15px rgba(10, 132, 255, 0.4);
}

/* Creative Welcome Layout for first open of AI Chat */
.ai-welcome-box {
  margin: auto;
  max-width: 500px;
  text-align: center;
  padding: 40px;
  background: rgba(191, 90, 242, 0.04);
  border: 1px dashed rgba(191, 90, 242, 0.2);
  border-radius: 20px;
  animation: fade-in 0.5s ease;
}

.ai-welcome-icon {
  font-size: 3.5rem;
  margin-bottom: 15px;
  display: inline-block;
  animation: spin-slow 10s linear infinite;
}

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

.ai-welcome-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: #D39CFC;
}

.ai-welcome-text {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Typing animated dots */
.typing-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.typing-dot {
  width: 5px;
  height: 5px;
  background: var(--text-secondary);
  border-radius: 50%;
  animation: bounce-typing 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce-typing {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* RESPONSIVE LAYOUT (Mobile compatibility) */
@media (max-width: 992px) {
  .members-panel {
    display: none; /* Hide members panel on tablets and below */
  }
}

@media (max-width: 768px) {
  :root {
    --sidebar-width: 100vw;
  }
  
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    transform: translateX(-100%);
    width: 280px;
    box-shadow: 15px 0 30px rgba(0,0,0,0.5);
  }
  
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  
  .chat-header-desc {
    display: none;
  }
  
  .hamburger-btn {
    display: block; /* Show hamburger button on mobile */
  }
  
  .messages-scroller {
    padding: 15px;
  }
  
  .message-item {
    max-width: 95%;
  }

  .user-profile-widget {
    position: sticky;
    bottom: 0;
  }
}
