/* About Page Styles */

/* Hero Section */
.about-hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 4rem 0;
  margin-bottom: 0;
}

.hero-content {
  text-align: center;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
  font-size: 1.2rem;
  opacity: 0.9;
  margin-bottom: 0;
}

/* Info Cards */
.info-card {
  background: white;
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: all 0.3s ease;
}

.info-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.info-card .card-header {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-bottom: 3px solid #667eea;
  padding: 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.info-card .card-header i {
  font-size: 2rem;
  color: #667eea;
}

.info-card .card-header h3 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: #2c3e50;
}

.info-card .card-body {
  padding: 2rem;
}

.info-card .lead {
  font-size: 1.1rem;
  font-weight: 500;
  color: #2c3e50;
  line-height: 1.6;
}

/* Highlight Box */
.highlight-box {
  background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
  border: 2px solid #667eea;
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 2rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.highlight-box i {
  font-size: 1.5rem;
  color: #667eea;
  margin-top: 0.2rem;
}

.external-link {
  color: #667eea;
  text-decoration: none;
  font-weight: 600;
}

.external-link:hover {
  color: #5a67d8;
  text-decoration: underline;
}

.external-link i {
  font-size: 0.8rem;
  margin-left: 0.5rem;
}

/* Usage Grid */
.usage-grid h4 {
  color: #2c3e50;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.usage-grid h4 i {
  color: #667eea;
}

.usage-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.usage-item {
  background: #f8f9fa;
  padding: 1rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.3s ease;
}

.usage-item:hover {
  background: #e9ecef;
  transform: translateX(5px);
}

.usage-item i {
  font-size: 1.2rem;
  color: #667eea;
  min-width: 20px;
}

.usage-item span {
  font-size: 0.95rem;
  color: #2c3e50;
}

/* Organizations Grid */
.organizations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.org-card {
  background: #f8f9fa;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  gap: 1rem;
  transition: all 0.3s ease;
}

.org-card:hover {
  border-color: #667eea;
  background: white;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.org-number {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.org-content h5 {
  color: #2c3e50;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.org-abbr {
  color: #6c757d;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.org-link {
  color: #667eea;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.org-link:hover {
  color: #5a67d8;
  text-decoration: underline;
}

/* Warning Card */
.warning-card {
  background: #fff3cd;
  border: 2px solid #ffc107;
  border-radius: 15px;
  overflow: hidden;
}

.warning-header {
  background: linear-gradient(135deg, #ffc107 0%, #ffb347 100%);
  color: #212529;
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.warning-header i {
  font-size: 1.8rem;
}

.warning-header h3 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 600;
}

.warning-body {
  padding: 2rem;
}

.warning-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.warning-list li {
  padding: 1rem 0;
  border-bottom: 1px solid #f0c14b;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.warning-list li:last-child {
  border-bottom: none;
}

.warning-list i {
  font-size: 1.2rem;
  margin-top: 0.2rem;
  min-width: 20px;
}

.warning-list li:nth-child(1) i {
  color: #dc3545;
}

.warning-list li:nth-child(2) i {
  color: #fd7e14;
}

.warning-list li:nth-child(3) i {
  color: #28a745;
}

/* Code Format Section */
.code-format-section {
  background: #f8f9fa;
  padding: 4rem 0;
  margin: 0 -15px;
}

.format-header h2 {
  color: #2c3e50;
  font-weight: 700;
  margin-bottom: 1rem;
}

.format-header h2 i {
  color: #667eea;
  margin-right: 0.5rem;
}

.format-header .lead {
  color: #6c757d;
  max-width: 800px;
  margin: 0 auto;
}

.format-rules {
  background: white;
  border-radius: 15px;
  padding: 2rem;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.format-rules h4 {
  color: #2c3e50;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.format-rules h4 i {
  color: #667eea;
}

.rule-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.rule-item {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  padding: 1.5rem;
  background: #f8f9fa;
  border-radius: 12px;
  transition: all 0.3s ease;
}

.rule-item:hover {
  background: #e9ecef;
  transform: translateX(5px);
}

.rule-number {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.rule-content h5 {
  color: #2c3e50;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.rule-content p {
  color: #6c757d;
  margin: 0;
  line-height: 1.5;
}

/* Table Container */
.table-container {
  background: white;
  border-radius: 15px;
  padding: 2rem;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.table-description {
  color: #6c757d;
  font-style: italic;
}

/* Color Legend */
.color-legend {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 12px;
  padding: 1.5rem;
  border: 2px solid #e9ecef;
}

.color-legend h5 {
  color: #2c3e50;
  margin-bottom: 1rem;
}

.legend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.8rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.5rem;
  background: white;
  border-radius: 8px;
  transition: all 0.3s ease;
  border: 1px solid #dee2e6;
}

.legend-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: #adb5bd;
}

/* Tooltip and hover hints for legend items with multiple types */
.legend-item.has-tooltip {
  cursor: help;
  position: relative;
}

.legend-item.has-tooltip:hover {
  background: #f1f3f4;
  border-color: #667eea;
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.2);
}

/* Disable CSS tooltip - only use Bootstrap tooltip to avoid confusion */
.legend-item.has-tooltip::after,
.legend-item.has-tooltip::before {
  display: none;
}

.hover-hint {
  color: #667eea !important;
  font-weight: 500;
  cursor: help;
}

.hover-hint:hover {
  color: #5a6fd8 !important;
}

.hover-hint .fa-info-circle {
  font-size: 0.8rem;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.legend-item.has-tooltip:hover .hover-hint .fa-info-circle {
  opacity: 1;
  animation: pulse 1.5s infinite;
}

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

.legend-item span:last-child {
  font-size: 0.9rem;
  color: #495057;
  font-weight: 500;
}

.code-character {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-weight: 600;
  font-family: 'Courier New', monospace;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.code-character:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Different colors for different character types - REAL DATABASE CHARACTERS */
.code-character.char-a { background: linear-gradient(135deg, #667eea, #764ba2); } /* Province Public Health Office - Purple/Blue */
.code-character.char-b { background: linear-gradient(135deg, #f093fb, #f5576c); } /* District Public Health Office - Pink/Red */
.code-character.char-c { background: linear-gradient(135deg, #4ECDC4, #44A08D); } /* Private Clinic - Teal/Green */
.code-character.char-d { background: linear-gradient(135deg, #FBAB7E, #F7CE68); } /* Drugstore - Orange/Yellow */
.code-character.char-e { background: linear-gradient(135deg, #FF6B6B, #FF8E53); } /* Hospitals - Red/Orange */
.code-character.char-f { background: linear-gradient(135deg, #FF5722, #FF9800); } /* Government Hospital Outside MOH - Orange/Deep Orange */
.code-character.char-g { background: linear-gradient(135deg, #4CAF50, #81C784); } /* Health Centers/Stations - Green */
.code-character.char-h { background: linear-gradient(135deg, #E91E63, #AD1457); } /* Private Hospital - Pink/Deep Pink */
.code-character.char-i { background: linear-gradient(135deg, #9C27B0, #673AB7); } /* Academic Center - Purple/Deep Purple */

/* Legacy colors for backward compatibility */
.code-character.char-p { background: linear-gradient(135deg, #45B7D1, #96C93D); } /* Private - Blue/Green */
.code-character.char-m { background: linear-gradient(135deg, #4158D0, #C850C0); } /* Medical - Blue/Purple */
.code-character.char-n { background: linear-gradient(135deg, #0093E9, #80D0C7); } /* Nursing - Blue/Cyan */
.code-character.char-l { background: linear-gradient(135deg, #FBAB7E, #F7CE68); } /* Laboratory - Orange/Yellow */
.code-character.char-r { background: linear-gradient(135deg, #85FFBD, #FFFB7D); } /* Rehabilitation - Green/Yellow */
.code-character.char-s { background: linear-gradient(135deg, #667eea, #764ba2); } /* Specialized - Purple/Blue */
.code-character.char-u { background: linear-gradient(135deg, #f093fb, #f5576c); } /* University - Pink/Red */
.code-character.char-t { background: linear-gradient(135deg, #a8edea, #fed6e3); } /* Traditional - Light Blue/Pink */
.code-character.char-o { background: linear-gradient(135deg, #ff9a9e, #fecfef); } /* Others - Pink gradient */
.code-character.char-w { background: linear-gradient(135deg, #a18cd1, #fbc2eb); } /* Wellness - Purple/Pink */

/* HCODE Display with colored first character */
.hcode-display {
  font-family: 'Courier New', monospace;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.5px;
}

.hcode-first-char {
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
  color: white;
  margin-right: 2px;
  transition: all 0.3s ease;
}

.hcode-first-char:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.hcode-remaining {
  background: #f8f9fa;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  color: #495057;
}

/* Character color mapping for HCODE first characters - REAL DATABASE CHARACTERS */
.hcode-first-char.char-a { background: linear-gradient(135deg, #667eea, #764ba2); } /* Province Public Health Office */
.hcode-first-char.char-b { background: linear-gradient(135deg, #f093fb, #f5576c); } /* District Public Health Office */
.hcode-first-char.char-c { background: linear-gradient(135deg, #4ECDC4, #44A08D); } /* Private Clinic */
.hcode-first-char.char-d { background: linear-gradient(135deg, #FBAB7E, #F7CE68); } /* Drugstore */
.hcode-first-char.char-e { background: linear-gradient(135deg, #FF6B6B, #FF8E53); } /* Hospitals */
.hcode-first-char.char-f { background: linear-gradient(135deg, #FF5722, #FF9800); } /* Government Hospital Outside MOH */
.hcode-first-char.char-g { background: linear-gradient(135deg, #4CAF50, #81C784); } /* Health Centers/Stations */
.hcode-first-char.char-h { background: linear-gradient(135deg, #E91E63, #AD1457); } /* Private Hospital */
.hcode-first-char.char-i { background: linear-gradient(135deg, #9C27B0, #673AB7); } /* Academic Center */

/* Legacy colors for backward compatibility */
.hcode-first-char.char-p { background: linear-gradient(135deg, #45B7D1, #96C93D); }
.hcode-first-char.char-m { background: linear-gradient(135deg, #4158D0, #C850C0); }
.hcode-first-char.char-n { background: linear-gradient(135deg, #0093E9, #80D0C7); }
.hcode-first-char.char-l { background: linear-gradient(135deg, #FBAB7E, #F7CE68); }
.hcode-first-char.char-r { background: linear-gradient(135deg, #85FFBD, #FFFB7D); }
.hcode-first-char.char-s { background: linear-gradient(135deg, #667eea, #764ba2); }
.hcode-first-char.char-u { background: linear-gradient(135deg, #f093fb, #f5576c); }
.hcode-first-char.char-t { background: linear-gradient(135deg, #a8edea, #fed6e3); }
.hcode-first-char.char-o { background: linear-gradient(135deg, #ff9a9e, #fecfef); }
.hcode-first-char.char-w { background: linear-gradient(135deg, #a18cd1, #fbc2eb); }

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2rem;
  }
  
  .hero-subtitle {
    font-size: 1rem;
  }
  
  .about-hero {
    padding: 3rem 0;
  }
  
  .info-card .card-header {
    padding: 1.5rem;
    flex-direction: column;
    text-align: center;
  }
  
  .info-card .card-body {
    padding: 1.5rem;
  }
  
  .usage-list {
    grid-template-columns: 1fr;
  }
  
  .organizations-grid {
    grid-template-columns: 1fr;
  }
  
  .rule-item {
    flex-direction: column;
    text-align: center;
  }
  
  .rule-number {
    align-self: center;
  }
  
  .highlight-box {
    flex-direction: column;
    text-align: center;
  }
  
  .warning-header {
    padding: 1rem 1.5rem;
    flex-direction: column;
    text-align: center;
  }
  
  .warning-body {
    padding: 1.5rem;
  }
  
  .warning-list li {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
  
  .code-format-section {
    margin: 0;
  }
  
  .format-rules {
    padding: 1.5rem;
  }
  
  .table-container {
    padding: 1rem;
    overflow-x: auto;
  }
  
  #hcode9-table {
    min-width: 500px;
  }
  
  .legend-grid {
    grid-template-columns: 1fr;
  }
  
  .legend-item {
    justify-content: center;
    text-align: center;
  }
}

@media (max-width: 576px) {
  .hero-title {
    font-size: 1.8rem;
  }
  
  .info-card .card-header h3 {
    font-size: 1.3rem;
  }
  
  .org-card {
    padding: 1rem;
  }
  
  .org-number {
    width: 35px;
    height: 35px;
    font-size: 1rem;
  }
  
  .rule-number {
    width: 35px;
    height: 35px;
    font-size: 1rem;
  }
}

/* Custom Bootstrap Tooltip Styling for Legend */
.tooltip {
  font-size: 0.85rem;
}

.tooltip .tooltip-inner {
  max-width: 350px;
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  color: white;
  border-radius: 8px;
  padding: 0.8rem 1rem;
  font-weight: 500;
  text-align: left;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.tooltip .tooltip-arrow::before {
  border-top-color: #2c3e50 !important;
}

/* Tooltip text formatting */
.tooltip .tooltip-inner strong {
  color: #74b9ff;
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
  display: block;
}

.tooltip .tooltip-inner br {
  line-height: 1.6;
}
