/* The Fold - Shepherd Church Student Hub */
/* Design System & Component Styles */
/* Completely rewritten for warmth, personality, and mobile-first design */

/* ============================================================================
   THEME VARIABLES
   ============================================================================ */

:root {
  color-scheme: light;
  /* Light Theme (Default) */
  --bg-primary: #faf8f4;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f5f2ec;
  --bg-overlay: rgba(0, 0, 0, 0.5);
  --text-primary: #1a1a1a;
  --text-secondary: #666;
  --text-tertiary: #999;
  --border-color: #e0ddd8;
  --sage: #5e8a6a;
  --sage-light: #7ba888;
  --sage-darker: #4a7858;
  --sage-bg: #f0f4f2;
  --amber: #b8952e;
  --amber-light: #d4ac3a;
  --amber-dark: #8a7220;
  --coral: #c9573f;
  --coral-light: #d96d57;
  --coral-dark: #a84631;
  --purple: #8a7cc8;
  --purple-light: #a896db;
  --blue: #6b8f9e;
  --blue-light: #7ba3b3;
  --success: #5e8a6a;
  --warning: #b8952e;
  --danger: #c9573f;
  --info: #6b8f9e;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.15);
  --shadow-warm: 0 8px 24px rgba(94, 138, 106, 0.15);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  --transition: all 0.2s ease;
  --transition-slow: all 0.3s ease;
  --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --z-dropdown: 100;
  --z-sticky: 200;
  --modal: 300;
}

/* Dark theme using [data-theme="dark"] selector instead of media query */
[data-theme="dark"] {
  --bg-primary: #121414;
  --bg-secondary: #1a1c1c;
  --bg-tertiary: #242727;
  --bg-overlay: rgba(0, 0, 0, 0.7);
  --text-primary: #ffffff;
  --text-secondary: #b0b0b0;
  --text-tertiary: #808080;
  --border-color: #333;
  --sage: #8a9f8e;
  --sage-light: #9db099;
  --sage-darker: #778277;
  --sage-bg: #1f2621;
  --amber: #d4ac3a;
  --amber-light: #e6bd52;
  --amber-dark: #b89425;
  --coral: #d96d57;
  --coral-light: #e88667;
  --coral-dark: #c45341;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.6);
  --shadow-warm: 0 8px 24px rgba(94, 138, 106, 0.25);
}

/* ============================================================================
   GLOBAL RESET & BASE STYLES
   ============================================================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

input, textarea, select, button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ============================================================================
   BUTTONS (generic utility classes)
   ============================================================================ */

.btn {
  padding: 14px 24px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 16px;
  transition: var(--transition-smooth);
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  min-height: 48px;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, #5e8a6a 0%, #7ba888 100%);
  color: white;
  box-shadow: 0 4px 16px rgba(94, 138, 106, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(94, 138, 106, 0.35);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(94, 138, 106, 0.2);
}

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

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

.btn-block {
  width: 100%;
}

.btn-small {
  padding: 8px 16px;
  font-size: 14px;
  min-height: 36px;
}

.btn-danger {
  background-color: var(--coral);
  color: white;
}

.btn-danger:hover {
  background-color: var(--coral-dark);
}

/* ============================================================================
   ANIMATIONS
   ============================================================================ */

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

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

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

@keyframes float {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
  100% {
    transform: translateY(0px);
  }
}

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

@keyframes orb1 {
  0% {
    transform: translate(0, 0);
  }
  33% {
    transform: translate(80px, -60px);
  }
  66% {
    transform: translate(-40px, 80px);
  }
  100% {
    transform: translate(0, 0);
  }
}

@keyframes orb2 {
  0% {
    transform: translate(0, 0);
  }
  33% {
    transform: translate(-100px, 60px);
  }
  66% {
    transform: translate(60px, -80px);
  }
  100% {
    transform: translate(0, 0);
  }
}

@keyframes orb3 {
  0% {
    transform: translate(0, 0);
  }
  33% {
    transform: translate(60px, 100px);
  }
  66% {
    transform: translate(-80px, -40px);
  }
  100% {
    transform: translate(0, 0);
  }
}

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

/* ============================================================================
   AMBIENT GLOW BACKGROUNDS & FLOATING ORBS
   ============================================================================ */

.ambient {
  position: absolute;
  top: -25%;
  right: -15%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(94, 138, 106, 0.12) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  animation: orb1 20s ease-in-out infinite;
}

.ambient-bottom {
  position: absolute;
  bottom: -15%;
  left: -15%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(201, 87, 63, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  animation: orb2 25s ease-in-out infinite;
}

.ambient-accent {
  position: absolute;
  top: 30%;
  left: 5%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(184, 149, 46, 0.06) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  animation: orb3 30s ease-in-out infinite;
}

/* ============================================================================
   APP CONTAINER & LAYOUT
   ============================================================================ */

#app {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
}

.app-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.app-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 68px;
  scroll-behavior: smooth;
}

