/**
 * Drug Bank v3 - High Contrast Design with Bold Text
 * Deep Gray/Blue Theme with Improved Readability
 */

/* CSS Variables */
:root {
  --bg-primary: #080c14;
  --bg-secondary: #0a0f17;
  --bg-card: #111827;
  --bg-detail: #0d111a;
  
  --blue-primary: #3b82f6;
  --blue-light: #60a5fa;
  --blue-dark: #2563eb;
  --blue-glow: rgba(59, 130, 246, 0.4);
  
  /* High Contrast Text - Pure White */
  --text-primary: #ffffff;
  --text-secondary: #f1f5f9;
  --text-tertiary: #cbd5e1;
  --text-muted: #94a3b8;
  
  /* Section Colors - Bright for contrast */
  --color-dosing: #22c55e;        /* Bright Green */
  --color-indication: #3b82f6;    /* Blue */
  --color-warning: #f59e0b;       /* Orange */
  --color-danger: #ef4444;        /* Red */
  --color-interactions: #a855f7;  /* Purple */
  --color-monitoring: #06b6d4;    /* Cyan */
  --color-trade: #ec4899;         /* Pink */
  --color-notes: #84cc16;         /* Lime */
  --color-effects: #f97316;       /* Orange-Red */
  
  --border-color: rgba(75, 85, 99, 0.5);
  --border-hover: rgba(59, 130, 246, 0.6);
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 30px rgba(59, 130, 246, 0.2);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Header */
.header {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
  border-bottom: 1px solid var(--border-color);
  padding: 24px 20px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

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

.logo-icon {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--blue-primary), var(--blue-dark));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: var(--shadow-glow);
}

.logo-text h1 {
  font-size: 28px;
  font-weight: 900;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.logo-text p {
  font-size: 13px;
  color: var(--text-tertiary);
  margin: 4px 0 0 0;
  font-weight: 500;
}

.stats {
  display: flex;
  gap: 32px;
}

.stat {
  text-align: center;
}

.stat-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--blue-light);
  text-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
}

/* Search Section */
.search-section {
  background: var(--bg-secondary);
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
}

.search-container {
  max-width: 1200px;
  margin: 0 auto;
}

.search-box {
  position: relative;
  margin-bottom: 16px;
}

.search-input {
  width: 100%;
  padding: 16px 20px 16px 52px;
  font-size: 16px;
  font-weight: 500;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  color: var(--text-primary);
  transition: var(--transition);
}

.search-input:focus {
  outline: none;
  border-color: var(--blue-primary);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

.search-input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: var(--text-muted);
}

.clear-btn {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--border-color);
  border: none;
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  font-weight: 600;
  display: none;
  transition: var(--transition);
}

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

.clear-btn.visible {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Filters */
.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 10px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-btn:hover {
  border-color: var(--blue-primary);
  color: var(--blue-light);
  background: rgba(59, 130, 246, 0.1);
}

.filter-btn.active {
  background: var(--blue-primary);
  border-color: var(--blue-primary);
  color: white;
  font-weight: 700;
}

/* Main Content */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px;
}

/* Loading & Error States */
.loading-state, .error-state, .no-results {
  text-align: center;
  padding: 60px 20px;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--border-color);
  border-top-color: var(--blue-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

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

.error-state {
  color: var(--color-danger);
  font-weight: 600;
}

/* Drug Grid - Single Column Full Width */
.drug-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Drug Card - Full Width */
.drug-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
}

.drug-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.drug-header {
  padding: 20px 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, transparent 100%);
}

