/* Radiology Assistant Agent - Glassmorphism Theme */

:root {
  --bg-gradient-start: #b8c6db;
  --bg-gradient-end: #f5f7fa;
  --glass-bg: rgba(255, 255, 255, 0.25);
  --glass-border: rgba(255, 255, 255, 0.4);
  --glass-shadow: rgba(0, 0, 0, 0.1);
  --text-primary: #2d3748;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  --btn-primary: #334155;
  --btn-primary-hover: #1e293b;
  --accent-blue: #3b82f6;
  --accent-teal: #14b8a6;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --urgent: #dc2626;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
  min-height: 100vh;
  color: var(--text-primary);
  line-height: 1.6;
}

/* Glass Card */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  box-shadow: 0 8px 32px var(--glass-shadow);
}

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

/* Typography */
h1, h2, h3, h4 {
  font-weight: 600;
  color: var(--text-primary);
}

.title-gradient {
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

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

.btn-primary:hover {
  background: var(--btn-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(51, 65, 85, 0.4);
}

.btn-glass {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.4);
}

.btn-icon {
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 14px;
}

/* Form Elements */
.form-group {
  margin-bottom: 20px;
}

.form-input {
  width: 100%;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 14px;
  font-size: 15px;
  color: var(--text-primary);
  transition: all 0.3s ease;
}

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

.form-input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.8);
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-icon-wrapper {
  position: relative;
}

.input-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

/* Waveform Animation */
.waveform {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 60px;
  margin: 20px 0;
}

.waveform-bar {
  width: 3px;
  background: var(--text-secondary);
  border-radius: 2px;
  animation: wave 1.2s ease-in-out infinite;
}

.waveform-bar:nth-child(1) { animation-delay: 0s; height: 20px; }
.waveform-bar:nth-child(2) { animation-delay: 0.1s; height: 35px; }
.waveform-bar:nth-child(3) { animation-delay: 0.2s; height: 50px; }
.waveform-bar:nth-child(4) { animation-delay: 0.3s; height: 35px; }
.waveform-bar:nth-child(5) { animation-delay: 0.4s; height: 55px; }
.waveform-bar:nth-child(6) { animation-delay: 0.5s; height: 40px; }
.waveform-bar:nth-child(7) { animation-delay: 0.6s; height: 25px; }
.waveform-bar:nth-child(8) { animation-delay: 0.7s; height: 45px; }
.waveform-bar:nth-child(9) { animation-delay: 0.8s; height: 30px; }
.waveform-bar:nth-child(10) { animation-delay: 0.9s; height: 20px; }

@keyframes wave {
  0%, 100% { transform: scaleY(0.5); opacity: 0.5; }
  50% { transform: scaleY(1); opacity: 1; }
}

/* Login Page - Split Layout */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--glass-bg);
}

.login-branding {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 48px;
  color: white;
  position: relative;
  overflow: hidden;
}

.login-branding::before {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(59,130,246,0.12) 0%, transparent 70%);
  top: -150px;
  right: -150px;
}

.login-branding::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(20,184,166,0.08) 0%, transparent 70%);
  bottom: -100px;
  left: -100px;
}

.branding-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 420px;
}

.branding-icon {
  width: 72px;
  height: 72px;
  background: rgba(255,255,255,0.1);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 28px;
  border: 1px solid rgba(255,255,255,0.1);
}

.branding-title {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
  color: white;
}

.branding-subtitle {
  font-size: 16px;
  opacity: 0.7;
  margin-bottom: 48px;
  line-height: 1.5;
}

.modality-badges {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 48px;
}

.modality-badge {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}

.features-list {
  text-align: left;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
  opacity: 0.9;
}

.feature-icon {
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.08);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.feature-text {
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255,255,255,0.8);
}

.feature-text strong {
  display: block;
  font-size: 14px;
  margin-bottom: 2px;
  color: white;
}

.login-form-section {
  background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
}

.login-form-container {
  width: 100%;
  max-width: 380px;
}

.login-header {
  margin-bottom: 32px;
  text-align: center;
}

