@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap");

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

:root {
  /* لوحة ألوان جامعة زالنجي */
  --primary-color: #006837;
  --primary-hover: #004d29;
  --secondary-color: #fecb00;
  --secondary-hover: #e6b800;

  --text-main: #333333;
  --text-light: #777777;
  --bg-light: #f8f9fa;
  --bg-white: #ffffff;

  --danger-color: #dc3545;
  --success-color: #28a745;
  --info-color: #17a2b8;
  --warning-color: #ffc107;

  --glass-bg: rgba(255, 255, 255, 0.95);
  --glass-blur: 10px;
  --shadow-sm: 0 2px 5px rgba(0,0,0,0.05);
  --shadow-md: 0 5px 15px rgba(0,0,0,0.08);
  --shadow-glow: 0 10px 30px rgba(0,0,0,0.12);
  --border-color: #e9ecef;
  --radius-sm: 8px;
  --radius-md: 15px;
  --radius-lg: 25px;

  /* توافق مع متغيرات التصميم الحالية */
  --bg-primary: var(--bg-light);
  --bg-secondary: var(--bg-white);
  --bg-sidebar: var(--bg-white);
  --bg-card: var(--glass-bg);
  --text-primary: var(--text-main);
  --text-secondary: var(--text-light);
  --text-tertiary: #555555;
  --accent-color: var(--primary-color);
  --accent-hover: var(--primary-hover);
  --neon-blue: var(--secondary-color);
  --neon-pink: var(--info-color);
  --active-bg: rgba(0, 104, 55, 0.08);
  --card-hover: rgba(0, 104, 55, 0.06);
  --yellow: var(--secondary-color);
  --blue: var(--info-color);
  --green: var(--success-color);
  --pink: var(--warning-color);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  height: 100vh !important;
  min-height: 100vh !important;
  max-height: 100vh !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
}

.app-container {
  display: flex !important;
  height: 100vh !important;
  min-height: 100vh !important;
  max-height: 100vh !important;
  width: 100vw !important;
  overflow: hidden !important;
  position: relative;
  box-sizing: border-box;
}

/* Left Sidebar */
.left-sidebar {
  width: 280px !important;
  height: 100vh !important;
  min-height: 100vh !important;
  max-height: 100vh !important;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  flex-shrink: 0;
  transition: width 0.3s ease, transform 0.3s ease;
  position: relative;
  box-sizing: border-box;
}

.left-sidebar.collapsed {
  width: 0 !important;
  min-width: 0 !important;
  overflow: hidden !important;
  border-right: none;
  padding: 0 !important;
}

.left-sidebar.collapsed .sidebar-content {
  width: 0 !important;
  overflow: hidden !important;
  opacity: 0 !important;
}

.sidebar-toggle {
  position: absolute;
  top: 16px;
  right: -40px;
  width: 36px;
  height: 36px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.sidebar-toggle:hover {
  background: var(--card-hover);
  box-shadow: var(--shadow-md);
  transform: scale(1.05);
}

.sidebar-toggle span {
  font-size: 20px;
  color: var(--text-primary);
  transition: transform 0.3s ease;
}

/* عندما يكون الشريط مطوياً، يظهر الزر في مكان آخر */
.left-sidebar.collapsed .sidebar-toggle {
  right: 16px;
  background: var(--accent-color);
  border-color: var(--accent-color);
}

.left-sidebar.collapsed .sidebar-toggle span {
  color: white;
  transform: rotate(180deg);
}

.left-sidebar:not(.collapsed) .sidebar-toggle span {
  transform: rotate(0deg);
}

.sidebar-content {
  display: flex !important;
  flex-direction: column !important;
  height: 100vh !important;
  min-height: 100vh !important;
  max-height: 100vh !important;
  padding: 24px 16px !important;
  transition: opacity 0.2s;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  flex: 1 1 auto !important;
  box-sizing: border-box !important;
  position: relative;
}

.left-sidebar.collapsed .sidebar-content {
  opacity: 0;
  pointer-events: none;
}

.logo-section {
  display: flex !important;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding: 0 8px;
  flex-shrink: 0 !important;
  min-height: 40px;
}

.logo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  width: 32px;
  height: 32px;
}

.logo-dot {
  width: 8px;
  height: 8px;
  background: var(--text-primary);
  border-radius: 2px;
}

