
/* ========================================
   MOLFORGE ODYSSEY - COMPLETE STYLESHEET
   Version 7.0.0 - Odyssey Edition
   ======================================== */

/* ========================================
   CSS VARIABLES
   ======================================== */
:root {
  --bg-primary: #0a0e27;
  --bg-secondary: #151932;
  --text-primary: #e8eaed;
  --text-secondary: #9aa0a6;
  --accent-primary: #00d4ff;
  --accent-secondary: #7c3aed;
  --accent-gradient: linear-gradient(135deg, #00d4ff 0%, #7c3aed 100%);
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --card-bg: rgba(30, 35, 56, 0.6);
  --card-border: rgba(255, 255, 255, 0.1);
  --glass-bg: rgba(30, 35, 56, 0.5);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 30px rgba(0, 212, 255, 0.4);
  --navbar-height: 56px;
  --border-radius: 12px;
  --transition-speed: 0.3s;
}

body.light-theme {
  --bg-primary: #f0f4f8;
  --bg-secondary: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --accent-primary: #0ea5e9;
  --accent-secondary: #8b5cf6;
  --card-bg: rgba(255, 255, 255, 0.7);
  --card-border: rgba(0, 0, 0, 0.1);
  --glass-bg: rgba(255, 255, 255, 0.6);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.15);
}

/* ========================================
   BASE STYLES
   ======================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  transition: background-color var(--transition-speed) ease;
  overflow-x: hidden;
  line-height: 1.6;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--accent-primary);
  color: white;
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
  }
  50% {
    box-shadow: 0 0 35px rgba(0, 212, 255, 0.6);
  }
}

@keyframes spin {
  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes gradientShift {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.section-reveal {
  animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.section-hidden {
  opacity: 0;
  transform: translateY(20px);
}

/* ========================================
   NAVBAR
   ======================================== */
.navbar {
  height: var(--navbar-height);
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--card-border);
  box-shadow: var(--shadow-md);
  z-index: 1050;
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.25rem;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: transform 0.3s ease;
}

.navbar-brand:hover {
  transform: scale(1.05);
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--card-border);
  color: var(--text-primary);
}

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

/* ========================================
   MAIN CONTENT
   ======================================== */
#mainContent {
  padding-top: calc(var(--navbar-height) + 1rem);
  min-height: calc(100vh - var(--navbar-height));
}

.section {
  padding: 1.5rem 0;
}

.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.display-4 {
  font-size: 2rem;
}

.lead {
  font-size: 1rem;
}

/* ========================================
   SEARCH SECTION
   ======================================== */
.search-container {
  max-width: 100%;
  margin: 1.5rem auto;
  padding: 0 1rem;
}

.search-box-wrapper {
  position: relative;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border: 2px solid var(--card-border);
  border-radius: 16px;
  padding: 0.375rem;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
}

.search-box:focus-within {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-glow);
}

.search-icon {
  position: absolute;
  left: 1rem;
  color: var(--text-secondary);
  font-size: 1rem;
  z-index: 1;
}

.search-input {
  flex: 1;
  padding: 0.75rem 0.75rem 0.75rem 2.75rem;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
  min-width: 0;
}

.search-input::placeholder {
  color: var(--text-secondary);
  opacity: 0.7;
}

.search-button {
  padding: 0.75rem 1.25rem;
  background: var(--accent-gradient);
  color: white;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
  white-space: nowrap;
  flex-shrink: 0;
}

.search-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 212, 255, 0.5);
}

/* ========================================
   AUTOCOMPLETE
   ======================================== */
.autocomplete-results {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
  -webkit-overflow-scrolling: touch;
}

.autocomplete-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 1px solid var(--card-border);
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover {
  background: rgba(0, 212, 255, 0.1);
}

.autocomplete-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-gradient);
  border-radius: 8px;
  color: white;
  flex-shrink: 0;
}

.autocomplete-content {
  flex: 1;
  min-width: 0;
}

