/* UI Gradenticy Design System */

/* Ambient Glowing Background Orbs */
.bg-ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.25;
}

.orb-violet {
  width: 600px;
  height: 600px;
  background: #8B5CF6;
  top: -100px;
  left: 20%;
}

.orb-cyan {
  width: 500px;
  height: 500px;
  background: #06B6D4;
  bottom: -100px;
  right: 15%;
}

.orb-amber {
  width: 400px;
  height: 400px;
  background: #F59E0B;
  top: 40%;
  left: -100px;
}

/* Gradient Glowing Borders */
.gradient-border-violet {
  position: relative;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
}

.gradient-border-violet::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: calc(var(--radius-lg) + 1px);
  padding: 1px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.6), rgba(6, 182, 212, 0.2), rgba(255, 255, 255, 0.05));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.gradient-border-emerald {
  position: relative;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
}

.gradient-border-emerald::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: calc(var(--radius-lg) + 1px);
  padding: 1px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.6), rgba(6, 182, 212, 0.2), rgba(255, 255, 255, 0.05));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.gradient-border-amber {
  position: relative;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
}

.gradient-border-amber::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: calc(var(--radius-lg) + 1px);
  padding: 1px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.6), rgba(239, 68, 68, 0.2), rgba(255, 255, 255, 0.05));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* Dynamic Financial Health Score Radial Ring */
.health-score-circle {
  position: relative;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: conic-gradient(var(--accent-emerald) calc(var(--score-pct, 82) * 1%), rgba(255, 255, 255, 0.1) 0);
}

.health-score-inner {
  width: 116px;
  height: 116px;
  border-radius: 50%;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
}

.health-score-val {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
}

.health-score-lbl {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Utopia City Visual Grid Cards */
.city-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.landmark-card {
  position: relative;
  background: rgba(18, 22, 32, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  overflow: hidden;
  transition: all 0.3s ease;
}

.landmark-card:hover {
  transform: translateY(-3px);
  border-color: rgba(139, 92, 246, 0.4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.landmark-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.landmark-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 0.75rem;
}

.landmark-progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* Chat Interface Styling */
.chat-box {
  display: flex;
  flex-direction: column;
  height: 540px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: rgba(18, 22, 32, 0.75);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chat-msg {
  display: flex;
  gap: 0.75rem;
  max-width: 82%;
}

.chat-msg-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-msg-bot {
  align-self: flex-start;
}

.chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-bubble {
  padding: 0.9rem 1.2rem;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  line-height: 1.5;
}

.chat-msg-user .chat-bubble {
  background: linear-gradient(135deg, var(--accent-violet), var(--accent-indigo));
  color: #fff;
  border-bottom-right-radius: 2px;
}

.chat-msg-bot .chat-bubble {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-bottom-left-radius: 2px;
}

.chat-input-row {
  padding: 1rem;
  background: rgba(13, 16, 23, 0.9);
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 0.75rem;
}

/* Sidebar App Layout */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.app-sidebar {
  width: 260px;
  background: rgba(13, 16, 24, 0.95);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 90;
}

.app-content {
  margin-left: 260px;
  flex: 1;
  padding: 2rem;
  max-width: 1300px;
}

@media (max-width: 900px) {
  .app-sidebar {
    width: 70px;
  }
  .app-sidebar .sidebar-text {
    display: none;
  }
  .app-content {
    margin-left: 70px;
    padding: 1rem;
  }
}

.sidebar-menu {
  list-style: none;
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sidebar-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.sidebar-item.active {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(6, 182, 212, 0.1));
  color: var(--text-primary);
  border: 1px solid rgba(139, 92, 246, 0.3);
  font-weight: 600;
}

/* Animated Ambient Waves Background */
.bg-waves-wrapper {
  position: absolute;
  width: 100%;
  overflow: hidden;
  line-height: 0;
  pointer-events: none;
  z-index: 0;
}

.bg-waves-hero {
  top: 0;
  left: 0;
  height: 100%;
  opacity: 0.7;
}

.wave-svg-container {
  width: 100%;
  height: 100%;
  display: block;
}

.animated-wave {
  animation: waveFloat 14s ease-in-out infinite alternate;
  transform-origin: center;
}

.animated-wave-1 {
  animation-duration: 16s;
  opacity: 0.55;
}

.animated-wave-2 {
  animation-duration: 22s;
  animation-delay: -5s;
  opacity: 0.45;
}

.animated-wave-3 {
  animation-duration: 28s;
  animation-delay: -10s;
  opacity: 0.35;
}

@keyframes waveFloat {
  0% {
    transform: translateY(0px) scaleY(1) rotate(0deg);
  }
  50% {
    transform: translateY(-22px) scaleY(1.1) rotate(0.4deg);
  }
  100% {
    transform: translateY(14px) scaleY(0.95) rotate(-0.4deg);
  }
}

/* Animated Floating Orbs & Glow Background */
.orb-violet, .orb-cyan, .orb-amber {
  animation: orbPulse 12s ease-in-out infinite alternate;
}

@keyframes orbPulse {
  0% { transform: scale(1) translate(0, 0); opacity: 0.25; }
  50% { transform: scale(1.15) translate(20px, -20px); opacity: 0.38; }
  100% { transform: scale(0.92) translate(-15px, 15px); opacity: 0.22; }
}

/* Mobile Hamburger Menu Button & Navigation Drawer */
.hamburger-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobile-nav-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav-drawer {
  position: fixed;
  top: 0;
  right: -300px;
  width: 280px;
  height: 100vh;
  background: rgba(13, 16, 24, 0.98);
  border-left: 1px solid var(--border-color);
  z-index: 999;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: -10px 0 30px rgba(0,0,0,0.8);
}

.mobile-nav-drawer.open {
  right: 0;
}

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

.mobile-drawer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mobile-drawer-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.mobile-drawer-link:hover {
  color: var(--text-primary);
}

/* Authentication Modal Overlay */
.auth-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 12, 0.85);
  backdrop-filter: blur(12px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.auth-modal-card {
  width: 100%;
  max-width: 440px;
  background: rgba(18, 22, 32, 0.95);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-glow-violet);
  position: relative;
  animation: modalScaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScaleUp {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

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

.auth-tab-btn {
  flex: 1;
  padding: 0.75rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-tab-btn.active {
  color: #C084FC;
  border-bottom-color: #8B5CF6;
}

.btn-google {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.85rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 1.25rem;
}

.btn-google:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

@media (max-width: 900px) {
  .hamburger-btn {
    display: inline-flex;
  }
  .nav-links, .nav-actions {
    display: none;
  }
}
