/* Modern RAMIE-Style Design for AI Dermatology Scribe */

/* ========== CSS Variables ========== */
:root {
  /* Dark Theme Colors - RAMIE Style */
  --bg-primary: #0f1419; /* Deep navy background */
  --bg-secondary: #1a1f29; /* Slightly lighter navy */
  --bg-tertiary: #242a38; /* Card backgrounds */
  --bg-hover: #2d3548; /* Hover state */
  --bg-input: #1e2430; /* Input fields */

  /* Text Colors */
  --text-primary: #e2e8f0; /* Main text */
  --text-secondary: #94a3b8; /* Secondary text */
  --text-tertiary: #64748b; /* Muted text */
  --text-inverse: #0f1419; /* Text on bright backgrounds */

  /* Accent Colors - Cyan/Turquoise */
  --accent-primary: #4dd0e1; /* Main cyan accent */
  --accent-secondary: #26c6da; /* Darker cyan */
  --accent-hover: #67e8f9; /* Lighter cyan on hover */
  --accent-muted: rgba(77, 208, 225, 0.1); /* Muted cyan background */

  /* Status Colors */
  --success: #4dd0e1; /* Using cyan for success */
  --warning: #fbbf24;
  --error: #ef4444;
  --info: #60a5fa;

  /* Borders */
  --border-primary: rgba(148, 163, 184, 0.1); /* Very subtle borders */
  --border-secondary: rgba(148, 163, 184, 0.2);
  --border-focus: var(--accent-primary);

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 16px 32px rgba(0, 0, 0, 0.6);

  /* Layout */
  --border-radius: 12px;
  --border-radius-sm: 8px;
  --border-radius-lg: 16px;
  --header-height: 64px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, var(--bg-primary) 0%, #0a0e13 100%);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========== Header ========== */
.modern-header {
  background: rgba(15, 20, 25, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-primary);
  height: var(--header-height);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0 2rem;
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.app-title {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* ========== Modern Buttons ========== */
.btn-modern {
  padding: 0.5rem 1.25rem;
  border-radius: var(--border-radius-sm);
  font-weight: 500;
  font-size: 0.875rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: -0.01em;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: var(--text-inverse);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-hover), var(--accent-primary));
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(77, 208, 225, 0.3);
}

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

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

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
}

.btn-ghost:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
}

.btn-success {
  background: rgba(77, 208, 225, 0.1);
  color: var(--accent-primary);
  border: 1px solid rgba(77, 208, 225, 0.2);
}

.btn-success:hover {
  background: rgba(77, 208, 225, 0.2);
}

/* Icon buttons */
.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}

/* ========== Cards ========== */
.card {
  background: var(--bg-tertiary);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-primary);
  overflow: hidden;
  transition: all 0.2s ease;
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-primary);
}

.card-header {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-title-icon {
  color: var(--accent-primary);
  font-size: 20px;
}

.card-body {
  padding: 1.25rem;
}

.card-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-primary);
  background: rgba(15, 20, 25, 0.3);
}

/* ========== Grid Layout ========== */
.main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  padding: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

.panel {
  min-height: 400px;
  display: flex;
  flex-direction: column;
}

.panel-content {
  flex: 1;
  padding: 1.25rem;
  overflow-y: auto;
  background: var(--bg-secondary);
  border-radius: 0 0 var(--border-radius) var(--border-radius);
}

/* Custom scrollbar */
.panel-content::-webkit-scrollbar {
  width: 6px;
}

.panel-content::-webkit-scrollbar-track {
  background: var(--bg-primary);
  border-radius: 3px;
}

.panel-content::-webkit-scrollbar-thumb {
  background: var(--bg-hover);
  border-radius: 3px;
}

.panel-content::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

/* ========== Forms ========== */
.form-group {
  margin-bottom: 1.25rem;
}

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

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-primary);
  border-radius: var(--border-radius-sm);
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(77, 208, 225, 0.1);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
  font-family: inherit;
}