.autocomplete-title {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.autocomplete-meta {
  display: flex;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* ========================================
   ODYSSEY CONTAINER - MAIN LAYOUT
   ======================================== */
.odyssey-container {
  padding: 2rem 1rem;
  animation: fadeInUp 0.6s ease-out;
}

.odyssey-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0 0.5rem;
}

.odyssey-title h2 {
  font-size: 1.75rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.odyssey-title h2 i {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.odyssey-title p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 0.25rem 0 0 0;
}

/* ========================================
   ODYSSEY GRID LAYOUT
   ======================================== */
.odyssey-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.5rem;
  min-height: 600px;
}

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

.odyssey-main {
  min-height: 600px;
}

/* ========================================
   CHEMICAL SPACE CANVAS
   ======================================== */
.chem-space-canvas {
  width: 100%;
  height: 600px;
  position: relative;
  background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 100%);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: inset 0 2px 20px rgba(0, 0, 0, 0.5);
  border: 2px solid var(--card-border);
}

.chem-space-canvas canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
  touch-action: none;
}

.chem-space-canvas canvas.dragging {
  cursor: grabbing !important;
}

/* ========================================
   WORKSPACE
   ======================================== */
.workspace-table-container {
  max-height: 400px;
  overflow-y: auto;
  margin-bottom: 0.5rem;
}

.workspace-table-container::-webkit-scrollbar {
  width: 6px;
}

.workspace-table-container::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 3px;
}

.workspace-table-container::-webkit-scrollbar-thumb {
  background: var(--accent-primary);
  border-radius: 3px;
}

.workspace-table-container::-webkit-scrollbar-thumb:hover {
  background: var(--accent-secondary);
}

.workspace-table-container table {
  font-size: 0.85rem;
}

.workspace-table-container tbody tr {
  cursor: pointer;
  transition: all 0.2s ease;
}

.workspace-table-container tbody tr:hover {
  background: rgba(0, 212, 255, 0.1);
  transform: translateX(3px);
}

#workspace-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 150px;
}

/* ========================================
   MAP INSTRUCTIONS
   ======================================== */
.map-instructions {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
  padding: 0.75rem;
  background: var(--bg-secondary);
  border-radius: 8px;
}

.map-instructions span {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.map-instructions strong {
  color: var(--text-primary);
  font-weight: 600;
}

.map-instructions i {
  color: var(--accent-primary);
}

/* ========================================
   FILTER SECTION
   ======================================== */
.filter-section {
  padding-top: 0.5rem;
  border-top: 1px solid var(--card-border);
}

.form-check-label i {
  font-size: 0.85rem;
  margin-right: 0.25rem;
}

/* ========================================
   ODYSSEY STATS
   ======================================== */
.odyssey-stats {
  border: 1px solid var(--card-border);
}

.odyssey-stats .small {
  line-height: 1.5;
}

/* ========================================
   COMPOUND CHIPS
   ======================================== */
.compound-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.compound-chip:hover {
  background: var(--card-border);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 212, 255, 0.2);
}

.compound-chip-close {
  margin-left: 0.25rem;
  padding: 0.25rem;
  border-radius: 50%;
  transition: all 0.2s ease;
  color: var(--text-secondary);
}

.compound-chip-close:hover {
  background: var(--danger);
  color: white;
}

/* ========================================
   PROGRESS BAR
   ======================================== */
.progress-container {
  max-width: 100%;
  margin: 1rem auto;
  position: relative;
  height: 6px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  overflow: hidden;
}

.progress-bar-custom {
  height: 100%;
  background: var(--accent-gradient);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
  border-radius: 10px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.6);
}

.progress-text {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
}

/* ========================================
   COMPOUND HEADER
   ======================================== */
.compound-header {
  padding: 1.5rem 0;
}

.compound-title {
  font-size: 1.75rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
}

.compound-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.compound-badges {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.badge-custom {
  padding: 0.375rem 0.875rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  backdrop-filter: blur(10px);
}

/* ========================================
   VIEWER SECTION
   ======================================== */
.viewer-section {
  padding: 0 1rem;
}

.viewer-card {
  border: 2px solid var(--card-border);
  transition: all 0.3s ease;
}

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

.viewer-3d-large {
  width: 100%;
  height: 400px;
  border-radius: 12px;
  background-color: #000;
  position: relative;
  border: 2px solid var(--card-border);
  overflow: hidden;
  box-shadow: inset 0 2px 20px rgba(0, 0, 0, 0.5);
  touch-action: none;
}

.spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2.5rem;
  color: var(--accent-primary);
  animation: spin 1s linear infinite;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.spinner-text {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.spinner::after {
  content: 'Loading...';
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.viewer-info {
  margin-top: 0.875rem;
}

.info-badge {
  padding: 0.5rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  border: 1px solid var(--card-border);
  text-align: center;
}

.info-badge i {
  color: var(--accent-primary);
  margin-right: 0.25rem;
}

/* ========================================
   SECTION TITLE
   ======================================== */
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  position: relative;
  display: inline-block;
  padding-bottom: 0.75rem;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--accent-gradient);
  border-radius: 2px;
}

.section-title i {
  color: var(--accent-primary);
  margin-right: 0.5rem;
}

/* ========================================
   GLASS CARD
   ======================================== */
.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  position: relative;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity var(--transition-speed) ease;
}

