/* Drug Bank v6 - Full-Width Inline Expansion
 * Expanded content takes full width of container
 * No empty space beside expanded content
 */

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --secondary: #8b5cf6;
  --accent: #06b6d4;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  
  --bg-primary: #0f0a1e;
  --bg-secondary: #1a1525;
  --bg-tertiary: #251e35;
  --bg-card: #1e1830;
  --bg-hover: #2a2340;
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-accent: #a5b4fc;
  
  --border-color: #312b45;
  --border-light: #3d3654;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
  
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

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

/* ===== HEADER ===== */
.header {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

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

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

.logo-icon {
  font-size: 2rem;
  filter: drop-shadow(0 0 12px rgba(99, 102, 241, 0.4));
}

.logo-text h1 {
  font-size: 1.375rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-light), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-text p {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.stats {
  display: flex;
  gap: 1.25rem;
}

.stat {
  text-align: center;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-light);
  line-height: 1;
}

.stat-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ===== SEARCH SECTION ===== */
.search-section {
  background: var(--bg-secondary);
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

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

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 0.5rem 0.875rem;
  transition: var(--transition);
}

.search-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.search-icon {
  font-size: 1rem;
  margin-right: 0.5rem;
  color: var(--text-muted);
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
}

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

.clear-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.125rem;
  cursor: pointer;
  padding: 0.25rem;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.clear-btn.visible {
  opacity: 1;
  visibility: visible;
}

.clear-btn:hover {
  color: var(--danger);
}

/* ===== FILTERS ===== */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 0.75rem;
  justify-content: center;
}

.filter-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.75rem;
  white-space: nowrap;
}

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

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

/* ===== MAIN CONTENT ===== */
.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.25rem;
}

/* ===== LOADING & ERROR STATES ===== */
.loading-state, .error-state, .no-results {
  text-align: center;
  padding: 3rem 1.5rem;
}

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

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

.error-state h3, .no-results h3 {
  color: var(--danger);
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.error-state p, .no-results p {
  color: var(--text-muted);
}

/* ===== DRUG GRID - CSS GRID LAYOUT ===== */
.drug-grid {
  display: block;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  align-items: start;
}

/* ===== DRUG CARD WRAPPER ===== */
.drug-card-wrapper {
  display: flex;
  flex-direction: column;
}

/* When expanded, span full width */
.drug-card-wrapper.expanded {
  grid-column: 1 / -1;
}

.drug-card-wrapper.full-width {
  width: 100%;
}

/* ===== DRUG CARD ===== */
.drug-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem;
  cursor: pointer;
  transition: var(--transition);
}

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

.drug-card.expanded {
  border-color: var(--primary);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom: 1px solid var(--primary);
  box-shadow: none;
}

.drug-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
  gap: 0.5rem;
}

.drug-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
  line-height: 1.3;
}

.drug-category {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: 20px;
  font-size: 0.65rem;
  font-weight: 500;
  white-space: nowrap;
}

.drug-indication {
  color: var(--text-secondary);
  font-size: 0.8rem;
  margin-bottom: 0.625rem;
  line-height: 1.5;
}

.drug-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.625rem;
}

.drug-tag {
  background: var(--bg-tertiary);
  color: var(--text-accent);
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.65rem;
  font-weight: 500;
}

.drug-tag.dosing {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

.drug-tag.warning {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.drug-tag.interactions {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.drug-tag.notes {
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary-light);
}

.expand-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding-top: 0.625rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.75rem;
  transition: var(--transition);
}

.drug-card:hover .expand-hint {
  color: var(--primary-light);
}

.expand-icon {
  font-size: 0.65rem;
  transition: transform 0.3s ease;
}

.drug-card.expanded .expand-icon {
  transform: rotate(180deg);
}

/* ===== DRUG DETAIL PANEL (FULL WIDTH) ===== */
.drug-detail-panel {
  background: var(--bg-card);
  border: 1px solid var(--primary);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  animation: slideDown 0.3s ease;
  width: 100%;
}

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

.detail-content-wrapper {
  padding: 1.25rem;
}

/* ===== DETAIL HEADER ===== */
.detail-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.875rem;
  border-bottom: 2px solid var(--border-color);
}

.detail-header h2 {
  font-size: 1.375rem;
  color: var(--text-primary);
  font-weight: 700;
}

.detail-category {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
}