.app-content {
  padding: 20px;
  max-width: 100%;
  position: relative;
  z-index: 1;
}

/* ============================================================================
   SCREEN ROUTING (Single Page App)
   ============================================================================ */

.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  flex-direction: column;
  background-color: var(--bg-primary);
  z-index: 10;
}

.screen.active {
  display: flex;
  animation: fadeIn 0.3s ease-in forwards;
}

.screen.fade-out {
  animation: fadeOut 0.3s ease-out forwards;
}

.screen.fade-in {
  animation: fadeIn 0.3s ease-in forwards;
}

/* ============================================================================
   SPLASH SCREEN
   ============================================================================ */

.splash-screen {
  background: linear-gradient(135deg, #5e8a6a 0%, #7ba888 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 999;
  transition: opacity 0.5s ease;
}

.splash-screen:not(.active) {
  opacity: 0;
  pointer-events: none;
}

.splash-screen::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  animation: orb1 15s ease-in-out infinite;
}

.splash-screen::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  animation: orb2 20s ease-in-out infinite;
}

.splash-logo {
  width: 100px;
  height: 100px;
  animation: bounce 2s ease-in-out infinite;
  position: relative;
  z-index: 1;
}

/* ============================================================================
   AUTH SCREENS - REDESIGNED WITH FLOATING CARD & DEPTH
   ============================================================================ */

.auth-screen {
  background: linear-gradient(135deg, var(--sage) 0%, var(--sage-light) 100%);
  position: relative;
  overflow: hidden;
}

.auth-screen::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
  border-radius: 50%;
  animation: orb1 20s ease-in-out infinite;
}

.auth-screen::after {
  content: '';
  position: absolute;
  bottom: -100px;
  left: -50px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  animation: orb2 25s ease-in-out infinite;
}

.auth-container {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 20px;
}

.auth-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 40px 32px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-xl);
  backdrop-filter: blur(10px);
  animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

/* Frosted glass effect on auth card */
.auth-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.1) 100%);
  border-radius: 20px;
  pointer-events: none;
}

.auth-card > * {
  position: relative;
  z-index: 1;
}

.auth-logo {
  width: 72px;
  height: 72px;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.auth-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  text-align: center;
  letter-spacing: -0.5px;
}

.auth-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 28px;
  font-weight: 400;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input {
  padding: 14px 16px;
  border: 2px solid #e0ddd8;
  border-radius: var(--radius-md);
  background-color: #f5f2ec;
  font-size: 15px;
  transition: var(--transition-smooth);
  color: #1a1a1a;
  height: 48px;
  min-height: 48px;
  -webkit-appearance: none;
  appearance: none;
}

/* Force auth card inputs to always be light - override browser dark mode */
.auth-card,
.auth-card * {
  color-scheme: light !important;
}

.auth-card .form-group input {
  background-color: #f5f2ec !important;
  color: #1a1a1a !important;
  border-color: #ddd8d0 !important;
  -webkit-appearance: none;
  appearance: none;
}