.glass-card:hover::before {
  opacity: 1;
}

.load-success {
  animation: pulse-glow 0.5s ease-out;
}

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

.card-title-icon i {
  color: var(--accent-primary);
  font-size: 1.25rem;
}

/* ========================================
   METRIC CARDS
   ======================================== */
.metric-card {
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: 12px;
  padding: 1.25rem 1rem;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  height: 100%;
  backdrop-filter: blur(10px);
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.metric-card:hover::before {
  transform: scaleX(1);
}

.metric-card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  border-color: var(--accent-primary);
}

.metric-icon {
  font-size: 2.25rem;
  margin-bottom: 0.75rem;
  display: inline-block;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.metric-value {
  font-size: 1.875rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0.375rem 0;
  line-height: 1.2;
}

.metric-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-top: 0.375rem;
}

.metric-unit {
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-weight: 400;
  margin-top: 0.25rem;
}

/* ========================================
   DRUG-LIKENESS
   ======================================== */
.druglike-rule {
  padding: 1.25rem;
  background: var(--bg-secondary);
  border-radius: 12px;
  border: 1px solid var(--card-border);
  height: 100%;
}

.rule-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.375rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.rule-title i {
  color: var(--accent-primary);
}

.rule-description {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.875rem;
}

.rule-checks {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.rule-summary {
  padding: 0.875rem;
  background: var(--card-bg);
  border-radius: 10px;
  border: 2px solid transparent;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.875rem;
  transition: all 0.3s ease;
}

.rule-summary.pass {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.1);
}

.rule-summary.fail {
  border-color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

.rule-summary-score {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.score-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
}

.score-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.rule-summary-status {
  font-size: 1.1rem;
  font-weight: 700;
  padding: 0.375rem 0.875rem;
  border-radius: 8px;
}

.rule-summary-status.pass {
  color: var(--success);
}

.rule-summary-status.fail {
  color: var(--danger);
}

.rule-check-simple {
  padding: 0.625rem 0.875rem;
  background: var(--card-bg);
  border-radius: 8px;
  border-left: 3px solid transparent;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  transition: all 0.2s ease;
}

.rule-check-simple:hover {
  transform: translateX(3px);
}

.rule-check-simple.pass {
  border-left-color: var(--success);
}

.rule-check-simple.fail {
  border-left-color: var(--danger);
}

.rule-check-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.rule-check-simple.pass .rule-check-icon {
  background: var(--success);
  color: white;
}

.rule-check-simple.fail .rule-check-icon {
  background: var(--danger);
  color: white;
}

.rule-check-simple .rule-check-label {
  font-size: 0.85rem;
  color: var(--text-primary);
  font-weight: 500;
}

/* ========================================
   IDENTIFIERS
   ======================================== */
.identifiers-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.identifier-item {
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 12px;
  border: 1px solid var(--card-border);
  transition: all 0.2s ease;
  cursor: pointer;
}

.identifier-item:hover {
  background: var(--card-bg);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 212, 255, 0.2);
}

.identifier-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.identifier-label i {
  color: var(--accent-primary);
}

