/* ICYL Crisis - Mobile CSS Styles */
/* shadcn/ui Zinc Theme (https://ui.shadcn.com/docs/theming) */

/* Root Variables - shadcn/ui "Zinc" base with purple primary */
:root {
  /* === shadcn/ui Core Palette (Zinc) === */
  --background: #ffffff;
  --foreground: #18181b;        /* zinc-950 */
  --card: #ffffff;
  --card-foreground: #18181b;
  --popover: #ffffff;
  --popover-foreground: #18181b;
  
  /* Primary: Your purple, shadcn style */
  --primary-color: #7c3aed;     /* violet-600 */
  --primary-dark: #6d28d9;      /* violet-700 */
  --primary-foreground: #fafafa;
  
  /* Secondary */
  --secondary-color: #71717a;   /* zinc-500 */
  --secondary: #f4f4f5;         /* zinc-100 */
  --secondary-foreground: #18181b;
  
  /* Muted */
  --muted: #f4f4f5;             /* zinc-100 */
  --muted-foreground: #71717a;  /* zinc-500 */
  
  /* Accent */
  --accent: #f4f4f5;
  --accent-foreground: #18181b;
  
  /* Semantic */
  --success-color: #22c55e;     /* green-500 */
  --warning-color: #f59e0b;     /* amber-500 */
  --error-color: #ef4444;       /* red-500 */
  --destructive: #ef4444;
  --destructive-foreground: #fafafa;
  
  /* Surfaces */
  --bg-primary: #ffffff;
  --bg-secondary: #fafafa;      /* zinc-50 */
  --bg-tertiary: #f4f4f5;       /* zinc-100 */
  
  /* Text */
  --text-primary: #18181b;      /* zinc-950 */
  --text-secondary: #71717a;    /* zinc-500 */
  --text-light: #a1a1aa;        /* zinc-400 */
  
  /* Border & Ring */
  --border-color: #e4e4e7;      /* zinc-200 */
  --input: #e4e4e7;
  --ring: #a1a1aa;              /* zinc-400 */
  
  /* === shadcn/ui Geometry === */
  --radius: 0.5rem;             /* 8px - shadcn default */
  --border-radius: 0.5rem;
  --shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-lg: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --transition: all 0.15s ease;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-secondary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

/* ===== SIGNIN PAGE (shadcn/ui style) ===== */
.signin-page {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background-color: var(--bg-secondary);  /* Solid, no gradient */
}

.signin-container {
  width: 100%;
  max-width: 400px;
  background-color: var(--card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
}

/* === shadcn/ui Logo & Title === */
.logo-section {
  text-align: center;
  margin-bottom: 1.5rem;
}

.logo {
  display: inline-flex;
  width: 48px;
  height: 48px;
  background-color: var(--foreground);
  border-radius: var(--radius);
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem;
}

.logo i {
  font-size: 1.5rem;
  color: var(--background);
}

.signin-container h1 {
  color: var(--foreground);
  font-size: 1.5rem;           /* text-2xl */
  font-weight: 600;            /* semibold */
  letter-spacing: -0.025em;    /* tracking-tight */
  margin-bottom: 0.25rem;
}

.subtitle {
  color: var(--muted-foreground);
  font-size: 0.875rem;         /* text-sm */
  margin-bottom: 0;
}

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

.signin-option {
  margin-bottom: 1.5rem;
}

.signin-option h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

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

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

.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrapper .form-input {
  padding-right: 40px;
}

.toggle-password {
  position: absolute;
  right: 12px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 1rem;
  z-index: 2;
}

.toggle-password:hover {
  color: var(--primary-color);
}

/* === shadcn/ui Input Styles === */
.form-input {
  width: 100%;
  height: 2.5rem;                /* h-10 */
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--input);
  border-radius: var(--radius);
  font-size: 0.875rem;           /* text-sm */
  line-height: 1.5;
  transition: var(--transition);
  background-color: transparent;
  color: var(--foreground);
}

.form-input::placeholder {
  color: var(--muted-foreground);
}

.form-input:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 2px var(--background), 0 0 0 4px var(--ring);
}

.form-input:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* === shadcn/ui Button Styles === */
.btn {
  width: 100%;
  padding: 0.5rem 1rem;
  height: 2.5rem;                /* h-10 */
  border: none;
  border-radius: var(--radius);
  font-size: 0.875rem;           /* text-sm */
  font-weight: 500;              /* medium, not bold */
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}