.auth-card .form-group input::placeholder {
  color: #999 !important;
}

.auth-card .form-group label {
  color: #333 !important;
  display: block;
}

.form-group input:focus {
  outline: none;
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(94, 138, 106, 0.1);
  background-color: #fafafa;
}

.form-group input::placeholder {
  color: var(--text-tertiary);
}

.auth-button {
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--sage) 0%, var(--sage-light) 100%);
  color: white;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 600;
  height: 52px;
  min-height: 52px;
  transition: var(--transition-smooth);
  box-shadow: var(--shadow-warm);
  width: 100%;
  text-align: center;
  margin-top: 8px;
}

.auth-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(94, 138, 106, 0.25);
}

.auth-button:active {
  transform: translateY(0);
}

.auth-toggle {
  text-align: center;
  margin-top: 16px;
  font-size: 14px;
  color: #666;
}

.auth-toggle a,
.auth-toggle .link-button {
  color: #5e8a6a;
  font-weight: 600;
  transition: var(--transition);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-size: 14px;
  font-family: inherit;
}

.link-button {
  color: var(--sage);
  font-weight: 600;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-family: inherit;
}

.auth-toggle a:hover {
  color: var(--sage-light);
}

.auth-error {
  background-color: rgba(201, 87, 63, 0.1);
  border: 1px solid rgba(201, 87, 63, 0.3);
  color: var(--danger);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  margin-bottom: 12px;
}

.auth-loading {
  opacity: 0.6;
  pointer-events: none;
}

/* ============================================================================
   HUB SCREEN - HOME/DASHBOARD
   ============================================================================ */

.hub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  background-color: var(--bg-primary);
  position: relative;
  z-index: 2;
}

.hub-greeting {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hub-greeting-label {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hub-greeting-text {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.hub-avatar-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sage) 0%, var(--sage-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 20px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.streak-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--amber) 0%, var(--amber-light) 100%);
  color: white;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  white-space: nowrap;
}

.streak-badge .streak-number {
  font-weight: 700;
}

.hub-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px;
  padding-bottom: 68px;
  scroll-behavior: smooth;
}

.section {
  margin-bottom: 32px;
}

.section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

/* ============================================================================
   HUB CARDS - CHALLENGE, VERSE, TOOLS, ANNOUNCEMENTS
   ============================================================================ */

.challenge-card {
  background: linear-gradient(135deg, var(--sage-bg) 0%, rgba(94, 138, 106, 0.05) 100%);
  border: 1px solid rgba(94, 138, 106, 0.2);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  border-top: 4px solid;
  border-image: linear-gradient(90deg, var(--sage) 0%, var(--sage-light) 100%) 1;
  animation: slideUp 0.4s ease-out;
}

.challenge-card.completed {
  opacity: 0.7;
  background: linear-gradient(135deg, rgba(94, 138, 106, 0.1) 0%, rgba(94, 138, 106, 0.02) 100%);
}

.challenge-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.challenge-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.challenge-badge {
  background: var(--sage);
  color: white;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.challenge-description {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
}

.challenge-progress {
  background: rgba(94, 138, 106, 0.1);
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.challenge-progress-bar {
  background: linear-gradient(90deg, var(--sage) 0%, var(--sage-light) 100%);
  height: 100%;
  transition: width 0.4s ease;
}

.challenge-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-tertiary);
}

.verse-card {
  background: linear-gradient(135deg, rgba(107, 143, 158, 0.05) 0%, rgba(107, 143, 158, 0.02) 100%);
  border: 1px solid rgba(107, 143, 158, 0.2);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  text-align: center;
  margin-bottom: 16px;
  animation: slideUp 0.4s ease-out 0.1s both;
}

.verse-quote-mark {
  font-size: 48px;
  color: rgba(107, 143, 158, 0.3);
  margin-bottom: 8px;
  font-family: Georgia, serif;
}