.logo-text {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

.search-container {
  position: relative;
  margin-bottom: 24px;
  flex-shrink: 0 !important;
  min-height: 40px;
}

.search-input {
  width: 100%;
  padding: 10px 12px;
  padding-right: 60px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  background: var(--bg-primary);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
}

.search-input:focus {
  border-color: var(--accent-color);
}

.search-shortcut {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--text-tertiary);
  background: var(--bg-secondary);
  padding: 2px 6px;
  border-radius: 4px;
}

.main-nav {
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 4px;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  min-height: 0 !important;
  -webkit-overflow-scrolling: touch;
  max-height: calc(100vh - 400px);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s;
  position: relative;
}

.nav-item:hover {
  background: var(--card-hover);
}

.nav-item.active {
  background: var(--active-bg);
  color: var(--accent-color);
  box-shadow: 0 0 20px rgba(154, 106, 255, 0.2);
  position: relative;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent-color), var(--neon-blue));
  box-shadow: 0 0 10px rgba(154, 106, 255, 0.5);
}

.nav-item.active .nav-icon {
  color: var(--accent-color);
}

.nav-icon {
  font-size: 20px;
  width: 20px;
  height: 20px;
}

.nav-text {
  flex: 1;
}

.nav-add {
  font-size: 18px;
  color: var(--text-tertiary);
  font-weight: 300;
}

.nav-badge {
  background: var(--pink);
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  text-transform: uppercase;
}

.nav-section-header {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 16px;
  margin-bottom: 8px;
  padding: 0 12px;
}

.language-switcher {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.language-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang-flag {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.lang-name {
  flex: 1;
}

.theme-switcher {
  display: flex !important;
  gap: 8px;
  padding: 8px;
  background: var(--bg-secondary);
  border-radius: 8px;
  margin-top: auto !important;
  margin-bottom: 12px;
  flex-shrink: 0 !important;
  min-height: 40px;
}

.lang-switcher-sidebar {
  margin-bottom: 16px;
  flex-shrink: 0 !important;
}

.lang-btn {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  width: 100%;
}

.lang-btn:hover {
  background: var(--card-hover);
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.lang-btn span:first-child {
  font-size: 20px;
}

.theme-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.theme-btn.active {
  background: var(--bg-primary);
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.theme-btn span {
  font-size: 18px;
}

.user-profile {
  display: flex !important;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  background: var(--bg-secondary);
  flex-shrink: 0 !important;
  margin-top: 0 !important;
  min-height: 60px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

.user-info {
  flex: 1;
}

.user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.user-email {
  font-size: 12px;
  color: var(--text-tertiary);
}

/* Main Content */
.main-content {
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  background: var(--bg-primary);
  overflow: hidden !important;
  width: calc(100vw - 280px) !important;
  max-width: calc(100vw - 280px) !important;
  min-width: 0 !important;
  height: 100vh !important;
  max-height: 100vh !important;
  box-sizing: border-box !important;
}

.left-sidebar.collapsed + .main-content {
  width: 100vw !important;
  max-width: 100vw !important;
}

.main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

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

.header-sidebar-toggle {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-primary);
}

.header-sidebar-toggle:hover {
  background: var(--card-hover);
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.header-sidebar-toggle span {
  font-size: 24px;
}

.page-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
}

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

.upgrade-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--accent-color);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.upgrade-btn:hover {
  background: var(--accent-hover);
}

.upgrade-btn span {
  font-size: 18px;
}

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

.icon-btn:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.icon-btn span {
  font-size: 20px;
}

/* Chat Area */
.chat-area {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
  display: flex;
  flex-direction: column;
}

.welcome-screen {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  padding-top: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  background: radial-gradient(circle at center, rgba(0, 104, 55, 0.03) 0%, transparent 60%);
}

.welcome-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.gradient-text {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.2;
}

.title-sub {
  font-size: 1.5rem;
  color: var(--text-main);
  font-weight: 600;
}

.welcome-subtitle {
  font-size: 1.25rem;
  color: var(--text-light);
  margin-bottom: 48px;
  line-height: 1.6;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  opacity: 0;
  animation: fadeInUp 0.8s ease forwards 0.5s;
  position: relative;
  padding-bottom: 10px;
}

.welcome-subtitle::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 3px;
  background: var(--secondary-color);
  border-radius: 2px;
}

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

.suggested-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 900px;
  margin: 0 auto;
}

.suggest-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.suggest-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(154, 106, 255, 0.1) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.suggest-card:hover {
  background: rgba(154, 106, 255, 0.1);
  border-color: var(--accent-color);
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(154, 106, 255, 0.2);
}

.suggest-card:hover::before {
  opacity: 1;
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-icon.yellow {
  background: #fef3c7;
  color: var(--yellow);
}

.card-icon.blue {
  background: #dbeafe;
  color: var(--blue);
}

.card-icon.green {
  background: #d1fae5;
  color: var(--green);
}

.card-icon.pink {
  background: #f3e8ff;
  color: var(--pink);
}

.card-icon.orange {
  background: #fff4e6;
  color: #fb923c;
}

.card-icon.purple {
  background: #f3e8ff;
  color: #a855f7;
}

.card-icon span {
  font-size: 24px;
}

.card-text {
  flex: 1;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
}

.card-add {
  font-size: 20px;
  color: var(--text-tertiary);
  font-weight: 300;
}

/* Messages Container */
.messages-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

.message {
  display: flex;
  gap: 12px;
  animation: fadeIn 0.3s ease;
}

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

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

.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}

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

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

.message-text {
  padding: 12px 16px;
  background: var(--bg-card);
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
  word-wrap: break-word;
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.message-text:hover {
  box-shadow: 0 4px 20px rgba(154, 106, 255, 0.1);
}

.message.user-message .message-text {
  background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
  border: 1px solid rgba(154, 106, 255, 0.3);
  color: white;
  box-shadow: 0 4px 20px rgba(154, 106, 255, 0.2);
}

.message-image {
  max-width: 300px;
  border-radius: 12px;
  margin-top: 8px;
  display: block;
}

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

.thinking-indicator .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-tertiary);
  animation: dotPulse 1.4s ease-in-out infinite;
}

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

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