/* ========== Transcript Area ========== */
.transcript-area {
  background: var(--bg-secondary);
  border-radius: var(--border-radius-sm);
  padding: 1rem;
  min-height: 300px;
  max-height: 500px;
  overflow-y: auto;
  border: 1px solid var(--border-primary);
}

.transcript-placeholder {
  color: var(--text-tertiary);
  font-style: italic;
}

.transcript-text {
  color: var(--text-primary);
  line-height: 1.8;
}

.transcript-text p {
  margin-bottom: 0.75rem;
}

/* ========== Status Indicators ========== */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
}

.status-recording {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.status-recording::before {
  content: '';
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

.status-idle {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-secondary);
  border: 1px solid var(--border-primary);
}

.status-processing {
  background: rgba(77, 208, 225, 0.1);
  color: var(--accent-primary);
  border: 1px solid rgba(77, 208, 225, 0.2);
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* ========== Landing Page Styles ========== */
.landing-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.landing-card {
  background: var(--bg-tertiary);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-primary);
  padding: 3rem;
  max-width: 500px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-xl);
}

.landing-logo {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
}

.landing-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.landing-subtitle {
  color: var(--accent-primary);
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.landing-description {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 2rem;
  line-height: 1.6;
}

.mode-grid {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
}

.mode-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-primary);
  box-shadow: 0 4px 12px rgba(77, 208, 225, 0.2);
}

.mode-icon {
  color: var(--accent-primary);
  font-size: 24px;
  margin-bottom: 0.75rem;
}

.mode-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.mode-description {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.5;
}

/* ========== Chat Mode Styles ========== */
.chat-container {
  height: calc(100vh - var(--header-height));
  display: flex;
  flex-direction: column;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

.chat-messages {
  flex: 1;
  background: var(--bg-tertiary);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-primary);
  padding: 1.5rem;
  overflow-y: auto;
  margin-bottom: 1.5rem;
}

.chat-message {
  margin-bottom: 1.5rem;
  display: flex;
  gap: 1rem;
}

.chat-message-ai {
  justify-content: flex-start;
}

.chat-message-user {
  justify-content: flex-end;
}

.chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-content {
  max-width: 70%;
  background: var(--bg-secondary);
  border-radius: var(--border-radius);
  padding: 1rem;
  border: 1px solid var(--border-primary);
}

.chat-message-user .chat-content {
  background: rgba(77, 208, 225, 0.1);
  border-color: rgba(77, 208, 225, 0.2);
}

.chat-input-container {
  display: flex;
  gap: 1rem;
  background: var(--bg-tertiary);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-primary);
  padding: 1rem;
}

.chat-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-primary);
  border-radius: var(--border-radius-sm);
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  font-size: 0.875rem;
}

.chat-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(77, 208, 225, 0.1);
}

/* ========== Loading States ========== */
.loading-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-primary);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.skeleton {
  background: linear-gradient(90deg,
    var(--bg-secondary) 0%,
    var(--bg-hover) 50%,
    var(--bg-secondary) 100%);
  background-size: 200% 100%;
  animation: skeleton 1.5s ease infinite;
  border-radius: var(--border-radius-sm);
}

@keyframes skeleton {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* ========== Responsive Design ========== */
@media (max-width: 1024px) {
  .main-grid {
    grid-template-columns: 1fr;
  }

  .panel {
    min-height: 350px;
  }
}

@media (max-width: 768px) {
  .modern-header {
    padding: 0 1rem;
  }

  .main-grid {
    padding: 1rem;
    gap: 1rem;
  }

  .landing-card {
    padding: 2rem;
  }

  .chat-content {
    max-width: 85%;
  }

  .header-actions {
    gap: 0.5rem;
  }

  .btn-modern {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
  }
}

/* ========== Utility Classes ========== */
.text-muted {
  color: var(--text-tertiary);
}

.text-accent {
  color: var(--accent-primary);
}

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }

.hidden { display: none !important; }
.opacity-50 { opacity: 0.5; }
.cursor-not-allowed { cursor: not-allowed; }