.verse-text {
  font-size: 16px;
  color: var(--text-primary);
  font-style: italic;
  line-height: 1.6;
  margin-bottom: 12px;
  font-weight: 500;
}

.verse-reference {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 600;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.tool-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  text-align: center;
  transition: var(--transition-smooth);
  animation: slideUp 0.4s ease-out;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-height: 140px;
  justify-content: center;
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--sage);
}

.tool-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(94, 138, 106, 0.1) 0%, rgba(94, 138, 106, 0.05) 100%);
  border-radius: var(--radius-md);
  font-size: 24px;
}

.tool-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.announcement-card {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(94, 138, 106, 0.02) 100%);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--sage);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 12px;
  animation: slideUp 0.4s ease-out;
}

.announcement-title {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
  margin-bottom: 6px;
}

.announcement-message {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.announcement-time {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 8px;
}

/* ============================================================================
   MESSAGES SCREEN / CHAT
   ============================================================================ */

.messages-screen {
  background-color: var(--bg-primary);
  display: flex;
  flex-direction: column;
}

.messages-header {
  padding: 20px;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  position: relative;
  z-index: 2;
}

.messages-header-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.messages-container {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}

.message {
  display: flex;
  animation: slideUp 0.3s ease-out;
  max-width: 85%;
}

.message.own {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message-bubble {
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.4;
  word-wrap: break-word;
}

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

.message.own .message-bubble {
  background: linear-gradient(135deg, var(--sage) 0%, var(--sage-light) 100%);
  color: white;
  border: none;
}

.message-time {
  font-size: 11px;
  color: var(--text-tertiary);
  padding: 0 12px;
  display: flex;
  align-items: flex-end;
}

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sage) 0%, var(--sage-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
  margin: 0 8px;
  box-shadow: var(--shadow-sm);
}

.message.own .message-avatar {
  display: none;
}

.compose-bar {
  position: fixed;
  bottom: 68px;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 16px 20px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  display: flex;
  gap: 12px;
  z-index: 200;
}

.compose-input-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  padding: 0 16px;
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.compose-input-wrapper:focus-within {
  border-color: var(--sage);
  box-shadow: 0 0 0 2px rgba(94, 138, 106, 0.1);
}

.compose-input {
  flex: 1;
  background: none;
  border: none;
  padding: 12px 0;
  font-size: 15px;
  outline: none;
  resize: none;
  max-height: 100px;
}

.compose-button {
  width: 44px;
  height: 44px;
  min-height: 44px;
  background: linear-gradient(135deg, var(--sage) 0%, var(--sage-light) 100%);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition-smooth);
  box-shadow: var(--shadow-md);
  font-size: 20px;
}

.compose-button:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-lg);
}

.compose-button:active {
  transform: scale(0.95);
}

/* ============================================================================
   TOOLS / TABS SCREEN
   ============================================================================ */

.tools-screen {
  background-color: var(--bg-primary);
  display: flex;
  flex-direction: column;
}

.tools-header {
  padding: 20px;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.tools-header-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.tools-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px;
  padding-bottom: 68px;
}

.tools-section {
  margin-bottom: 28px;
}

.tools-section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 14px;
  letter-spacing: -0.3px;
}

.tools-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tool-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  transition: var(--transition-smooth);
  cursor: pointer;
}

.tool-item:hover {
  transform: translateX(4px);
  border-color: var(--sage);
  box-shadow: var(--shadow-md);
}

.tool-item-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(94, 138, 106, 0.1) 0%, rgba(94, 138, 106, 0.05) 100%);
  border-radius: var(--radius-md);
  font-size: 24px;
  flex-shrink: 0;
}

.tool-item-content {
  flex: 1;
  min-width: 0;
}

.tool-item-title {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 15px;
  margin-bottom: 4px;
}

.tool-item-description {
  font-size: 13px;
  color: var(--text-secondary);
}

.tool-item-arrow {
  color: var(--text-tertiary);
  font-size: 18px;
}