.identifier-value {
  font-size: 0.9rem;
  color: var(--text-primary);
  font-family: 'Courier New', monospace;
  word-break: break-all;
  padding: 0.375rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.identifier-value:hover {
  background: rgba(0, 212, 255, 0.1);
  color: var(--accent-primary);
}

/* ========================================
   SAFETY
   ======================================== */
.alert-card {
  border: 2px solid var(--warning);
}

.pictograms-container {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.ghs-pictogram {
  width: 60px;
  height: 60px;
  background-color: #fff;
  border-radius: 8px;
  padding: 6px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  animation: fadeInUp 0.5s ease-out forwards;
  opacity: 0;
}

.ghs-pictogram:hover {
  transform: scale(1.15) rotate(5deg);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.hazard-list {
  list-style: none;
  padding: 0;
}

.hazard-item {
  padding: 0.875rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  margin-bottom: 0.625rem;
  border-left: 3px solid var(--warning);
  font-size: 0.85rem;
  color: var(--text-primary);
  transition: all 0.2s ease;
  animation: fadeInUp 0.4s ease-out forwards;
  opacity: 0;
}

.hazard-item:hover {
  background: var(--card-bg);
  transform: translateX(3px);
}

.hazard-item::before {
  content: '⚠️';
  margin-right: 0.625rem;
  font-size: 1.1rem;
}

/* ========================================
   CHARTS
   ======================================== */
.chart-container {
  position: relative;
  width: 100%;
  height: 300px;
  padding: 0.75rem;
}

/* ========================================
   SKELETON LOADERS
   ======================================== */
.skeleton-loader {
  display: none;
  padding: 1.5rem;
}

.skeleton-line,
.skeleton-circle,
.skeleton-box {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.05) 25%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0.05) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
  margin-bottom: 0.875rem;
}

.skeleton-line {
  height: 1rem;
}

.skeleton-line.short {
  width: 60%;
}

.skeleton-line.medium {
  width: 80%;
}

.skeleton-circle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
}

.skeleton-box {
  height: 80px;
}

/* ========================================
   BUTTONS
   ======================================== */
.btn-primary {
  background: var(--accent-gradient);
  border: none;
  box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 212, 255, 0.4);
}

.btn-secondary {
  background-color: var(--bg-secondary);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background-color: var(--card-bg);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */
.toast-notification {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  left: 1.5rem;
  max-width: 400px;
  margin: 0 auto;
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 0.875rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.875rem;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast-show {
  transform: translateY(0);
  opacity: 1;
}

.toast-success {
  border-left: 4px solid var(--success);
}

.toast-error {
  border-left: 4px solid var(--danger);
}

.toast-info {
  border-left: 4px solid var(--info);
}

.toast-warning {
  border-left: 4px solid var(--warning);
}

/* ========================================
   BACK TO TOP
   ======================================== */
#backToTop {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#backToTop.show {
  display: flex;
  opacity: 1;
  transform: scale(1);
}

#backToTop:hover {
  transform: scale(1.1) translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 212, 255, 0.4);
}

/* ========================================
   FOOTER
   ======================================== */
.footer {
  margin-top: 3rem;
  padding: 1.5rem 0;
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--card-border);
  color: var(--text-secondary);
  text-align: center;
  font-size: 0.85rem;
}

.footer a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer a:hover {
  color: var(--accent-primary);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (min-width: 576px) {
  body {
    font-size: 15px;
  }

  .display-4 {
    font-size: 2.5rem;
  }

  .lead {
    font-size: 1.1rem;
  }

  .search-container {
    max-width: 700px;
  }

  .search-input {
    font-size: 1rem;
    padding: 0.875rem 0.875rem 0.875rem 3rem;
  }

  .search-button {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
  }

  .viewer-3d-large {
    height: 500px;
  }

  .chart-container {
    height: 350px;
  }

  .compound-title {
    font-size: 2.25rem;
  }

  .compound-subtitle {
    font-size: 1.1rem;
  }

  .section-title {
    font-size: 1.75rem;
  }

  .metric-icon {
    font-size: 2.75rem;
  }

  .metric-value {
    font-size: 2.25rem;
  }

  .metric-label {
    font-size: 0.85rem;
  }

  .toast-notification {
    right: 2rem;
    left: auto;
    max-width: 400px;
  }

  #backToTop {
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
  }

  .odyssey-title h2 {
    font-size: 2rem;
  }

  .chem-space-canvas {
    height: 650px;
  }
}

@media (min-width: 768px) {
  body {
    font-size: 16px;
  }

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

  .viewer-3d-large {
    height: 550px;
  }

  .identifiers-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }

  .section {
    padding: 2rem 0;
  }

  .compound-header {
    padding: 2rem 0;
  }
}

@media (min-width: 992px) {
  .display-4 {
    font-size: 3rem;
  }

  .lead {
    font-size: 1.25rem;
  }

  .search-container {
    max-width: 900px;
  }

  .viewer-3d-large {
    height: 600px;
  }

  .chart-container {
    height: 400px;
  }

  .compound-title {
    font-size: 2.75rem;
  }

  .identifiers-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .odyssey-title h2 {
    font-size: 2.25rem;
  }

  .chem-space-canvas {
    height: 700px;
  }
}