@keyframes dotPulse {
  0%, 60%, 100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  30% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Typewriter Effect */
.typewriter-cursor {
  display: inline-block;
  color: var(--accent-color);
  font-weight: bold;
  margin-left: 2px;
}

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

/* Input Area */
.input-area {
  border-top: 1px solid var(--border-color);
  padding: 20px 32px;
  background: var(--bg-primary);
}

.image-preview-container {
  margin-bottom: 12px;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: 8px;
}

.image-preview-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.image-preview-item img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
}

.image-preview-info {
  flex: 1;
}

.image-name {
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.remove-image-btn {
  background: none;
  border: none;
  color: #ef4444;
  font-size: 12px;
  cursor: pointer;
  padding: 0;
}

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

.attach-btn-inline {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
  color: var(--text-secondary);
  backdrop-filter: blur(10px);
}

.attach-btn-inline:hover {
  background: rgba(154, 106, 255, 0.1);
  border-color: var(--accent-color);
  color: var(--accent-color);
  transform: scale(1.02) translateY(-2px);
  box-shadow: 0 4px 20px rgba(154, 106, 255, 0.2);
}

.attach-btn-inline span {
  font-size: 24px;
}

.generate-image-btn {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
  color: var(--text-secondary);
  backdrop-filter: blur(10px);
}

.generate-image-btn:hover {
  background: rgba(154, 106, 255, 0.1);
  border-color: var(--accent-color);
  color: var(--accent-color);
  transform: scale(1.02) translateY(-2px);
  box-shadow: 0 4px 20px rgba(154, 106, 255, 0.2);
}

.generate-image-btn span {
  font-size: 24px;
}

/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  backdrop-filter: blur(4px);
}

.modal-content {
  background: var(--bg-primary);
  border-radius: 16px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

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

.modal-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s;
}

.modal-close:hover {
  background: var(--card-hover);
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.image-prompt-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  resize: none;
  outline: none;
  min-height: 120px;
  line-height: 1.5;
  background: var(--bg-primary);
  color: var(--text-primary);
  margin-bottom: 20px;
}

.image-prompt-input:focus {
  border-color: var(--accent-color);
}

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

.btn-primary, .btn-secondary {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

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

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--card-hover);
  color: var(--text-primary);
}

.message-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  resize: none;
  outline: none;
  max-height: 200px;
  min-height: 48px;
  line-height: 1.5;
  background: var(--bg-card);
  color: var(--text-primary);
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
}

.message-input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 20px rgba(154, 106, 255, 0.2);
}

.send-btn {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
  box-shadow: 0 4px 20px rgba(154, 106, 255, 0.3);
  position: relative;
  overflow: hidden;
}

.send-btn::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
  animation: rotate 3s linear infinite;
}