/* ============================================================================
   PROFILE SCREEN
   ============================================================================ */

.profile-screen {
  background-color: var(--bg-primary);
  display: flex;
  flex-direction: column;
}

.profile-header {
  padding: 20px;
  background: linear-gradient(135deg, rgba(94, 138, 106, 0.1) 0%, rgba(94, 138, 106, 0.05) 100%);
  border-bottom: 1px solid var(--border-color);
  position: relative;
  z-index: 2;
}

.profile-header-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.profile-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px;
  padding-bottom: 68px;
}

.profile-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  text-align: center;
  margin-bottom: 20px;
  animation: slideUp 0.4s ease-out;
}

.profile-avatar-large {
  width: 80px;
  height: 80px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sage) 0%, var(--sage-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 36px;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
}

.profile-avatar-large img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.profile-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  letter-spacing: -0.3px;
}

.profile-email {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.profile-stat {
  background: var(--bg-tertiary);
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.profile-stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--sage);
  letter-spacing: -0.3px;
}

.profile-stat-label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-weight: 500;
}

.profile-section {
  margin-bottom: 20px;
}

.profile-section-title {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.profile-section-content {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.profile-button {
  width: 100%;
  padding: 14px 20px;
  background: linear-gradient(135deg, var(--sage) 0%, var(--sage-light) 100%);
  color: white;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 15px;
  transition: var(--transition-smooth);
  height: 48px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  margin-bottom: 12px;
}

.profile-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.profile-button.secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  box-shadow: none;
}

.profile-button.secondary:hover {
  border-color: var(--sage);
}

/* ============================================================================
   BOTTOM NAVIGATION
   ============================================================================ */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  padding-top: 8px;
  padding-bottom: max(8px, env(safe-area-inset-bottom, 0px));
  height: auto;
  min-height: 68px;
  z-index: 250;
  box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.05);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  color: var(--text-secondary);
  transition: var(--transition-smooth);
  position: relative;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-weight: 500;
}

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

.nav-item.active::after {
  content: '';
  position: absolute;
  bottom: -9px;
  width: 6px;
  height: 6px;
  background: var(--sage);
  border-radius: 50%;
}

.nav-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  transition: var(--transition-smooth);
}

.nav-item.active .nav-icon {
  transform: scale(1.1);
}

.nav-label {
  font-size: 10px;
}

/* ============================================================================
   TOAST NOTIFICATIONS
   ============================================================================ */

.toast-container {
  position: fixed;
  bottom: 100px;
  left: 20px;
  right: 20px;
  z-index: 400;
  pointer-events: none;
}

.toast {
  background: var(--text-primary);
  color: white;
  padding: 12px 16px;
  border-radius: 24px;
  margin-bottom: 12px;
  font-size: 14px;
  animation: slideUp 0.3s ease-out;
  pointer-events: auto;
  box-shadow: var(--shadow-lg);
  max-width: 100%;
  word-wrap: break-word;
}

.toast.success {
  background: linear-gradient(135deg, var(--success) 0%, var(--sage-light) 100%);
}

.toast.error {
  background: linear-gradient(135deg, var(--danger) 0%, var(--coral-light) 100%);
}

.toast.info {
  background: linear-gradient(135deg, var(--info) 0%, var(--blue-light) 100%);
}

.toast.warning {
  background: linear-gradient(135deg, var(--warning) 0%, var(--amber-light) 100%);
}

/* ============================================================================
   MODALS & OVERLAYS
   ============================================================================ */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-overlay);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 20px;
  animation: fadeIn 0.2s ease-out;
}

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

.modal {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  max-width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.modal-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 20px;
  transition: var(--transition);
}

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