.btn:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.btn:disabled {
  pointer-events: none;
  opacity: 0.5;
}

/* Primary: Solid dark background (shadcn default) */
.btn-primary {
  background-color: var(--primary-color);
  color: var(--primary-foreground);
  box-shadow: var(--shadow);
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--primary-dark);
  /* No transform - shadcn buttons don't lift */
}

/* Secondary: Light background, dark text */
.btn-secondary {
  background-color: var(--secondary);
  color: var(--secondary-foreground);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
  background-color: var(--accent);
}

.divider {
  text-align: center;
  margin: 1.5rem 0;
  position: relative;
}

.divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border-color);
}

.divider span {
  background: var(--bg-primary);
  padding: 0 1rem;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
}

/* === shadcn/ui Alert/Status Messages === */
.status-message {
  margin-top: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  text-align: center;
  display: none;
  border: 1px solid;
}

.status-message.success {
  background-color: #f0fdf4;       /* green-50 */
  border-color: #bbf7d0;           /* green-200 */
  color: #166534;                  /* green-800 */
  display: block;
}

.status-message.error {
  background-color: #fef2f2;       /* red-50 */
  border-color: #fecaca;           /* red-200 */
  color: #991b1b;                  /* red-800 */
  display: block;
}

.status-message.info {
  background-color: var(--muted);
  border-color: var(--border-color);
  color: var(--foreground);
  display: block;
}

/* ===== CHATROOM PAGE ===== */
.chatroom-page {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
}

/* === shadcn/ui Header === */
.chat-header {
  background-color: var(--card);
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-content h2 {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin: 0;
  color: var(--foreground);
}

.connection-indicator {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--error-color);
}

.status-dot.connected {
  background: var(--success-color);
}

.status-dot.connecting {
  background-color: var(--warning-color);
}

.status-dot.error {
  background: var(--error-color);
}