/* ===== TWO COLUMN LAYOUT ===== */
.detail-columns {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.detail-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ===== DETAIL SECTIONS ===== */
.detail-section {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.section-header {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
  padding: 0.625rem 0.875rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.section-icon {
  font-size: 1rem;
}

.section-content {
  padding: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 0.9rem;
}

.section-content p {
  margin-bottom: 0.625rem;
}

.section-content p:last-child {
  margin-bottom: 0;
}

/* ===== SUBSECTIONS ===== */
.subsection {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-light);
}

.subsection:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.subsection h4 {
  font-size: 0.875rem;
  color: var(--primary-light);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.subsection h5 {
  font-size: 0.8rem;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
  font-weight: 600;
}

/* ===== LISTS ===== */
.updates-list, .pearls-list, .recommendations {
  list-style: none;
  padding: 0;
}

.updates-list li, .recommendations li {
  position: relative;
  padding-left: 1rem;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
}

.updates-list li::before, .recommendations li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: bold;
}

.pearls-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.pearl-item {
  position: relative;
  padding: 0.5rem 0.75rem 0.5rem 1.75rem;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.pearl-item::before {
  content: '💡';
  position: absolute;
  left: 0.4rem;
}

/* ===== FAILURE SCENARIOS ===== */
.failure-scenarios-section {
  background: rgba(239, 68, 68, 0.05);
}

.failure-scenarios-section h4 {
  color: var(--danger);
}

.scenario-item {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  margin-bottom: 0.625rem;
}

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

.scenario-item h5 {
  color: var(--danger);
  font-size: 0.85rem;
}

/* ===== COMBINATION THERAPY ===== */
.combination-section {
  background: rgba(16, 185, 129, 0.05);
}

.combination-section h4 {
  color: var(--success);
}

.combo-item {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  margin-bottom: 0.625rem;
}

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

.combo-item h5 {
  color: var(--success);
  font-size: 0.85rem;
}

/* ===== LINE POSITION ===== */
.line-position {
  background: rgba(99, 102, 241, 0.1);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary);
  margin-top: 0.625rem;
  font-size: 0.85rem;
}

/* ===== COMPARISON ===== */
.comparison-section .section-header {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(139, 92, 246, 0.05));
}

.comparison-item {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  margin-bottom: 0.75rem;
}

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

.comparison-item h4 {
  color: var(--secondary);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

/* ===== DOSING ===== */
.dosing-section .section-header {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
}

.dosing-item {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  margin-bottom: 0.75rem;
}

.dosing-item.even {
  background: var(--bg-tertiary);
}

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

.dosing-item h4 {
  color: var(--success);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.dose-details {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.dose-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  font-size: 0.85rem;
}

.dose-label {
  color: var(--text-muted);
  font-weight: 500;
  min-width: 70px;
}

.dose-value {
  color: var(--text-secondary);
  flex: 1;
}

/* ===== CONTRAINDICATIONS ===== */
.contraindications-section .section-header {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05));
}

.contra-item {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  margin-bottom: 0.75rem;
}

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

.contra-item h4 {
  color: var(--danger);
  font-size: 0.875rem;
  margin-bottom: 0.4rem;
}

/* ===== ADVERSE EFFECTS ===== */
.adverse-effects-section .section-header {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.05));
}

.effect-item {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  margin-bottom: 0.75rem;
}

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

.effect-item h4 {
  color: var(--warning);
  font-size: 0.875rem;
  margin-bottom: 0.4rem;
}

/* ===== INTERACTIONS - 3 COLUMN GRID ===== */
.interactions-section .section-header {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.1), rgba(6, 182, 212, 0.05));
}

.interactions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.interaction-category {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
}

.interaction-category h4 {
  font-size: 0.875rem;
  margin-bottom: 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.interaction-category.synergism h4 {
  color: var(--success);
}

.interaction-category.additive h4 {
  color: var(--info);
}

.interaction-category.antagonism h4 {
  color: var(--danger);
}

.interaction-category.drug-conditions h4 {
  color: var(--warning);
}

.interaction-category.drug-food h4 {
  color: var(--accent);
}

.interaction-category.genes h4 {
  color: var(--secondary);
}

.cat-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 0.5rem;
}

.interaction-category ul {
  list-style: none;
  padding: 0;
}

.interaction-category li {
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
}

.interaction-category li:last-child {
  margin-bottom: 0;
}

.interaction-category li strong {
  color: var(--text-primary);
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.8rem;
}

.interaction-category li p {
  margin: 0;
  font-size: 0.8rem;
}

.mutation {
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* ===== MONITORING ===== */
.monitoring-section .section-header {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(99, 102, 241, 0.05));
}

/* ===== SPECIAL POPULATIONS ===== */
.special-section .section-header {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(139, 92, 246, 0.05));
}

.population-item {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  margin-bottom: 0.75rem;
}

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

.population-item h4 {
  color: var(--secondary);
  font-size: 0.875rem;
  margin-bottom: 0.4rem;
}

.special-notes {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  margin-top: 0.75rem;
}

.special-notes h4 {
  color: var(--warning);
  margin-bottom: 0.4rem;
}

/* ===== TRADE NAMES ===== */
.trade-names-section .section-header {
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.1), rgba(148, 163, 184, 0.05));
}

.trade-names-group {
  margin-bottom: 0.75rem;
}

.trade-names-group:last-child {
  margin-bottom: 0;
}

.trade-names-group h4 {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 0.3rem;
}