@media (min-width: 1200px) {
  .display-4 {
    font-size: 3.5rem;
  }

  .compound-title {
    font-size: 3rem;
  }

  .compound-subtitle {
    font-size: 1.3rem;
  }

  .section-title {
    font-size: 2rem;
  }
}

@media (max-width: 991.98px) {
  .odyssey-grid {
    grid-template-columns: 1fr;
  }
  
  .odyssey-sidebar {
    order: 2;
  }
  
  .odyssey-main {
    order: 1;
  }

  .chem-space-canvas {
    height: 500px;
  }
}

@media (max-width: 767.98px) {
  .odyssey-header {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .odyssey-title h2 {
    font-size: 1.5rem;
    justify-content: center;
  }
  
  .chem-space-canvas {
    height: 400px;
  }

  .map-instructions {
    gap: 1rem;
  }
}

@media (max-width: 575.98px) {
  .navbar-brand {
    font-size: 1.1rem;
  }

  #mainContent {
    padding-top: calc(var(--navbar-height) + 0.5rem);
  }

  .section {
    padding: 1rem 0;
  }

  .metric-card {
    padding: 1rem 0.75rem;
  }

  .card-body {
    padding: 1rem !important;
  }

  .druglike-rule {
    padding: 1rem;
  }

  .rule-title {
    font-size: 1rem;
  }

  .score-value {
    font-size: 1.25rem;
  }

  .rule-summary-status {
    font-size: 1rem;
    padding: 0.25rem 0.625rem;
  }

  .identifier-item {
    padding: 0.875rem;
  }

  .ghs-pictogram {
    width: 50px;
    height: 50px;
  }

  .hazard-item {
    padding: 0.75rem;
    font-size: 0.8rem;
  }

  .footer {
    padding: 1.25rem 0;
    font-size: 0.8rem;
  }

  .odyssey-container {
    padding: 1rem 0.5rem;
  }

  .odyssey-title h2 {
    font-size: 1.25rem;
  }

  .odyssey-title p {
    font-size: 0.8rem;
  }
}

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

/* ========================================
   SCROLLBARS
   ======================================== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--card-border);
  border-radius: 5px;
  transition: background 0.3s ease;
}

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

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
  .navbar,
  .footer,
  #backToTop,
  .btn,
  .toast-notification,
  .odyssey-header,
  .map-instructions,
  .filter-section {
    display: none !important;
  }

  .glass-card {
    border: 1px solid #000;
    box-shadow: none;
  }

  body {
    background: white;
    color: black;
  }

  .odyssey-grid {
    display: block;
  }

  .chem-space-canvas {
    page-break-inside: avoid;
  }
}

/* ========================================
   TOUCH DEVICE OPTIMIZATION
   ======================================== */
@supports (touch-action: pan-y) {
  .viewer-3d-large {
    touch-action: pan-y;
  }
}

/* iOS Safari Font Size Fix */
@supports (-webkit-touch-callout: none) {
  .search-input,
  .identifier-value {
    font-size: 16px !important;
  }
}

/* ========================================
   ODYSSEY MAP TOOLTIP - GURU EDITION
   ======================================== */
.map-tooltip {
  position: absolute;
  background: rgba(10, 14, 39, 0.85); /* Darker, more focused background */
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid var(--accent-primary);
  border-radius: 10px;
  padding: 1rem;
  pointer-events: none;
  z-index: 1000;
  min-width: 250px;
  max-width: 320px;
  box-shadow: 0 0 30px rgba(0, 212, 255, 0.4), var(--shadow-lg);
  font-size: 0.8rem;
  line-height: 1.5;
  transform: translateZ(0); /* GPU acceleration */
  transition: opacity 0.2s ease, transform 0.2s ease;
  border-image: linear-gradient(to right, var(--accent-primary), var(--accent-secondary)) 1;
  animation: fadeInTooltip 0.3s ease-out;
}

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

.map-tooltip strong {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-primary);
  display: block;
  margin-bottom: 0.25rem;
  line-height: 1.3;
  text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.map-tooltip small {
  font-size: 0.7rem;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.map-tooltip span {
  display: block;
  color: var(--text-primary);
  margin-top: 0.5rem;
  border-top: 1px solid var(--card-border);
  padding-top: 0.5rem;
}