.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.messages-area {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  padding-bottom: 180px; /* Increased space for fixed input container + nav bar + any additional UI */
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.welcome-message {
  text-align: center;
  margin: 2rem 0;
}

.system-message {
  background: var(--bg-primary);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  color: var(--text-secondary);
}

.system-message i {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.system-message p {
  margin-bottom: 0.5rem;
}

.system-message .small {
  font-size: 0.8rem;
  margin-bottom: 0;
}

/* === shadcn/ui Message Bubbles === */
.message {
  max-width: 80%;
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  position: relative;
  word-wrap: break-word;
  font-size: 0.875rem;
  line-height: 1.5;
}

.message.sent {
  background-color: var(--primary-color);
  color: var(--primary-foreground);
  align-self: flex-end;
  margin-left: auto;
}

.message.received {
  background-color: var(--muted);
  color: var(--foreground);
  align-self: flex-start;
}

/* Admin message styling with purple outline */
.message.admin-message {
  border: 2px solid #8b5cf6 !important;
  box-shadow: 0 0 8px rgba(139, 92, 246, 0.3);
}

.message-sender-name {
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.message-separator {
  height: 1px;
  background: var(--border-color);
  margin-bottom: 0.5rem;
}

.message-text {
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.message-input-container {
  padding: 1rem;
  background: var(--bg-primary);
  border-top: 1px solid var(--border-color);
  position: fixed;
  bottom: 70px; /* Height of bottom nav bar */
  left: 0;
  right: 0;
  z-index: 11; /* Above bottom nav */
}

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

.message-input input,
.message-input textarea {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: 25px;
  font-size: 1rem;
  background: var(--bg-secondary);
  transition: var(--transition);
}

.message-input input:focus,
.message-input textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  background: var(--bg-primary);
}

.message-input textarea {
  resize: none;
  min-height: 44px;
  max-height: 120px;
  overflow-y: auto;
  line-height: 1.4;
  font-family: inherit;
}

/* Expanded textarea state for mobile - when actively typing long messages */
.message-input textarea.expanded {
  max-height: 200px;
  border-radius: var(--radius);
}

/* === shadcn/ui Send Button === */
.btn-send {
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  background-color: var(--primary-color);
  color: var(--primary-foreground);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

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

.btn-send:disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* Chat lock overlay for input area */
.chat-lock-blocker {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-weight: 600;
}
.chat-lock-blocker i { color: var(--error-color); }

/* === shadcn/ui Bottom Navigation === */
.bottom-nav {
  background-color: var(--card);
  border-top: 1px solid var(--border-color);
  padding: 0.25rem 0;
  display: flex;
  justify-content: space-around;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
}

.nav-item {
  flex: 1;
  border: none;
  background: none;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.125rem;
  cursor: pointer;
  transition: var(--transition);
  color: var(--muted-foreground);
}

.nav-item i {
  font-size: 1.25rem;
}

.nav-item span {
  font-size: 0.625rem;
  font-weight: 500;
}

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

.nav-item:hover {
  color: var(--foreground);
}

/* Connection Status */
.connection-status {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background-color: var(--bg-primary);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  z-index: 20;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--error-color);
}

.status-indicator.connected {
  background: var(--success-color);
}

.status-indicator.connecting {
  background-color: var(--warning-color);
}

.status-indicator.error {
  background-color: var(--error-color);
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.loading-spinner {
  background: var(--bg-primary);
  padding: 2rem;
  border-radius: var(--border-radius);
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.loading-spinner i {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.loading-spinner p {
  margin: 0;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ===== CHAT PAGE STYLES ===== */

/* Chat Selection Area */
.chat-selection-area {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
}

.selection-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.selection-header h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: 1.1rem;
}

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

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

.groups-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* === shadcn/ui Group Item (List Item) === */
.group-item {
  background-color: var(--card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.group-item:hover {
  background-color: var(--accent);
}

.group-info h4 {
  margin: 0 0 0.25rem 0;
  color: var(--text-primary);
  font-size: 1rem;
}

.group-info p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.group-actions i {
  color: var(--text-light);
  font-size: 1.1rem;
}

/* Unread marker dot for group items (middle-right) */
.unread-dot {
  position: absolute;
  right: 36px; /* place just left of the chevron */
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success-color);
  box-shadow: 0 0 0 2px var(--bg-primary);
}

/* Admin list unread dot placement */
.chat-item {
  position: relative;
}
.unread-dot.admin {
  right: 12px;
  top: 50%;
}

.no-groups {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
}

.no-groups i {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--text-light);
}

.loading-groups {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
}

.loading-groups i {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
}

/* Chat Room Header */
.chat-room-header {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

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

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

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

.chat-room-info p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.btn-leave-chatroom {
  padding: 0.5rem 1rem;
  background: var(--error-color);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.btn-leave-chatroom:hover:not(:disabled) {
  background-color: #dc2626;
}

.btn-leave-chatroom:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ===== INVITE PAGE STYLES ===== */

.invite-container {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
}

/* === shadcn/ui Card/Section === */
.section {
  background-color: var(--card);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border-color);
}

.section h3 {
  margin: 0 0 0.75rem 0;
  color: var(--card-foreground);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

.section-header h3 {
  margin: 0;
}

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

#group-name-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 0.875rem;
  background-color: var(--bg-secondary);
  transition: var(--transition);
  font-weight: 500;
}

#group-name-input:focus {
  outline: none;
  border-color: var(--primary-color);
  background: var(--bg-primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

#group-name-input::placeholder {
  color: var(--text-light);
  font-weight: 400;
}

.organizations-selector h4 {
  margin: 0 0 1rem 0;
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.organizations-selector h4::before {
  content: "\f0c0";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  color: var(--primary-color);
}

.org-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 250px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 0.75rem;
  background-color: var(--bg-primary);
}

.org-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: var(--bg-secondary);
  border: 1px solid transparent;
  transition: var(--transition);
}

.org-item:hover {
  background-color: var(--accent);
}

.org-checkbox {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  cursor: pointer;
}

.org-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--primary-color);
}

.org-checkbox label {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 500;
  flex: 1;
}

.org-checkbox label i {
  color: var(--primary-color);
  font-size: 1.1rem;
}

.my-groups-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.my-group-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.group-icon {
  width: 40px;
  height: 40px;
  background: var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.1rem;
}

.group-details {
  flex: 1;
}

.group-details h4 {
  margin: 0 0 0.25rem 0;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.group-members {
  margin: 0 0 0.25rem 0;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.group-type {
  margin: 0;
  color: var(--text-light);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
}

.btn-join {
  padding: 0.4rem 0.8rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

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

#create-group-btn {
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius);
  background-color: var(--primary-color);
  transition: var(--transition);
}

#create-group-btn:hover:not(:disabled) {
  background-color: var(--primary-dark);
}

#create-group-btn:disabled {
  background-color: var(--muted);
  color: var(--muted-foreground);
  cursor: not-allowed;
}

.no-organizations {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-secondary);
}

.no-organizations i {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-light);
}

.loading-orgs {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-secondary);
}

