/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #ffffff;
  --primary-dark: #ffffff;
  --secondary-color: #ffffff;
  --accent-color: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* Navigation */
.navbar {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 2rem;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand {
  font-size: 1.5rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
}

.logo-analyt {
  color: #222c3e; /* Dark gray blue for "Analyt" */
}

.logo-iq {
  color: #2569f4; /* Vivid blue for "IQ" */
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
  align-items: center;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
  padding: 0.5rem 0;
}

.nav-links a:hover {
  color: #2569f4;
}

.nav-links a.active {
  color: #2569f4;
  border-bottom: 2px solid #2569f4;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: auto;
  position: relative;
}

.user-menu-toggle {
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  color: var(--text-primary);
  cursor: pointer;
  font-size: 1.25rem;
  padding: 0.5rem 0.75rem;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
}

.user-menu-toggle:hover {
  background: var(--bg-card);
  border-color: var(--primary-color);
}

.profile-picture-btn {
  border-radius: 50% !important;
  padding: 0 !important;
  overflow: hidden;
  border: 2px solid var(--border-color) !important;
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
}

.profile-picture-btn:hover {
  border-color: var(--primary-color) !important;
  transform: scale(1.05);
}

.nav-profile-picture {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 1000;
  overflow: hidden;
}

.user-menu-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-menu-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.user-menu-header .user-name {
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
}

.user-menu-divider {
  height: 1px;
  background: var(--border-color);
  margin: 0.5rem 0;
}

.user-menu-item {
  width: 100%;
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.875rem;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: background-color 0.2s;
}

.user-menu-item:hover {
  background: var(--bg-secondary);
}

.user-menu-item span:first-child {
  font-size: 1rem;
}

@media (max-width: 768px) {
  .user-menu {
    flex-direction: column;
    align-items: flex-start;
    margin-left: 0;
    width: 100%;
  }
  
  .user-menu-dropdown {
    right: auto;
    left: 0;
  }
  
  .user-name {
    font-size: 0.875rem;
  }
}

.user-name {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.btn-login {
  padding: 0.5rem 1.5rem;
  background: var(--primary-color);
  color: white;
  border-radius: 0.5rem;
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.2s;
}

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

/* Login Page Styles */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  padding: 2rem;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 3rem;
  width: 100%;
  max-width: 450px;
  box-shadow: var(--shadow-lg);
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-header h1 {
  color: #2569f4;
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.login-header p {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.login-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
}

.login-tab {
  padding: 0.75rem 1.5rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.2s;
}

.login-tab:hover {
  color: var(--text-primary);
}

.login-tab.active {
  color: #2569f4;
  border-bottom-color: #2569f4;
}

.login-tab-content {
  display: none;
}

.login-tab-content.active {
  display: block;
}

.login-tab-content .form-group {
  margin-bottom: 1.5rem;
}

.login-tab-content .form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.875rem;
}

.login-tab-content .form-group input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 1rem;
}

.login-tab-content .form-group input:focus {
  outline: none;
  border-color: #2569f4;
  box-shadow: 0 0 0 3px rgba(37, 105, 244, 0.1);
}

.login-tab-content .form-group input::placeholder {
  color: var(--text-secondary);
}

.login-tab-content .form-group small {
  display: block;
  margin-top: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.btn-full {
  width: 100%;
  padding: 0.875rem;
  font-size: 1rem;
  margin-top: 1rem;
}

.error-message {
  margin-top: 1rem;
  padding: 0.75rem;
  background: #fee2e2;
  border: 1px solid #ef4444;
  border-radius: 0.5rem;
  color: #991b1b;
  font-size: 0.875rem;
}

.login-footer {
  margin-top: 2rem;
  text-align: center;
}

.login-footer p {
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-primary);
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  color: #2569f4;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

/* Buttons */
.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
}

.btn-primary {
  background-color: #2569f4;
  color: #1e293b;
}

.btn-primary:hover {
  background-color: #2569f4;
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

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

.btn-secondary:hover {
  background-color: #222c3e;
  border-color: #222c3e;
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1.1rem;
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.dashboard-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.dashboard-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: #222c3e;
}

.dashboard-card h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: #2569f4;
}

.dashboard-card canvas {
  max-height: 300px;
}

/* Modules Grid */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.module-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.module-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: #222c3e;
}

.module-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.module-header h2 {
  font-size: 1.25rem;
  margin: 0;
  color: var(--text-primary);
}

.module-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.module-badge.beginner {
  background-color: #dbeafe;
  color: #1e40af;
}

.module-badge.intermediate {
  background-color: #fef3c7;
  color: #92400e;
}

.module-badge.advanced {
  background-color: #fee2e2;
  color: #991b1b;
}

