/* 
  Intelligent Healthcare Platform - Design System
  Theme: Neural Cyber-Medical (Premium Dark Mode)
*/

:root {
  /* Color Palette */
  --bg-primary: #0a0c10;
  --bg-secondary: #14181f;
  --accent-primary: #00f2ff; /* Cyber Cyan */
  --accent-secondary: #7000ff; /* Neural Purple */
  --text-main: #e0e6ed;
  --text-muted: #94a3b8;
  --danger: #ff4d4d;
  --success: #00ff9d;
  --warning: #ffcc00;
  
  /* Glassmorphism */
  --glass-bg: rgba(20, 24, 31, 0.7);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.8);
  
  /* Fonts */
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-main);
  overflow-x: hidden;
  line-height: 1.6;
}

/* Background Neural Animation Effect */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 30%, rgba(0, 242, 255, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(112, 0, 255, 0.05) 0%, transparent 40%);
  z-index: -1;
  pointer-events: none;
}

/* Layout */
.app-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: 100vh;
  transition: grid-template-columns 0.3s ease;
}

.app-container.sidebar-hidden {
  grid-template-columns: 1fr;
}

.app-container.sidebar-hidden aside {
  display: none;
}

/* Sidebar */
aside {
  background: var(--bg-secondary);
  border-right: 1px solid var(--glass-border);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-item {
  padding: 0.8rem 1rem;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.nav-item:hover, .nav-item.active {
  background: rgba(255, 255, 255, 0.05);
  color: var(--accent-primary);
  transform: translateX(5px);
}

/* Main Content Area */
main {
  padding: 2rem 3rem;
  overflow-y: auto;
  scroll-behavior: smooth;
}

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

/* View Mode Selector */
.view-mode-selector {
  display: flex;
  background: var(--bg-secondary);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  width: fit-content;
  margin-left: auto;
  margin-bottom: 1rem;
}

.mode-btn {
  padding: 0.6rem 1.2rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  transition: 0.3s;
}

.mode-btn.active {
  background: var(--glass-border);
  color: var(--accent-primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Hero Card (User View) */
.hero-card {
  background: linear-gradient(135deg, rgba(0, 242, 255, 0.1) 0%, rgba(112, 0, 255, 0.1) 100%);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

.hero-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, var(--accent-primary) 0%, transparent 70%);
  opacity: 0.1;
  pointer-events: none;
}

.hero-text h2 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  background: linear-gradient(90deg, #fff, #888);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-text p {
  color: var(--text-muted);
  max-width: 600px;
}

/* Modals */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(15px);
  display: none; /* Hidden by default */
  justify-content: center;
  align-items: center;
  z-index: 2000;
  animation: fadeIn 0.3s ease-out;
}

.modal-content {
  background: var(--bg-secondary);
  padding: 3rem;
  border-radius: 32px;
  border: 1px solid var(--glass-border);
  width: 400px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
  animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

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

/* Custom Profile Avatar */
.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(45deg, var(--accent-primary), var(--accent-secondary));
  border: 2px solid var(--glass-border);
}

/* Dashboard Cards */
.grid-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  padding: 1.5rem;
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  transition: transform 0.3s ease;
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent-primary);
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, var(--accent-primary) 0%, transparent 70%);
  opacity: 0.05;
}

.stat-val {
  font-size: 2rem;
  font-weight: 700;
  margin: 0.5rem 0;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* AI Diagnosis Section */
.ai-section {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 2rem;
  margin-top: 2rem;
}

.ai-card {
  background: linear-gradient(135deg, rgba(112, 0, 255, 0.1), rgba(0, 242, 255, 0.05));
  border: 1px solid rgba(112, 0, 255, 0.2);
  border-radius: 24px;
  padding: 2rem;
  position: relative;
}

.ai-pulse {
  position: absolute;
  top: 2rem;
  right: 2rem;
  width: 12px;
  height: 12px;
  background: var(--accent-primary);
  border-radius: 50%;
  box-shadow: 0 0 15px var(--accent-primary);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.5; }
  100% { transform: scale(1); opacity: 1; }
}

.ai-title {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.diagnostic-text {
  font-size: 1.1rem;
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.2);
  padding: 1.5rem;
  border-radius: 16px;
  border-left: 4px solid var(--accent-primary);
}

/* Form Styles */
.input-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

input, textarea, select {
  width: 100%;
  padding: 0.8rem 1.2rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: white;
  outline: none;
  transition: 0.3s;
}

input:focus, textarea:focus {
  border-color: var(--accent-primary);
  background: rgba(255, 255, 255, 0.06);
}

.btn-primary {
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  border: none;
  padding: 1rem 2rem;
  border-radius: 12px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s;
  box-shadow: 0 4px 15px rgba(0, 242, 255, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 242, 255, 0.5);
}

/* Vital Signs List */
.vitals-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.vital-item {
  background: rgba(255, 255, 255, 0.02);
  padding: 1rem;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.vital-label { color: var(--text-muted); font-size: 0.8rem; }
.vital-value { font-weight: 600; color: var(--accent-primary); }

/* Chat Bubbles */
.chat-bubble {
  padding: 1rem 1.5rem;
  border-radius: 18px;
  max-width: 85%;
  font-size: 0.95rem;
  line-height: 1.4;
  position: relative;
  animation: slideIn 0.3s ease-out;
}

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

.chat-bubble.ai {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.05);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--glass-border);
}

.chat-bubble.user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--accent-secondary), #4a00e0);
  color: white;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 12px rgba(112, 0, 255, 0.3);
}

/* Sickness List / Condition Selectors */
.sickness-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.condition-selector {
  cursor: pointer;
  border: 1px solid var(--glass-border);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.condition-selector:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(0, 242, 255, 0.5);
  transform: scale(1.02);
}

.condition-selector.active {
  background: rgba(0, 242, 255, 0.1);
  border-color: var(--accent-primary);
  box-shadow: 0 0 15px rgba(0, 242, 255, 0.2);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--glass-border);
  border-radius: 10px;
}

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

/* Responsive */
@media (max-width: 1024px) {
  .app-container {
    grid-template-columns: 1fr;
  }
  aside {
    display: none; /* Mobile menu needed but simplified for now */
  }
}