.login-header h2 {
  font-size: 24px;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.login-header p {
  color: var(--text-muted);
  font-size: 14px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.input-wrapper {
  position: relative;
}

.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.login-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #dc2626;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 20px;
  display: none;
}

.login-error.show {
  display: flex;
  align-items: center;
  gap: 10px;
}

.contact-admin {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid rgba(100, 116, 139, 0.2);
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

/* Auth Tabs */
.auth-tabs {
  display: flex;
  margin-bottom: 28px;
  background: rgba(100, 116, 139, 0.1);
  border-radius: 10px;
  padding: 4px;
}

.auth-tab {
  flex: 1;
  padding: 12px 20px;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s ease;
}

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

.auth-tab.active {
  background: white;
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Auth Message */
.auth-message {
  padding: 0;
  margin-bottom: 0;
  border-radius: 8px;
  font-size: 13px;
  transition: all 0.2s ease;
  overflow: hidden;
  max-height: 0;
}

.auth-message.error {
  max-height: 60px;
  padding: 12px 14px;
  margin-bottom: 20px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #dc2626;
}

.auth-message.success {
  max-height: 60px;
  padding: 12px 14px;
  margin-bottom: 20px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #059669;
}

/* Auth Form */
.auth-form.hidden {
  display: none;
}

.login-footer {
  margin-top: 32px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.6;
}

@media (max-width: 900px) {
  .login-page {
    grid-template-columns: 1fr;
  }
  .login-branding {
    display: none;
  }
  .login-form-section {
    min-height: 100vh;
  }
  .login-form-container {
    padding: 0 16px;
  }
  .login-header {
    margin-bottom: 24px;
  }
  .login-header::before {
    content: 'RayVin';
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: var(--accent-blue);
    margin-bottom: 24px;
  }
}

/* Dashboard */
.dashboard {
  padding: 30px 0;
}

.nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  margin-bottom: 30px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 600;
}

.nav-logo svg {
  width: 32px;
  height: 32px;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--btn-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

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

.stat-card {
  padding: 24px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.stat-icon.blue { background: rgba(59, 130, 246, 0.2); color: var(--accent-blue); }
.stat-icon.teal { background: rgba(20, 184, 166, 0.2); color: var(--accent-teal); }
.stat-icon.warning { background: rgba(245, 158, 11, 0.2); color: var(--warning); }
.stat-icon.danger { background: rgba(239, 68, 68, 0.2); color: var(--danger); }

.stat-value {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 4px;
}

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

/* Upload Zone */
.upload-zone {
  padding: 48px;
  text-align: center;
  border: 2px dashed rgba(100, 116, 139, 0.3);
  border-radius: 20px;
  margin-bottom: 30px;
  transition: all 0.3s;
  cursor: pointer;
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.05);
}

.upload-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  color: var(--text-muted);
}

.upload-text {
  font-size: 18px;
  margin-bottom: 8px;
}

.upload-hint {
  color: var(--text-muted);
  font-size: 14px;
}

/* Studies Table */
.studies-section {
  padding: 24px;
}

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

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

.studies-table {
  width: 100%;
  border-collapse: collapse;
}

.studies-table th,
.studies-table td {
  padding: 16px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.studies-table th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.studies-table tr:hover td {
  background: rgba(255, 255, 255, 0.2);
}

/* Urgency Badge */
.urgency-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}

.urgency-badge.emergent { background: rgba(220, 38, 38, 0.2); color: var(--urgent); }
.urgency-badge.urgent { background: rgba(239, 68, 68, 0.2); color: var(--danger); }
.urgency-badge.semi-urgent { background: rgba(245, 158, 11, 0.2); color: var(--warning); }
.urgency-badge.routine { background: rgba(16, 185, 129, 0.2); color: var(--success); }

/* Analysis Results */
.results-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 900px) {
  .results-container {
    grid-template-columns: 1fr;
  }
}

.findings-card, .report-card {
  padding: 24px;
}

.finding-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.finding-name {
  font-weight: 500;
}

.finding-confidence {
  display: flex;
  align-items: center;
  gap: 10px;
}

.confidence-bar {
  width: 100px;
  height: 6px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

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

.confidence-fill.high { background: var(--success); }
.confidence-fill.medium { background: var(--warning); }
.confidence-fill.low { background: var(--text-muted); }

.report-content {
  font-family: 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.8;
  white-space: pre-wrap;
  background: rgba(0, 0, 0, 0.05);
  padding: 20px;
  border-radius: 12px;
  max-height: 500px;
  overflow-y: auto;
}

/* Loading Spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--btn-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(184, 198, 219, 0.8);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  z-index: 1000;
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 16px 24px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideIn 0.3s ease;
  z-index: 1001;
}

.toast.success { background: var(--success); color: white; }
.toast.error { background: var(--danger); color: white; }
.toast.warning { background: var(--warning); color: white; }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Hidden */
.hidden { display: none !important; }

/* Responsive */
@media (max-width: 768px) {
  .login-card { padding: 32px 24px; }
  .nav-bar { flex-direction: column; gap: 16px; }
  .stats-grid { grid-template-columns: 1fr; }
}