.module-description {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.module-progress {
  margin-bottom: 1rem;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background-color: var(--bg-secondary);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-fill {
  height: 100%;
  background-color: var(--primary-color);
  transition: width 0.3s;
}

.progress-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.module-details {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.module-details h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.module-details ul {
  list-style-position: inside;
  color: var(--text-secondary);
}

/* Practice Grid */
.practice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.practice-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.practice-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: #222c3e;
}

.practice-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.practice-header h2 {
  font-size: 1.25rem;
  margin: 0;
  color: var(--text-primary);
}

.difficulty-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.difficulty-badge.easy {
  background-color: #d1fae5;
  color: #065f46;
}

.difficulty-badge.medium {
  background-color: #fef3c7;
  color: #92400e;
}

.difficulty-badge.hard {
  background-color: #fee2e2;
  color: #991b1b;
}

.practice-description {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.practice-actions {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.solution {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.solution h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.solution pre {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  padding: 1rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  font-size: 0.875rem;
  color: #e2e8f0;
}

.solution code {
  font-family: 'Courier New', monospace;
}

/* Resources */
.search-bar {
  margin-bottom: 2rem;
}

.search-bar input {
  width: 100%;
  max-width: 500px;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  font-size: 1rem;
  background: var(--bg-card);
  color: var(--text-primary);
}

.search-bar input::placeholder {
  color: var(--text-secondary);
}

.resource-categories {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.category-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-secondary);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.875rem;
}

.category-btn:hover {
  background-color: #222c3e;
  color: var(--text-primary);
}

.category-btn.active {
  background-color: #2569f4;
  color: #1e293b;
  border-color: #2569f4;
}

.resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.resource-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.resource-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: #222c3e;
}

.resource-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.resource-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.resource-card p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.resource-link {
  color: #2569f4;
  text-decoration: none;
  font-weight: 500;
  display: inline-block;
}

.resource-link:hover {
  text-decoration: underline;
  color: #93c5fd;
}

/* Code Assistant - Full Page Layout */
.code-assistant-fullpage {
  display: flex;
  height: calc(100vh - 60px);
  width: 100%;
  position: relative;
  background: var(--bg-primary);
}

.code-assistant-fullpage.sidebar-open .chat-main-area {
  margin-left: 360px;
}

/* Collapsed Sidebar (Always Visible) */
.collapsed-sidebar {
  width: 60px;
  background: #222c3e;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 0;
  gap: 1rem;
  z-index: 11;
  height: 100%;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
}

.sidebar-logo-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.5rem;
  transition: all 0.2s;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-logo-toggle:hover {
  background: rgba(37, 105, 244, 0.2);
}

.sidebar-logo-toggle .logo-iq {
  font-size: 1.25rem;
  font-weight: 700;
  color: #2569f4;
}

.sidebar-new-conversation-btn.collapsed {
  width: 40px;
  height: 40px;
  border-radius: 0.5rem;
  font-size: 1.5rem;
  margin: 0;
  background: #2569f4;
  color: white;
}

.sidebar-new-conversation-btn.collapsed:hover {
  background: #1e5ae0;
}

/* Conversation History Sidebar */
.conversation-sidebar {
  width: 300px;
  background: #222c3e;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
  z-index: 10;
  position: absolute;
  left: 60px;
  height: 100%;
}

.conversation-sidebar.hidden {
  transform: translateX(-100%);
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h3 {
  margin: 0;
  font-size: 1rem;
  color: white;
}

.sidebar-header-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.sidebar-new-conversation-btn {
  background: #2569f4;
  color: white;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 1.25rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  line-height: 1;
  padding: 0;
}

.sidebar-new-conversation-btn:hover {
  background: #1e5ae0;
  transform: scale(1.1);
}

.sidebar-toggle {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  font-size: 1.25rem;
  padding: 0.25rem 0.5rem;
  transition: color 0.2s;
  border-radius: 0.25rem;
}

.sidebar-toggle:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-tabs {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: #222c3e;
}

.sidebar-tab {
  flex: 1;
  padding: 0.75rem 1rem;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.sidebar-tab:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-tab.active {
  color: #2569f4;
  border-bottom-color: #2569f4;
  background: rgba(37, 105, 244, 0.1);
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  background: #222c3e;
}

.conversation-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.conversation-item {
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.conversation-item:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(37, 105, 244, 0.5);
}

.conversation-item.active {
  background: rgba(37, 105, 244, 0.2);
  border-color: #2569f4;
  color: white;
}


.conversation-item-content {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.conversation-item-title {
  font-weight: 500;
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: white;
}

.conversation-item-date {
  font-size: 0.75rem;
  opacity: 0.7;
  color: rgba(255, 255, 255, 0.7);
}

.conversation-item-actions {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  flex-shrink: 0;
}

.conversation-action-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  transition: all 0.2s;
  opacity: 0.7;
  display: flex;
  align-items: center;
  justify-content: center;
}

.conversation-action-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.2);
}

.conversation-item.active .conversation-action-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.conversation-action-btn.delete-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  opacity: 1;
}

.conversation-action-btn.archive-btn:hover {
  background: rgba(16, 185, 129, 0.2);
  opacity: 1;
}

.no-conversations {
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
  padding: 2rem 1rem;
}

.sidebar-toggle-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.25rem;
  padding: 0.5rem;
  margin-right: 0.5rem;
  transition: color 0.2s;
}

.sidebar-toggle-btn:hover {
  color: var(--text-primary);
}

/* Main Chat Area */
.chat-main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  margin-left: 60px;
  transition: margin-left 0.3s ease;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

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

.chat-header h1 {
  margin: 0;
  font-size: 1.5rem;
}

/* Code Assistant - ChatGPT Style (Legacy - keeping for compatibility) */
.chat-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 120px);
  min-height: 600px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  margin-bottom: 1rem;
  flex-shrink: 0;
}

.chat-header h1 {
  margin: 0;
  font-size: 1.5rem;
}