.modal-content {
  padding: 20px;
}

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.modal-button {
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  transition: var(--transition);
  height: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-button.primary {
  background: linear-gradient(135deg, var(--sage) 0%, var(--sage-light) 100%);
  color: white;
  box-shadow: var(--shadow-md);
}

.modal-button.primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

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

.modal-button.secondary:hover {
  border-color: var(--sage);
}

/* ============================================================================
   LOADING & SKELETON STATES
   ============================================================================ */

.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-tertiary) 25%,
    rgba(0, 0, 0, 0.05) 50%,
    var(--bg-tertiary) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

.skeleton-text {
  height: 16px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.skeleton-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin-bottom: 12px;
}

.skeleton-card {
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  min-height: 100px;
}

.loader {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(94, 138, 106, 0.3);
  border-top-color: var(--sage);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

.text-center {
  text-align: center;
}

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

.text-small {
  font-size: 13px;
}

.text-large {
  font-size: 18px;
}

.mt-12 {
  margin-top: 12px;
}

.mt-16 {
  margin-top: 16px;
}

.mt-20 {
  margin-top: 20px;
}

.mb-12 {
  margin-bottom: 12px;
}

.mb-16 {
  margin-bottom: 16px;
}

.mb-20 {
  margin-bottom: 20px;
}

.p-16 {
  padding: 16px;
}

.p-20 {
  padding: 20px;
}

.gap-12 {
  gap: 12px;
}

.gap-16 {
  gap: 16px;
}

.rounded-md {
  border-radius: var(--radius-md);
}

.rounded-lg {
  border-radius: var(--radius-lg);
}

.shadow-md {
  box-shadow: var(--shadow-md);
}

.shadow-lg {
  box-shadow: var(--shadow-lg);
}

.hidden {
  display: none;
}

.visible {
  display: block;
}

/* ============================================================================
   RESPONSIVE DESIGN - TABLETS & LARGER SCREENS
   ============================================================================ */

@media (min-width: 640px) {
  .tools-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .auth-card {
    padding: 48px 40px;
    max-width: 480px;
  }

  .auth-title {
    font-size: 36px;
  }

  .messages-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
  }

  .message {
    max-width: 70%;
  }

  .compose-bar {
    max-width: 600px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }

  .profile-stats {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1024px) {
  .tools-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .hub-content {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
  }

  .hub-sidebar {
    grid-column: 2;
  }

  .profile-stats {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ============================================================================
   ACCESSIBILITY & DARK MODE SUPPORT
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 380px) {
  .tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .auth-card {
    padding: 28px 20px;
  }

  .hub-greeting-text {
    font-size: 20px;
  }

  .section-title {
    font-size: 16px;
  }

  .compose-bar {
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }
}

/* ============================================================================
   INPUT FOCUS STATES & FORM ENHANCEMENTS
   ============================================================================ */

input:focus,
textarea:focus,
select:focus {
  outline: none;
}

textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  resize: vertical;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-primary);
  transition: var(--transition-smooth);
  min-height: 100px;
}

textarea:focus {
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(94, 138, 106, 0.1);
}

select {
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-primary);
  transition: var(--transition-smooth);
  height: 48px;
  min-height: 48px;
}

select:focus {
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(94, 138, 106, 0.1);
}

/* ============================================================================
   SCROLL BAR STYLING
   ============================================================================ */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: rgba(94, 138, 106, 0.3);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(94, 138, 106, 0.5);
}

/* ============================================================================
   SAFE AREA HANDLING FOR NOTCH & DYNAMIC ISLAND DEVICES
   ============================================================================ */

@supports (padding: max(0px)) {
  body {
    padding-left: max(0px, env(safe-area-inset-left));
    padding-right: max(0px, env(safe-area-inset-right));
    padding-top: max(0px, env(safe-area-inset-top));
  }

  .bottom-nav {
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }

  .app-scroll {
    padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px));
  }

  .compose-bar {
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
}

/* ============================================================================
   PRINT STYLES
   ============================================================================ */

@media print {
  body,
  .screen {
    background: white;
  }

  .bottom-nav,
  .compose-bar {
    display: none;
  }

  .app-scroll {
    padding-bottom: 0;
  }
}