.loading-orgs i {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
}

/* ===== ADVISOR PAGE STYLES (shadcn/ui solid) ===== */

.advisor-info {
  background-color: var(--primary-color);
  color: var(--primary-foreground);
  padding: 1rem;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
}

.advisor-avatar {
  width: 48px;
  height: 48px;
  background-color: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem;
  font-size: 1.5rem;
}

.advisor-details h3 {
  margin: 0 0 0.25rem 0;
  font-size: 1rem;
  font-weight: 600;
}

.advisor-details p {
  margin: 0;
  opacity: 0.85;
  font-size: 0.8125rem;
}

.advisor-welcome {
  background-color: var(--primary-color);
  color: var(--primary-foreground);
}

.advisor-message {
  border-left: 2px solid var(--primary-color);
}

.advisor-message .message-sender {
  color: var(--primary-color);
  font-weight: 500;
}

.typing-indicator .typing-dots {
  display: inline-flex;
  gap: 0.25rem;
  margin-right: 0.5rem;
}

.typing-dots span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: var(--muted-foreground);
  opacity: 0.6;
}

.typing-text {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
}

/* ===== MODERATOR PAGE STYLES (shadcn/ui solid) ===== */

.moderator-info {
  background-color: var(--destructive);
  color: var(--destructive-foreground);
  padding: 1rem;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
}

.moderator-avatar {
  width: 48px;
  height: 48px;
  background-color: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem;
  font-size: 1.5rem;
}

.moderator-details h3 {
  margin: 0 0 0.25rem 0;
  font-size: 1rem;
  font-weight: 600;
}

.moderator-details p {
  margin: 0;
  opacity: 0.85;
  font-size: 0.8125rem;
}

.moderator-welcome {
  background-color: var(--destructive);
  color: var(--destructive-foreground);
}

.moderator-message {
  border-left: 2px solid var(--destructive);
}

.moderator-message .message-sender {
  color: var(--destructive);
  font-weight: 500;
}

/* ===== SHARED STYLES ===== */

.error-state {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
}

.error-state i {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--error-color);
}

.btn-retry {
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
}

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

.nav-item {
  text-decoration: none;
  color: var(--text-light);
  transition: var(--transition);
}

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

.nav-item:hover {
  color: var(--primary-color);
  background: rgba(37, 99, 235, 0.05);
}

/* Responsive Adjustments */
@media (max-width: 480px) {
  .signin-container {
    margin: 0;
    border-radius: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  
  .chat-header {
    padding: 0.75rem 1rem;
  }
  
  .messages-area {
    padding: 0.75rem;
    padding-bottom: 160px; /* Adjusted for mobile with nav bar + additional UI */
  }
  
  .message-input-container {
    padding: 0.75rem;
    bottom: 60px; /* Smaller nav bar height on mobile */
    transition: transform 0.2s ease;
  }
  
  /* When textarea is focused and expanded on mobile, raise the input container */
  .message-input-container.raised {
    transform: translateY(-40px);
    z-index: 100;
  }
  
  .message-input textarea {
    max-height: 150px;
  }
  
  .message-input textarea.expanded {
    max-height: 250px;
    border-radius: var(--radius);
  }
  
  .group-options {
    gap: 0.5rem;
  }
  
  .group-btn {
    padding: 0.6rem 0.8rem;
    font-size: 0.85rem;
  }
}

/* Touch Improvements */
@media (hover: none) and (pointer: coarse) {
  .btn:hover {
    transform: none;
  }
  
  .btn-send:hover {
    transform: none;
  }
  
  .btn-primary:hover {
    transform: none;
  }
  
  .btn-secondary:hover {
    transform: none;
  }
}

/* ===== VIEW RENDERER STYLES ===== */
.small-text {
  font-size: 0.75em;
  color: var(--text-secondary);
  display: block;
  margin-top: 0.25rem;
  font-style: italic;
}

.no-statuses {
  color: var(--text-secondary);
  font-style: italic;
}