.language-selector-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.language-selector-wrapper label {
  font-weight: 500;
  color: var(--text-secondary);
}

.header-controls {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.ai-provider-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ai-provider-wrapper label {
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.gemini-model-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.gemini-model-wrapper label {
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.gemini-model-wrapper select {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  background: var(--bg-primary);
  color: var(--text-primary);
  cursor: pointer;
}

.ai-provider-label {
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 0.875rem;
  padding: 0.5rem 0;
}

.ai-provider-wrapper select {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  background: var(--bg-primary);
  cursor: pointer;
  color: var(--text-primary);
}

.btn-api-settings {
  padding: 0.5rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-primary);
  transition: background-color 0.2s;
}

.btn-api-settings:hover {
  background: var(--border-color);
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.modal-content {
  background-color: var(--bg-card);
  margin: 5% auto;
  padding: 2rem;
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  position: relative;
}

.modal-close {
  color: var(--text-secondary);
  float: right;
  font-size: 2rem;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
}

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

.modal-content h2 {
  margin-top: 0;
  color: #2569f4;
}

.api-settings-form {
  margin-top: 1.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  font-weight: 500;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.875rem;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #2569f4;
  box-shadow: 0 0 0 3px rgba(37, 105, 244, 0.1);
}

.form-group small {
  display: block;
  margin-top: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 2rem;
}

/* Close modal when clicking outside */
.modal-content {
  animation: modalFadeIn 0.3s;
}

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

.design-selector-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.design-selector-wrapper label {
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.design-selector-wrapper select {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  background: var(--bg-primary);
  cursor: pointer;
}

.language-selector-wrapper select {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  background: var(--bg-primary);
  cursor: pointer;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  background: var(--bg-primary);
  min-height: 0;
  align-items: flex-start;
}

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

.chat-messages::-webkit-scrollbar-track {
  background: var(--bg-primary);
  border-radius: 4px;
}

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

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: #222c3e;
}

.message {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  border-radius: 0.75rem;
  animation: fadeIn 0.3s ease-in;
}

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

.user-message {
  background: #222c3e;
  color: white;
  max-width: 800px;
  width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
  margin-left: auto;
}

.assistant-message {
  background: #222c3e;
  border: 1px solid rgba(255, 255, 255, 0.1);
  max-width: 800px;
  width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
  color: white;
  margin-right: auto;
}

/* Ensure messages don't overflow */
.message-content {
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
  color: white;
}

.message-content {
  flex: 1;
  color: white;
}

.message-content p {
  margin: 0.25rem 0;
  line-height: 1.5;
  color: white;
}

.message-content ul, .message-content ol {
  margin: 0.5rem 0;
  padding-left: 1.5rem;
  color: white;
}

.message-content li {
  margin: 0.25rem 0;
  color: white;
}

.message-content pre {
  background: var(--bg-secondary);
  padding: 1rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin: 0.5rem 0;
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
  line-height: 1.5;
}

.message-content code {
  background: var(--bg-secondary);
  padding: 0.2rem 0.4rem;
  border-radius: 0.25rem;
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
}

.message-content pre code {
  background: none;
  padding: 0;
}

.message-content h3, .message-content h4 {
  margin: 1rem 0 0.5rem 0;
  color: white;
}

.message-content .error {
  color: #ef4444;
  background: #fee2e2;
  padding: 0.5rem;
  border-radius: 0.25rem;
  margin: 0.5rem 0;
}

.message-content .success {
  color: #059669;
  background: #d1fae5;
  padding: 0.5rem;
  border-radius: 0.25rem;
  margin: 0.5rem 0;
}

.message-content .warning {
  color: #d97706;
  background: #fef3c7;
  padding: 0.5rem;
  border-radius: 0.25rem;
  margin: 0.5rem 0;
}

/* Fixed Input Area at Bottom */
.chat-input-area-fixed {
  position: fixed;
  bottom: 0;
  left: 60px;
  right: 0;
  padding: 0.5rem 1rem;
  background: transparent;
  border-top: none;
  z-index: 100;
  box-shadow: none;
  display: flex;
  justify-content: center;
  transition: left 0.3s ease;
}

.code-assistant-fullpage.sidebar-open .chat-input-area-fixed {
  left: 360px;
}

.input-container-compact {
  width: 100%;
  max-width: 800px;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.chat-main-area {
  padding-bottom: 100px; /* Space for fixed input */
}

/* Sidebar adjustments handled by transform */

.input-actions-compact {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  background: transparent;
  border: none;
  padding: 0.5rem 0;
  width: 100%;
  max-width: 800px;
}

.oval-btn {
  flex: 1;
  padding: 0.5rem 1rem;
  background: #222c3e;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  color: white;
  cursor: pointer;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s;
  font-weight: 500;
  min-width: 0;
  position: relative;
}

.oval-btn:hover {
  background: #2a3548;
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.file-upload-oval-btn {
  position: relative;
}

.file-upload-oval-btn input[type="file"] {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  top: 0;
  left: 0;
}

.oval-select {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  appearance: none;
  border: none;
  background: transparent;
  z-index: 10;
}

.oval-btn span {
  pointer-events: none;
  z-index: 1;
  color: white;
}

.file-upload-chat-btn-compact input[type="file"] {
  display: none;
}

.icon-text {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.file-upload-chat-btn-compact:hover .icon-text,
.btn-clear-compact:hover .icon-text {
  color: var(--text-primary);
}

.btn-clear-compact {
  padding: 0.375rem 0.375rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: background-color 0.2s;
}

.btn-clear-compact:hover {
  background: var(--border-color);
}

.input-wrapper {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.chat-input-compact {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  font-family: system-ui, sans-serif;
  font-size: 0.8rem;
  resize: none;
  min-height: 40px;
  max-height: 120px;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  box-sizing: border-box;
  text-align: left;
  overflow-y: auto;
}

.chat-input-compact:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.1);
}

.btn-send-compact {
  padding: 0.25rem 0.75rem;
  background: #222c3e;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  height: 100%;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
}

.btn-send-compact:hover {
  background: #2a3548;
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-send-compact:disabled {
  background: var(--text-secondary);
  cursor: not-allowed;
}

.btn-visualize-compact {
  padding: 0.375rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: background-color 0.2s;
}

.btn-visualize-compact:hover {
  background: var(--border-color);
}

/* Visualize Modal */
.visualize-modal-content {
  max-width: 90vw;
  width: 1000px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.visualize-controls {
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0;
}

.btn-run-code {
  padding: 0.5rem 1rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color 0.2s;
}

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

.btn-clear-viz {
  padding: 0.5rem 1rem;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
  transition: background-color 0.2s;
}

.btn-clear-viz:hover {
  background: var(--border-color);
}

.visualize-output {
  flex: 1;
  min-height: 400px;
  max-height: 70vh;
  overflow-y: auto;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 1rem;
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
}

.visualize-output canvas {
  max-width: 100%;
  margin: 1rem 0;
}

.visualize-output img {
  max-width: 100%;
  margin: 1rem 0;
}

.visualize-output pre {
  background: var(--bg-secondary);
  padding: 1rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin: 0.5rem 0;
}

.visualize-output .error {
  color: #ef4444;
  background: #fee2e2;
  padding: 0.75rem;
  border-radius: 0.5rem;
  margin: 0.5rem 0;
}

.visualize-output .success {
  color: #059669;
  background: #d1fae5;
  padding: 0.75rem;
  border-radius: 0.5rem;
  margin: 0.5rem 0;
}

/* Legacy styles for compatibility */
.chat-input-area {
  padding: 1.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex-shrink: 0;
}

.input-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.file-upload-chat-btn {
  padding: 0.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  transition: background-color 0.2s;
}

.file-upload-chat-btn:hover {
  background: var(--border-color);
}

.file-upload-chat-btn input[type="file"] {
  display: none;
}

.btn-clear {
  padding: 0.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 1.25rem;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.btn-clear:hover {
  background: var(--border-color);
}

.chat-input {
  width: 100%;
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  font-family: system-ui, sans-serif;
  font-size: 1rem;
  resize: none;
  min-height: 60px;
  max-height: 200px;
}

.chat-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 105, 244, 0.1);
}

.btn-send {
  align-self: flex-end;
  padding: 0.75rem 2rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 0.75rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

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

.btn-send:disabled {
  background: var(--text-secondary);
  cursor: not-allowed;
}

.visualization-container {
  margin: 1rem 0;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 0.5rem;
}

.visualization-container canvas {
  max-height: 400px;
}


.code-block-container {
  margin: 0.5rem 0;
  position: relative;
}

.code-block {
  background: #f8fafc;
  color: var(--text-primary);
  padding: 1rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
  line-height: 1.6;
  white-space: pre;
  margin: 0;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.code-block-footer {
  padding: 0.5rem 1rem;
  background: var(--bg-secondary);
  border-bottom-left-radius: 0.5rem;
  border-bottom-right-radius: 0.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.code-block-footer small {
  color: var(--text-secondary);
  font-size: 0.75rem;
  flex: 1;
}

.btn-copy-code-footer {
  padding: 0.25rem 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-copy-code-footer:hover {
  background: var(--border-color);
  border-color: var(--primary-color);
}

.code-block code {
  background: transparent;
  padding: 0;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  white-space: pre;
  display: block;
}

.loading-indicator {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.5rem;
}

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

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

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

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

.input-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.input-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.input-panel h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: #2569f4;
}

.input-panel textarea {
  width: 100%;
  min-height: 200px;
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
  resize: vertical;
  background: #ffffff;
  color: var(--text-primary);
}

.input-panel textarea::placeholder {
  color: var(--text-secondary);
}

.code-editor {
  min-height: 300px;
  font-family: 'Courier New', monospace;
  line-height: 1.6;
}

.code-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.code-editor-header h2 {
  margin: 0;
}

.editor-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.editor-controls select {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  background: var(--bg-primary);
}

.file-upload-btn-small {
  padding: 0.5rem 1rem;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  cursor: pointer;
  display: inline-block;
  transition: background-color 0.2s;
  font-size: 0.875rem;
}

.file-upload-btn-small:hover {
  background-color: var(--border-color);
}

.file-upload-btn-small input[type="file"] {
  display: none;
}

.action-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
}

.action-buttons .btn {
  white-space: nowrap;
  font-size: 0.875rem;
  padding: 0.75rem 1rem;
}

.code-description {
  width: 100%;
  min-height: 120px;
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  font-family: system-ui, sans-serif;
  font-size: 0.875rem;
  resize: vertical;
  margin-bottom: 1rem;
}

.btn-generate {
  width: 100%;
  padding: 1rem;
  font-size: 1rem;
  font-weight: 600;
}

.data-input-options {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.file-upload-btn {
  padding: 0.75rem 1.5rem;
  background-color: var(--primary-color);
  color: white;
  border-radius: 0.5rem;
  cursor: pointer;
  display: inline-block;
  transition: background-color 0.2s;
}

.file-upload-btn:hover {
  background-color: var(--primary-dark);
}

.file-upload-btn input[type="file"] {
  display: none;
}

.or-text {
  color: var(--text-secondary);
}

.data-preview {
  margin-top: 1rem;
  padding: 1rem;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  max-height: 200px;
  overflow-y: auto;
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.output-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.output-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.tab-btn {
  padding: 0.75rem 1.5rem;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.2s;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.tab-content h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: #2569f4;
}

.insights-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.insight-card {
  background: var(--bg-secondary);
  padding: 1rem;
  border-radius: 0.5rem;
  border-left: 4px solid var(--primary-color);
}

.insight-card h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: #2569f4;
}

.insight-card p {
  color: var(--text-secondary);
  margin: 0;
}

.chart-controls {
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.chart-controls label {
  font-weight: 500;
}

.chart-controls select {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  font-size: 1rem;
  background: var(--bg-card);
  color: var(--text-primary);
}

.chart-container {
  position: relative;
  height: 400px;
  margin-top: 1rem;
}

.chart-container canvas {
  max-height: 400px;
}

.results-container {
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
  background: #ffffff;
  border: 1px solid var(--border-color);
  padding: 1rem;
  border-radius: 0.5rem;
  max-height: 500px;
  overflow-y: auto;
  color: var(--text-primary);
}

.placeholder-text {
  color: var(--text-secondary);
  font-style: italic;
  text-align: center;
  padding: 2rem;
}

.assistance-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 600px;
  overflow-y: auto;
}

.assistance-card {
  background: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: 0.5rem;
  border-left: 4px solid var(--primary-color);
}

.assistance-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.assistance-card .code-block {
  background: var(--bg-primary);
  padding: 1rem;
  border-radius: 0.5rem;
  margin-top: 0.75rem;
  border: 1px solid var(--border-color);
  overflow-x: auto;
}

.assistance-card pre {
  margin: 0;
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
  line-height: 1.6;
}

.assistance-card code {
  font-family: 'Courier New', monospace;
}

.assistance-card ul, .assistance-card ol {
  margin: 0.5rem 0;
  padding-left: 1.5rem;
}

.assistance-card li {
  margin: 0.25rem 0;
  color: var(--text-secondary);
}

.suggestion-item {
  padding: 0.75rem;
  background: var(--bg-primary);
  border-radius: 0.25rem;
  margin: 0.5rem 0;
  border-left: 3px solid var(--secondary-color);
}

.suggestion-item strong {
  color: var(--text-primary);
}

.warning-item {
  border-left-color: #f59e0b;
  background: #fef3c7;
}

.error-item {
  border-left-color: #ef4444;
  background: #fee2e2;
}

.success-item {
  border-left-color: var(--secondary-color);
  background: #d1fae5;
}

/* Home Page */
.home-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: stretch;
  margin-top: 2rem;
}

.home-content-left {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
}

.home-content-right {
  display: flex;
  align-items: stretch;
  min-width: 0;
  max-width: 100%;
}

.hero-section {
  text-align: left;
  padding: 0;
  background: transparent;
  color: var(--text-primary);
  border-radius: 0;
  margin-bottom: 0;
  border: none;
}

.hero-section h1 {
  color: var(--text-primary);
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  text-align: left;
}

.hero-section p {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 100%;
  margin: 0;
  text-align: left;
}

/* Code Animation Container */
.code-animation-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
  box-sizing: border-box;
}

.code-animation-header {
  background: var(--bg-secondary);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.code-animation-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--border-color);
}

.code-animation-dot:nth-child(1) {
  background: #ef4444;
}

.code-animation-dot:nth-child(2) {
  background: #f59e0b;
}

.code-animation-dot:nth-child(3) {
  background: #10b981;
}

.code-animation-filename {
  margin-left: auto;
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-family: 'Courier New', monospace;
}

.code-animation-content {
  padding: 1.5rem;
  background: #222c3e;
  flex: 1;
  overflow: hidden;
  border-radius: 0 0 0.75rem 0.75rem;
  min-height: 0;
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

.code-animation-content pre {
  margin: 0;
  padding: 0;
  background: transparent !important;
  color: #e2e8f0;
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.code-animation-content .code-line {
  color: #e2e8f0;
  display: block;
  background: transparent !important;
  margin: 0;
  padding: 0;
}

.code-animation-content .code-line * {
  background: transparent !important;
}

.code-animation-content .cursor {
  animation: blink 1s infinite;
  color: #2569f4;
  margin-left: 2px;
}

/* Syntax highlighting colors */
.code-animation-content .keyword {
  color: #c792ea; /* Purple for keywords */
  background: transparent !important;
}

.code-animation-content .string {
  color: #c3e88d; /* Green for strings */
  background: transparent !important;
}

.code-animation-content .comment {
  color: #546e7a; /* Gray for comments */
  background: transparent !important;
}

.code-animation-content .function {
  color: #82aaff; /* Blue for functions */
  background: transparent !important;
}

.code-animation-content .number {
  color: #f78c6c; /* Orange for numbers */
  background: transparent !important;
}

.code-animation-content .operator {
  color: #89ddff; /* Cyan for operators */
  background: transparent !important;
}

.code-animation-content .bracket {
  color: #ffcb6b; /* Yellow for brackets */
  background: transparent !important;
}

.code-animation-content .variable {
  color: #eeffff; /* White for variables */
  background: transparent !important;
}

.code-animation-content span {
  background: transparent !important;
}

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

/* Responsive */
@media (max-width: 1024px) {
  .home-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .home-content-right {
    position: relative;
    top: 0;
  }
  
  .hero-section {
    text-align: center;
  }
  
  .hero-section h1,
  .hero-section p {
    text-align: center;
  }
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 2rem;
  border-radius: 0.75rem;
  box-shadow: var(--shadow);
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: #222c3e;
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.feature-card h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.feature-card p {
  color: var(--text-secondary);
}

.quick-links {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.quick-link-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 1.5rem;
  border-radius: 0.75rem;
  box-shadow: var(--shadow);
  text-align: center;
  text-decoration: none;
  color: var(--text-primary);
  transition: transform 0.2s, box-shadow 0.2s;
}

.quick-link-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: #222c3e;
  color: #2569f4;
}

.quick-link-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

/* Page Navigation Grid */
.page-navigation-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.page-nav-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1rem;
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: row;
  align-items: center;
  text-align: left;
  box-shadow: var(--shadow);
  gap: 1rem;
}

.page-nav-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: #2569f4;
}

.page-nav-icon {
  font-size: 2rem;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.page-nav-card h2 {
  font-size: 1.125rem;
  margin: 0 0.75rem 0 0;
  color: #2569f4;
  font-weight: 600;
  flex-shrink: 0;
  white-space: nowrap;
}

.page-nav-card p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.4;
  margin: 0;
  flex: 1;
  text-align: left;
}

/* Responsive Design */
@media (max-width: 768px) {
  .page-navigation-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  
  @media (max-width: 600px) {
    .page-navigation-grid {
      grid-template-columns: 1fr;
    }
  }
  
  .page-nav-card {
    padding: 1.5rem;
  }
  
  .page-nav-icon {
    font-size: 3rem;
  }
  
  .hero-section h1 {
    font-size: 2rem;
  }
  
  .hero-section p {
    font-size: 1rem;
  }
  
  .chat-container {
    height: calc(100vh - 100px);
    padding: 1rem;
  }
  
  .chat-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
  }
  
  .user-message,
  .assistant-message {
    max-width: 100%;
  }
  
  .chat-input-area {
    padding: 1rem;
  }
  
  .input-actions {
    margin-bottom: 0.5rem;
  }
  
  .chat-messages {
    padding: 1rem;
  }
  
  .conversation-starters {
    padding: 1rem;
  }
  
  .starter-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  @media (max-width: 480px) {
    .starter-grid {
      grid-template-columns: 1fr;
    }
  }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    flex-direction: column;
    padding: 1rem;
    box-shadow: var(--shadow-lg);
  }

  .nav-links.active {
    display: flex;
  }

  .mobile-menu-toggle {
    display: block;
  }

  .code-assistant-layout {
    grid-template-columns: 1fr;
  }

  .dashboard-grid,
  .modules-grid,
  .practice-grid,
  .resources-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 2rem;
  }

  .hero-section h1 {
    font-size: 2rem;
  }
}

/* ============================================
   DESIGN VARIATIONS
   ============================================ */

/* DESIGN 1: Modern Glassmorphism */
.chat-container.design1 {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 2rem;
  border-radius: 1.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.chat-container.design1 .chat-messages {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.chat-container.design1 .chat-header {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  padding: 1.5rem;
  border-radius: 1rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.chat-container.design1 .chat-header h1 {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

.chat-container.design1 .user-message {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  border: none;
}

.chat-container.design1 .assistant-message {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.chat-container.design1 .chat-input-area {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 1.5rem;
  border-radius: 1rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  margin-top: 1rem;
}

.chat-container.design1 .chat-input {
  background: rgba(255, 255, 255, 0.8);
  border: 2px solid rgba(102, 126, 234, 0.2);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.chat-container.design1 .chat-input:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
  background: white;
}

.chat-container.design1 .btn-send {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  border: none;
}

.chat-container.design1 .btn-send:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.chat-container.design1 .file-upload-chat-btn,
.chat-container.design1 .btn-clear {
  background: rgba(102, 126, 234, 0.1);
  border: 1px solid rgba(102, 126, 234, 0.3);
  color: #667eea;
}

.chat-container.design1 .file-upload-chat-btn:hover,
.chat-container.design1 .btn-clear:hover {
  background: rgba(102, 126, 234, 0.2);
}

/* DESIGN 2: Clean Minimal with Accents */
.chat-container.design2 {
  background: #f8fafc;
  padding: 2rem;
  border-radius: 1rem;
}

.chat-container.design2 .chat-messages {
  background: white;
  border-radius: 0.75rem;
  padding: 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  border: 1px solid #e2e8f0;
}

.chat-container.design2 .chat-header {
  background: white;
  padding: 1.5rem 2rem;
  border-radius: 0.75rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  border: 1px solid #e2e8f0;
}

.chat-container.design2 .chat-header h1 {
  color: #1e293b;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.chat-container.design2 .user-message {
  background: #2569f4;
  color: white;
  box-shadow: 0 2px 8px rgba(37, 105, 244, 0.2);
  border: none;
  padding: 1.25rem 1.5rem;
}

.chat-container.design2 .assistant-message {
  background: white;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  padding: 1.25rem 1.5rem;
}

.chat-container.design2 .chat-input-area {
  background: white;
  padding: 1.5rem;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  border: 1px solid #e2e8f0;
  margin-top: 1rem;
}

.chat-container.design2 .chat-input {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  font-size: 0.9375rem;
}

.chat-container.design2 .chat-input:focus {
  border-color: #2569f4;
  background: white;
  box-shadow: 0 0 0 3px rgba(37, 105, 244, 0.1);
}

.chat-container.design2 .btn-send {
  background: #2569f4;
  box-shadow: 0 2px 8px rgba(37, 105, 244, 0.3);
  font-weight: 500;
}

.chat-container.design2 .btn-send:hover {
  background: #2569f4;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 105, 244, 0.4);
}

.chat-container.design2 .file-upload-chat-btn,
.chat-container.design2 .btn-clear {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #222c3e;
}

.chat-container.design2 .file-upload-chat-btn:hover,
.chat-container.design2 .btn-clear:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.chat-container.design2 .message-content h3,
.chat-container.design2 .message-content h4 {
  color: #2569f4;
}

/* DESIGN 3: Dark Professional */
.chat-container.design3 {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
}

.chat-container.design3 .chat-messages {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
}

.chat-container.design3 .chat-header {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
}

.chat-container.design3 .chat-header h1 {
  color: #2569f4;
  font-weight: 600;
}

.chat-container.design3 .user-message {
  background: linear-gradient(135deg, #2569f4 0%, #8b5cf6 100%);
  color: white;
  box-shadow: 0 4px 20px rgba(37, 105, 244, 0.3);
  border: none;
}

.chat-container.design3 .assistant-message {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.chat-container.design3 .assistant-message .message-content {
  color: var(--text-primary);
}

.chat-container.design3 .chat-input-area {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
}

.chat-container.design3 .chat-input {
  background: var(--bg-primary);
  border: 2px solid var(--border-color);
  color: var(--text-primary);
}

.chat-container.design3 .chat-input:focus {
  border-color: #2569f4;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 105, 244, 0.2);
}

.chat-container.design3 .chat-input::placeholder {
  color: #64748b;
}

.chat-container.design3 .btn-send {
  background: linear-gradient(135deg, #2569f4 0%, #8b5cf6 100%);
  box-shadow: 0 4px 15px rgba(37, 105, 244, 0.3);
}

.chat-container.design3 .btn-send:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 105, 244, 0.4);
}

.chat-container.design3 .file-upload-chat-btn,
.chat-container.design3 .btn-clear {
  background: #222c3e;
  border: 1px solid #222c3e;
  color: #94a3b8;
}

.chat-container.design3 .file-upload-chat-btn:hover,
.chat-container.design3 .btn-clear:hover {
  background: #222c3e;
  color: #e2e8f0;
}

.chat-container.design3 .message-content h3,
.chat-container.design3 .message-content h4 {
  color: #2569f4;
}

.chat-container.design3 .message-content pre {
  background: #ffffff;
  border: 1px solid #222c3e;
  color: #e2e8f0;
}

.chat-container.design3 .code-block {
  background: #ffffff;
  border: 1px solid #222c3e;
  color: #e2e8f0;
}

.chat-container.design3 .code-block-header {
  background: #ffffff;
  border-bottom: 1px solid #222c3e;
  color: #94a3b8;
}

/* Welcome Section - Connected */
.welcome-section {
  background: #222c3e;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  padding: 2rem;
  margin-bottom: 1rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.welcome-message {
  margin-bottom: 1.5rem;
}

.welcome-message p {
  color: white;
  font-size: 1.1rem;
  margin: 0;
  text-align: center;
}

.conversation-starters {
  margin-top: 1.5rem;
}

.conversation-starters h3 {
  color: #2569f4;
  font-size: 1rem;
  margin-bottom: 1rem;
  font-weight: 600;
  text-align: center;
}

.starter-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  width: 100%;
}

.starter-btn {
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  color: var(--text-primary);
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
  font-family: system-ui, sans-serif;
}

.starter-btn:hover {
  background: #222c3e;
  border-color: #222c3e;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Profile Management Page */
.profile-container {
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 2rem;
}

.profile-container h1 {
  color: var(--text-primary);
  margin-bottom: 2rem;
  font-size: 2rem;
}

.profile-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.profile-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 2rem;
}

.profile-section h2 {
  color: var(--text-primary);
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.75rem;
}

/* Profile Picture Section */
.profile-picture-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.profile-picture-container {
  position: relative;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--border-color);
  cursor: pointer;
  transition: all 0.3s;
}

.profile-picture-container:hover {
  border-color: var(--primary-color);
  transform: scale(1.05);
}

.profile-picture {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-picture-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}

.profile-picture-container:hover .profile-picture-overlay {
  opacity: 1;
}

.profile-picture-upload-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: white;
  cursor: pointer;
  font-size: 0.875rem;
}

.profile-picture-upload-btn span:first-child {
  font-size: 1.5rem;
}

.profile-picture-hint {
  color: var(--text-secondary);
  font-size: 0.875rem;
  text-align: center;
}

/* Profile Forms */
.profile-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
}

.form-input,
.form-textarea {
  padding: 0.75rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(37, 105, 244, 0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.form-hint {
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.btn-primary {
  padding: 0.75rem 1.5rem;
  background: #2569f4;
  color: #1e293b;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
  align-self: flex-start;
}

.btn-primary:hover {
  background: #2569f4;
}

.btn-secondary {
  padding: 0.75rem 1.5rem;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  align-self: flex-start;
}

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

/* Settings List */
.settings-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
}

.setting-info h3 {
  color: var(--text-primary);
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.setting-info p {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border-color);
  transition: 0.3s;
  border-radius: 26px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: #2569f4;
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(24px);
}

/* Danger Zone */
.profile-section.danger-zone {
  border-color: #ef4444;
}

.danger-zone-warning {
  color: #fca5a5;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.danger-actions {
  display: flex;
  gap: 1rem;
}

.btn-danger {
  padding: 0.75rem 1.5rem;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-danger:hover {
  background: #dc2626;
}

/* Notifications */
.notification {
  position: fixed;
  top: 80px;
  right: 2rem;
  padding: 1rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  box-shadow: var(--shadow-lg);
  z-index: 10000;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
  max-width: 400px;
}

.notification.show {
  opacity: 1;
  transform: translateX(0);
}

.notification-success {
  border-left: 4px solid var(--secondary-color);
  color: var(--text-primary);
}

.notification-error {
  border-left: 4px solid #ef4444;
  color: var(--text-primary);
}

/* Email Notification */
.email-notification {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: var(--bg-card);
  border: 2px solid var(--primary-color);
  border-radius: 1rem;
  box-shadow: var(--shadow-lg);
  z-index: 10001;
  opacity: 0;
  transition: all 0.3s ease;
  max-width: 500px;
  width: 90%;
  padding: 2rem;
}

.email-notification.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.email-notification-content {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
}

.email-notification-icon {
  font-size: 3rem;
  flex-shrink: 0;
}

.email-notification-text {
  flex: 1;
}

.email-notification-text strong {
  color: var(--text-primary);
  font-size: 1.25rem;
  display: block;
  margin-bottom: 0.5rem;
}

.email-notification-text p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin: 0;
  line-height: 1.5;
}

.email-notification-text p strong {
  color: var(--primary-color);
  font-size: 0.875rem;
  display: inline;
  margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  .profile-container {
    padding: 0 1rem;
    margin: 1rem auto;
  }

  .profile-section {
    padding: 1.5rem;
  }

  .profile-picture-container {
    width: 120px;
    height: 120px;
  }

  .setting-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .notification {
    right: 1rem;
    left: 1rem;
    max-width: none;
  }
}

.starter-btn:active {
  transform: translateY(0);
}

/* White theme specific for starters */
.chat-container.design3 .starter-btn {
  background: var(--bg-card);
  border-color: var(--border-color);
  color: var(--text-primary);
}

.chat-container.design3 .starter-btn:hover {
  background: var(--bg-secondary);
  border-color: var(--border-color);
  color: var(--text-primary);
}

.chat-container.design3 .btn-copy-code {
  background: #2569f4;
  color: white;
}

.chat-container.design3 .btn-copy-code:hover {
  background: #2569f4;
}

/* Apply white theme to all pages */
body {
  background: #ffffff !important;
  color: var(--text-primary);
}

/* Ensure all text is readable */
p, li, span, div {
  color: var(--text-primary);
}

/* Code blocks */
pre, code {
  background: #f8fafc !important;
  color: var(--text-primary) !important;
}

/* Select elements */
select {
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}

/* Input fields */
input[type="text"], input[type="search"], textarea {
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}

/* Dark Mode Styles */
body.dark-mode,
html[data-theme="dark"] {
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #1e293b;
  --border-color: #334155;
  background-color: var(--bg-primary) !important;
  color: var(--text-primary) !important;
}

body.dark-mode .navbar,
html[data-theme="dark"] .navbar {
  background-color: var(--bg-secondary) !important;
  border-bottom-color: var(--border-color) !important;
}

body.dark-mode .profile-section,
html[data-theme="dark"] .profile-section {
  background: var(--bg-card) !important;
  border-color: var(--border-color) !important;
  color: var(--text-primary) !important;
}

body.dark-mode .form-input,
body.dark-mode .form-textarea,
body.dark-mode select,
html[data-theme="dark"] .form-input,
html[data-theme="dark"] .form-textarea,
html[data-theme="dark"] select {
  background: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}

body.dark-mode .toggle-switch input:checked + .toggle-slider,
html[data-theme="dark"] .toggle-switch input:checked + .toggle-slider {
  background-color: #2569f4 !important;
}

body.dark-mode .toggle-switch input:checked + .toggle-slider:before,
html[data-theme="dark"] .toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(20px) !important;
}

input[type="text"]::placeholder, input[type="search"]::placeholder, textarea::placeholder {
  color: var(--text-secondary) !important;
}