.trade-names-group p {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* ===== UTILITY CLASSES ===== */
.label {
  font-weight: 500;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.label.success, .label.alt {
  color: var(--success);
}

.label.warning {
  color: var(--warning);
}

.label.danger {
  color: var(--danger);
}

.label.info {
  color: var(--info);
}

.label.clinical {
  color: var(--primary-light);
}

.label.evidence {
  color: var(--success);
  font-style: italic;
}

.no-data {
  color: var(--text-muted);
  font-style: italic;
  padding: 0.75rem;
  text-align: center;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.guideline-source {
  font-weight: 600;
  color: var(--info);
}

.evidence-level {
  background: rgba(59, 130, 246, 0.1);
  padding: 0.4rem 0.625rem;
  border-radius: var(--radius-sm);
  margin-top: 0.4rem;
  font-size: 0.85rem;
}

/* ===== FOOTER ===== */
.footer {
  text-align: center;
  padding: 1.5rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.8rem;
}

.footer a {
  color: var(--primary-light);
  text-decoration: none;
}

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

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 3px;
}

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

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Large screens */
@media (min-width: 1400px) {
  .cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .interactions-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Laptops */
@media (max-width: 1200px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .interactions-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .detail-columns {
    grid-template-columns: 1fr;
  }
}

/* Tablets */
@media (max-width: 768px) {
  .header {
    padding: 0.875rem 1rem;
  }
  
  .header-content {
    flex-direction: column;
    gap: 0.625rem;
  }
  
  .logo-text h1 {
    font-size: 1.125rem;
  }
  
  .stats {
    width: 100%;
    justify-content: center;
    gap: 1.5rem;
  }
  
  .stat-value {
    font-size: 1.25rem;
  }
  
  .search-section {
    padding: 0.875rem 1rem;
  }
  
  .main-content {
    padding: 0.875rem;
  }
  
  .cards-grid {
    grid-template-columns: 1fr;
    gap: 0.875rem;
  }
  
  /* When expanded on mobile, keep full width */
  .drug-card-wrapper.expanded {
    grid-column: 1;
  }
  
  .detail-content-wrapper {
    padding: 0.875rem;
  }
  
  .detail-header h2 {
    font-size: 1.125rem;
  }
  
  .detail-columns {
    grid-template-columns: 1fr;
    gap: 0.875rem;
  }
  
  .interactions-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .section-header {
    padding: 0.5rem 0.75rem;
  }
  
  .section-header h3 {
    font-size: 0.875rem;
  }
  
  .section-content {
    padding: 0.75rem;
    font-size: 0.85rem;
  }
  
  .filters {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.4rem;
    -webkit-overflow-scrolling: touch;
  }
  
  .filter-btn {
    flex-shrink: 0;
  }
}

/* Mobile */
@media (max-width: 480px) {
  .logo-icon {
    font-size: 1.625rem;
  }
  
  .logo-text h1 {
    font-size: 1rem;
  }
  
  .logo-text p {
    font-size: 0.65rem;
  }
  
  .stat-value {
    font-size: 1.125rem;
  }
  
  .stat-label {
    font-size: 0.6rem;
  }
  
  .drug-card {
    padding: 0.875rem;
  }
  
  .drug-name {
    font-size: 0.925rem;
  }
  
  .drug-category {
    font-size: 0.6rem;
    padding: 0.15rem 0.4rem;
  }
  
  .drug-indication {
    font-size: 0.8rem;
  }
  
  .drug-tag {
    font-size: 0.6rem;
    padding: 0.15rem 0.3rem;
  }
  
  .expand-hint {
    font-size: 0.7rem;
  }
  
  .detail-content-wrapper {
    padding: 0.75rem;
  }
  
  .subsection h4 {
    font-size: 0.825rem;
  }
  
  .subsection h5 {
    font-size: 0.775rem;
  }
  
  .dose-label {
    min-width: 65px;
    font-size: 0.8rem;
  }
  
  .dose-value {
    font-size: 0.8rem;
  }
  
  .interaction-category h4 {
    font-size: 0.825rem;
  }
  
  .cat-desc {
    font-size: 0.7rem;
  }
  
  .pearl-item {
    font-size: 0.8rem;
  }
  
  .scenario-item,
  .combo-item,
  .contra-item,
  .effect-item,
  .population-item {
    padding: 0.625rem;
  }
  
  .section-content {
    font-size: 0.85rem;
  }
}

/* Small mobile */
@media (max-width: 360px) {
  .cards-grid {
    gap: 0.625rem;
  }
  
  .drug-card {
    padding: 0.75rem;
  }
  
  .detail-content-wrapper {
    padding: 0.625rem;
  }
  
  .section-content {
    padding: 0.625rem;
  }
}

/* Landscape mobile */
@media (max-height: 500px) and (orientation: landscape) {
  .header {
    position: relative;
  }
  
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Print */
@media print {
  .header, .search-section, .footer {
    display: none;
  }
  
  .drug-detail-panel {
    display: block !important;
    page-break-inside: avoid;
  }
  
  .drug-card {
    page-break-inside: avoid;
  }
  
  body {
    background: white;
    color: black;
  }
  
  .detail-section {
    border: 1px solid #ccc;
    page-break-inside: avoid;
  }
}

/* Focus states */
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.drug-card:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Selection */
::selection {
  background: rgba(99, 102, 241, 0.3);
  color: var(--text-primary);
}