@keyframes rotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.send-btn:hover {
  background: linear-gradient(135deg, var(--accent-hover), var(--neon-blue));
  transform: scale(1.05) translateY(-2px);
  box-shadow: 0 8px 30px rgba(154, 106, 255, 0.5);
}

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

.send-btn span {
  font-size: 24px;
}

.input-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.input-actions {
  display: flex;
  gap: 16px;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: transparent;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

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

.action-btn span {
  font-size: 18px;
}

.char-counter {
  font-size: 12px;
  color: var(--text-tertiary);
}

.disclaimer {
  font-size: 11px;
  color: var(--text-tertiary);
  text-align: center;
  margin-top: 8px;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

/* Right Sidebar */
.right-sidebar {
  width: 320px;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex-shrink: 0;
  position: relative;
}

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

.projects-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

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

.projects-menu-btn:hover {
  background: var(--bg-primary);
  color: var(--text-primary);
}

.projects-menu-btn span {
  font-size: 20px;
}

.new-project-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 16px 20px;
  padding: 10px 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s;
}

.new-project-btn:hover {
  background: var(--card-hover);
  border-color: var(--accent-color);
  box-shadow: var(--shadow-sm);
}

.new-project-btn span {
  font-size: 20px;
}

.projects-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 20px;
}

.project-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  margin-bottom: 8px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.project-card:hover {
  background: var(--card-hover);
  border-color: var(--accent-color);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.project-info {
  flex: 1;
  min-width: 0;
}

.project-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-desc {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-radio {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  flex-shrink: 0;
  transition: all 0.2s;
}

.project-card:hover .project-radio {
  border-color: var(--accent-color);
}

.fab-button {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-color);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: all 0.2s;
  z-index: 10;
}

.fab-button:hover {
  background: var(--accent-hover);
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(99, 91, 255, 0.3);
}

.fab-button span {
  font-size: 24px;
}

/* Loading and Empty States */
.loading-projects,
.no-projects {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 14px;
}

.project-card.selected .project-radio {
  background: var(--accent-color);
  border-color: var(--accent-color);
}

.project-card.selected .project-radio::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: white;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.project-radio {
  position: relative;
}

/* Dark Theme Support */
body.dark-theme {
  /* Dark theme uses same futuristic neon colors */
  --bg-primary: #0E0E12;
  --bg-secondary: #11121A;
  --bg-sidebar: #11121A;
  --bg-card: rgba(17, 18, 26, 0.6);
  --text-primary: #F5F5F7;
  --text-secondary: #A0A0A8;
  --text-tertiary: #6B6B73;
  --border-color: rgba(154, 106, 255, 0.2);
  --accent-color: #9A6AFF;
  --accent-hover: #C77DFF;
  --active-bg: rgba(154, 106, 255, 0.15);
  --card-hover: rgba(154, 106, 255, 0.1);
}

body.dark-theme .search-input {
  background: var(--bg-secondary);
  border-color: var(--border-color);
}

body.dark-theme .message-input {
  background: var(--bg-secondary);
  border-color: var(--border-color);
}

/* Responsive */
@media (max-width: 1024px) {
  .left-sidebar {
    width: 240px;
  }
  
  .right-sidebar {
    width: 280px;
  }
  
  .suggested-cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .left-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 1000;
    transform: translateX(-100%);
    box-shadow: var(--shadow-md);
  }
  
  .left-sidebar:not(.collapsed) {
    transform: translateX(0);
  }
  
  .left-sidebar.collapsed {
    transform: translateX(-100%);
  }
  
  .sidebar-toggle {
    position: fixed;
    left: 16px;
    top: 16px;
    right: auto !important;
    background: var(--accent-color);
    border: none;
    z-index: 1001;
    box-shadow: var(--shadow-md);
  }
  
  .sidebar-toggle:hover {
    background: var(--accent-hover);
  }
  
  .sidebar-toggle span {
    color: white;
  }
  
  .left-sidebar:not(.collapsed) .sidebar-toggle {
    left: auto;
    right: 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
  }
  
  .left-sidebar:not(.collapsed) .sidebar-toggle span {
    color: var(--text-primary);
  }
  
  .main-content {
    width: 100% !important;
    max-width: 100% !important;
  }
  
  .left-sidebar:not(.collapsed) ~ .main-content {
    width: calc(100vw - 280px) !important;
    max-width: calc(100vw - 280px) !important;
  }
  
  .left-sidebar.collapsed ~ .main-content {
    width: 100vw !important;
    max-width: 100vw !important;
  }
  
  .main-header {
    padding: 16px 20px;
  }
  
  .chat-area {
    padding: 20px;
  }
  
  .input-area {
    padding: 16px 20px;
  }
  
  .welcome-title {
    font-size: 32px;
  }
  
  /* Overlay when sidebar is open on mobile */
  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
  }
  
  .left-sidebar:not(.collapsed) ~ .sidebar-overlay {
    display: block;
  }
}