.drug-title-section {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.drug-name {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  letter-spacing: -0.3px;
}

.drug-category {
  font-size: 11px;
  padding: 6px 14px;
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.4);
  border-radius: var(--radius-xl);
  color: var(--blue-light);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.drug-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.drug-badge {
  font-size: 11px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  letter-spacing: 0.3px;
}

.badge-dosing {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-interactions {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.badge-monitoring {
  background: rgba(6, 182, 212, 0.2);
  color: #22d3ee;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.expand-icon {
  font-size: 14px;
  color: var(--text-muted);
  transition: transform 0.3s;
  font-weight: 700;
}

.expand-icon.expanded {
  transform: rotate(90deg);
  color: var(--blue-light);
}

.drug-indication {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1.7;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.3);
}

/* Drug Details (Inline Expansion) */
.drug-details {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease-out;
  background: var(--bg-detail);
}

.drug-details.expanded {
  max-height: 5000px;
  transition: max-height 0.5s ease-in;
}

/* Detail Section - Color Coded */
.detail-section {
  padding: 24px;
  border-bottom: 1px solid var(--border-color);
  border-left: 4px solid transparent;
}

.detail-section:last-child {
  border-bottom: none;
}

.detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.detail-icon {
  font-size: 22px;
}

.detail-title {
  font-size: 15px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.detail-content {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.9;
}

.detail-content p {
  margin: 0 0 12px 0;
  color: var(--text-secondary);
  font-weight: 600;
}

.detail-content ul {
  margin: 0;
  padding-left: 24px;
}

.detail-content li {
  margin-bottom: 12px;
  color: var(--text-secondary);
  font-weight: 600;
}

/* Section Colors */
.detail-indication {
  border-left-color: var(--color-indication);
  background: rgba(59, 130, 246, 0.08);
}
.detail-indication .detail-title {
  color: var(--color-indication);
}

.detail-dosing {
  border-left-color: var(--color-dosing);
  background: rgba(34, 197, 94, 0.08);
}
.detail-dosing .detail-title {
  color: var(--color-dosing);
}

.detail-warning {
  border-left-color: var(--color-warning);
  background: rgba(245, 158, 11, 0.08);
}
.detail-warning .detail-title {
  color: var(--color-warning);
}

.detail-danger {
  border-left-color: var(--color-danger);
  background: rgba(239, 68, 68, 0.08);
}
.detail-danger .detail-title {
  color: var(--color-danger);
}

.detail-effects {
  border-left-color: var(--color-effects);
  background: rgba(249, 115, 22, 0.08);
}
.detail-effects .detail-title {
  color: var(--color-effects);
}

.detail-interactions {
  border-left-color: var(--color-interactions);
  background: rgba(168, 85, 247, 0.08);
}
.detail-interactions .detail-title {
  color: var(--color-interactions);
}

.detail-monitoring {
  border-left-color: var(--color-monitoring);
  background: rgba(6, 182, 212, 0.08);
}
.detail-monitoring .detail-title {
  color: var(--color-monitoring);
}

.detail-trade {
  border-left-color: var(--color-trade);
  background: rgba(236, 72, 153, 0.08);
}
.detail-trade .detail-title {
  color: var(--color-trade);
}

.detail-notes {
  border-left-color: var(--color-notes);
  background: rgba(132, 204, 22, 0.08);
}
.detail-notes .detail-title {
  color: var(--color-notes);
}

/* Subsection Title */
.subsection-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 20px 0 12px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.subsection-title:first-child {
  margin-top: 0;
}

/* Dosing Styles */
.dosing-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dosing-item {
  background: rgba(0, 0, 0, 0.2);
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.detailed-dosing {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dosing-card {
  background: rgba(0, 0, 0, 0.2);
  padding: 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.dosing-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-dosing);
  margin-bottom: 12px;
}

.dosing-line {
  margin-bottom: 8px;
  line-height: 1.6;
}

.dosing-key {
  color: var(--text-primary);
  font-weight: 800;
}

.dosing-value {
  color: var(--text-secondary);
  font-weight: 600;
}

/* Object List Styles */
.object-list {
  list-style: none;
  padding: 0;
}

.object-item {
  background: rgba(0, 0, 0, 0.2);
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  margin-bottom: 12px;
}

.object-item:last-child {
  margin-bottom: 0;
}

.object-item strong {
  color: var(--text-primary);
  font-weight: 700;
}

/* Consideration Items */
.consideration-item {
  background: rgba(0, 0, 0, 0.2);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  border: 1px solid var(--border-color);
}

.consideration-item strong {
  color: var(--color-warning);
  font-weight: 700;
}

/* Footer */
.footer {
  text-align: center;
  padding: 30px 20px;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
}

.footer a {
  color: var(--blue-light);
  text-decoration: none;
  font-weight: 600;
}

.footer a:hover {
  text-decoration: underline;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--blue-primary);
}

/* Responsive */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    text-align: center;
  }
  
  .stats {
    width: 100%;
    justify-content: center;
  }
  
  .drug-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .drug-title-section {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }
  
  .drug-name {
    font-size: 18px;
  }
  
  .drug-badges {
    width: 100%;
  }
  
  .filters {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 5px;
  }
  
  .detail-section {
    padding: 20px 16px;
  }
  
  .detail-title {
    font-size: 13px;
  }
}

/* Note Object (for failure_scenarios and combination_therapy) */
.note-object {
  background: rgba(0, 0, 0, 0.25);
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  margin-bottom: 12px;
  list-style: none;
}

.note-object div {
  margin-bottom: 8px;
  line-height: 1.7;
  font-weight: 600;
  color: var(--text-secondary);
}

.note-object div:last-child {
  margin-bottom: 0;
}

.note-object strong {
  color: var(--color-notes);
  font-weight: 800;
}