/* ===========================================================
   Googa UI Refresh - Unified Light Theme (University of Zalingei)
   Uses only the approved palette variables
   =========================================================== */

/* Base */
body {
  background: var(--bg-light);
  color: var(--text-main);
}

.app-container {
  background: var(--bg-light);
}

/* Sidebar */
.left-sidebar {
  background: var(--bg-white);
  border-right: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.sidebar-toggle {
  background: var(--bg-white);
  border-color: var(--border-color);
  box-shadow: var(--shadow-sm);
}

.sidebar-toggle:hover {
  background: var(--secondary-color);
  border-color: var(--secondary-hover);
}

.sidebar-content {
  background: transparent;
}

.nav-item {
  color: var(--text-main);
  background: transparent;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.nav-item:hover {
  background: rgba(0, 104, 55, 0.06);
  color: var(--primary-color);
  border-color: var(--border-color);
}

.nav-item.active,
.nav-item:focus-visible {
  background: rgba(0, 104, 55, 0.12);
  border-color: rgba(0, 104, 55, 0.22);
  color: var(--primary-color);
}

.nav-section-header {
  color: var(--text-light);
}

/* Main */
.main-content {
  background: var(--bg-light);
}

.main-header {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.page-title {
  color: var(--text-main);
}

/* Cards & Containers */
.messages-container,
.message,
.input-area,
.modal-content {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-md);
}

.welcome-screen {
  background: transparent;
  border: none;
  box-shadow: none;
}

.chat-area {
  background: transparent;
}

.message.user-message {
  background: #fdfdfd;
  border-color: #eef1f2;
}

.message.bot-message {
  background: #ffffff;
}

.message-text {
  color: var(--text-main);
}

.message-avatar {
  background: var(--primary-color);
  color: #fff;
}

.thinking-indicator .dot {
  background: var(--primary-color);
}

/* Input & Buttons */
.input-wrapper {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-lg);
}

.message-input {
  background: transparent;
  color: var(--text-main);
}

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

.send-btn,
.generate-image-btn,
.attach-btn-inline {
  background: var(--primary-color);
  color: #fff;
  border: none;
  box-shadow: var(--shadow-sm);
}

.send-btn:hover,
.generate-image-btn:hover,
.attach-btn-inline:hover {
  background: var(--primary-hover);
  box-shadow: var(--shadow-hover);
}

.theme-btn {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-white);
  color: var(--text-main);
}

.theme-btn.active {
  background: rgba(0, 104, 55, 0.12);
  border-color: rgba(0, 104, 55, 0.2);
  color: var(--primary-color);
}

/* Suggested cards */
.suggest-card {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  color: var(--text-main);
}

.suggest-card:hover {
  background: rgba(0, 104, 55, 0.06);
  box-shadow: var(--shadow-hover);
}

.card-icon {
  background: rgba(0, 104, 55, 0.12);
  color: var(--primary-color);
}

/* Tables & Forms */
table {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

th,
td {
  color: var(--text-main);
  border-color: var(--border-color);
}

input,
textarea,
select {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  box-shadow: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(0, 104, 55, 0.5);
  box-shadow: 0 0 0 3px rgba(0, 104, 55, 0.12);
  outline: none;
}

button,
.btn,
.btn-primary {
  background: var(--primary-color);
  color: #fff;
  border: 1px solid var(--primary-color);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

button:hover,
.btn:hover,
.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  box-shadow: var(--shadow-hover);
}

.badge {
  background: rgba(0, 104, 55, 0.08);
  color: var(--primary-color);
  border-radius: 999px;
  padding: 4px 10px;
  border: 1px solid rgba(0, 104, 55, 0.15);
}

.alert {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  color: var(--text-main);
}

/* RTL helpers */
[dir="rtl"] .nav-item {
  text-align: right;
}

[dir="rtl"] .message-avatar {
  margin-left: 0;
  margin-right: 12px;
}
