/* Custom styles for Harapan Jaya Application */

:root {
  /* Medical/Health Color Palette - Selaras dengan Logo */
  --primary-color: #00b894; /* Teal hijau untuk kesehatan */
  --primary-light: #55efc4; /* Teal terang */
  --primary-dark: #00a085; /* Teal gelap */
  --secondary-color: #636e72; /* Abu netral */
  --accent-color: #0984e3; /* Biru medis */
  --success-color: #00b894; /* Hijau success */
  --info-color: #74b9ff; /* Biru info */
  --warning-color: #fdcb6e; /* Kuning warning */
  --danger-color: #e17055; /* Merah lembut */
  --light-color: #f8f9fa; /* Background terang */
  --light-accent: #e8f8f5; /* Background hijau terang */
  --dark-color: #2d3436; /* Text gelap */
  --border-color: #ddd; /* Border */
  --border-radius: 15px;
  --box-shadow: 0 4px 20px rgba(0, 184, 148, 0.15);
  --box-shadow-hover: 0 8px 30px rgba(0, 184, 148, 0.25);
  --transition: all 0.3s ease;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #f8f9fa;
  line-height: 1.6;
}

/* Logo Styles */
.navbar-logo {
  height: 35px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
  transition: var(--transition);
}

.navbar-logo:hover {
  transform: scale(1.05);
}

/* Enhanced Dashboard Styles - Medical Theme */
.bg-gradient-primary {
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--primary-dark) 100%
  ) !important;
}

.bg-gradient-medical {
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--accent-color) 100%
  ) !important;
}

.dashboard-header {
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--accent-color) 100%
  );
  position: relative;
  overflow: hidden;
  border-radius: 0 0 20px 20px;
  margin-bottom: 2rem;
}

.dashboard-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" fill="rgba(255,255,255,0.1)"><polygon points="0,100 1000,0 1000,100"/></svg>');
  background-size: cover;
}

.card-hover {
  transition: var(--transition);
  border: none;
  border-radius: var(--border-radius);
  border-left: 4px solid var(--primary-color);
}

.card-hover:hover {
  transform: translateY(-5px);
  box-shadow: var(--box-shadow-hover) !important;
  border-left-color: var(--accent-color);
}

/* Medical Theme Components */
.btn-medical-primary {
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--primary-dark) 100%
  );
  border: none;
  color: white;
  border-radius: var(--border-radius);
  padding: 12px 24px;
  font-weight: 500;
  transition: var(--transition);
}

.btn-medical-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--box-shadow-hover);
  background: linear-gradient(
    135deg,
    var(--primary-dark) 0%,
    var(--accent-color) 100%
  );
  color: white;
}

.medical-accent {
  color: var(--primary-color) !important;
}

.bg-medical-light {
  background-color: var(--light-accent) !important;
}

.border-medical {
  border-color: var(--primary-color) !important;
}

.text-medical {
  color: var(--primary-color) !important;
}

.stat-icon {
  width: 60px;
  height: 60px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: var(--transition);
}

.avatar-sm {
  width: 40px;
  height: 40px;
  font-size: 1rem;
}

.quick-action-btn {
  transition: var(--transition);
  border: 2px dashed #dee2e6;
  border-radius: var(--border-radius);
  height: 100%;
  min-height: 150px;
}

.quick-action-btn:hover {
  border-style: solid;
  transform: translateY(-2px);
  box-shadow: var(--box-shadow);
}

/* Card enhancements */
.card {
  border: none;
  border-radius: var(--border-radius);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: var(--transition);
}

.card-header {
  background-color: transparent;
  border-bottom: 1px solid rgba(0, 0, 0, 0.125);
  font-weight: 600;
  border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.card-header h5 {
  margin: 0;
  color: var(--dark-color);
}

/* Enhanced animations */
@keyframes countUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.stat-card {
  animation: countUp 0.6s ease-out;
}

.stat-card:nth-child(1) {
  animation-delay: 0.1s;
}
.stat-card:nth-child(2) {
  animation-delay: 0.2s;
}
.stat-card:nth-child(3) {
  animation-delay: 0.3s;
}
.stat-card:nth-child(4) {
  animation-delay: 0.4s;
}

/* Enhanced badges */
.badge {
  font-weight: 500;
  padding: 0.5em 0.75em;
  border-radius: 8px;
}

/* Enhanced buttons */
.btn {
  border-radius: 10px;
  font-weight: 500;
  transition: var(--transition);
}

.btn:hover {
  transform: translateY(-1px);
}

/* Table styles */
.table th {
  background-color: var(--light-color);
  font-weight: 600;
  border-top: 1px solid #dee2e6;
}

.table-striped > tbody > tr:nth-of-type(odd) > td {
  background-color: rgba(0, 0, 0, 0.02);
}

/* Button styles */
.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
}

.btn-action {
  margin: 0 2px;
}

/* Assessment Modal Styles */
.modal-xl {
  max-width: 90% !important;
}

#assessmentTabs .nav-link {
  border-radius: 0.375rem 0.375rem 0 0;
  margin-right: 0.25rem;
}

#assessmentTabs .nav-link.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.tab-content {
  border: 1px solid #dee2e6;
  border-top: none;
  padding: 1.5rem;
  border-radius: 0 0 0.375rem 0.375rem;
  background-color: white;
}

/* VAS Scale Styling */
.form-range::-webkit-slider-thumb {
  background: var(--primary-color);
}

.form-range::-moz-range-thumb {
  background: var(--primary-color);
  border: none;
}

/* Form validation styles */
.is-invalid {
  border-color: var(--danger-color) !important;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

/* Assessment section headers */
.assessment-section-header {
  padding: 0.75rem 1rem;
  background-color: var(--light-color);
  border-left: 4px solid var(--primary-color);
  margin-bottom: 1rem;
  border-radius: 0.375rem;
}

/* ROM Assessment grid */
.rom-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

/* Patient info table in assessment */
.patient-info-compact {
  font-size: 0.9rem;
}

.patient-info-compact th {
  font-weight: 600;
  color: var(--dark-color);
  width: 40%;
}

/* Assessment loading state */
#assessment-loading {
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* Form styles */
.form-label {
  font-weight: 600;
  color: var(--dark-color);
}

.required {
  color: var(--danger-color);
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Alert styles */
.alert {
  border: 0;
  border-radius: 0.5rem;
}

/* Loading overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.loading-spinner {
  color: white;
  font-size: 2rem;
}

/* Navbar customization */
.navbar-brand {
  font-weight: 700;
  font-size: 1.5rem;
}

.navbar-nav .nav-link {
  font-weight: 500;
  padding: 0.5rem 1rem;
}

.dropdown-menu {
  border: 0;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Dashboard stats cards */
.stat-card {
  background: linear-gradient(135deg, var(--primary-color), #0a58ca);
  color: white;
  border-radius: 1rem;
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.stat-card h3 {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0;
}

.stat-card p {
  margin: 0;
  opacity: 0.9;
}

/* Medical form specific styles */
.medical-form {
  background: white;
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.section-header {
  background-color: var(--light-color);
  padding: 1rem;
  margin: -2rem -2rem 2rem -2rem;
  border-radius: 1rem 1rem 0 0;
  border-bottom: 2px solid var(--primary-color);
}

.section-header h4 {
  margin: 0;
  color: var(--primary-color);
  font-weight: 700;
}

/* VAS Scale styling */
.vas-scale {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: var(--light-color);
  border-radius: 0.5rem;
  margin: 1rem 0;
}

.vas-scale input[type="range"] {
  flex: 1;
  margin: 0 1rem;
}

.vas-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--secondary-color);
}

/* ROM assessment grid */
.rom-assessment {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.rom-item {
  background: var(--light-color);
  padding: 1rem;
  border-radius: 0.5rem;
  border-left: 4px solid var(--primary-color);
}

.rom-item label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

/* Service checkbox styling */
.service-checkbox {
  border: 2px solid #e9ecef;
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 0.5rem;
  transition: all 0.3s ease;
}

.service-checkbox:hover {
  border-color: var(--primary-color);
  background-color: rgba(13, 110, 253, 0.05);
}

.service-checkbox input[type="checkbox"]:checked + label {
  color: var(--primary-color);
  font-weight: 600;
}

/* Patient info display */
.patient-info {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border-radius: 1rem;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.patient-info h5 {
  color: var(--primary-color);
  font-weight: 700;
  margin-bottom: 1rem;
}

.patient-detail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.patient-detail-item {
  background: white;
  padding: 0.75rem;
  border-radius: 0.5rem;
  border-left: 3px solid var(--primary-color);
}

.patient-detail-item strong {
  display: block;
  color: var(--secondary-color);
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

/* Status badges */
.status-badge {
  padding: 0.375rem 0.75rem;
  border-radius: 2rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.status-menunggu {
  background-color: #fff3cd;
  color: #856404;
}
.status-sedang-periksa {
  background-color: #d1ecf1;
  color: #0c5460;
}
.status-selesai {
  background-color: #d4edda;
  color: #155724;
}
.status-batal {
  background-color: #f8d7da;
  color: #721c24;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .container-fluid {
    padding: 0 15px;
  }

  .stat-card h3 {
    font-size: 2rem;
  }

  .patient-detail {
    grid-template-columns: 1fr;
  }

  .rom-assessment {
    grid-template-columns: 1fr;
  }
}

/* Print styles */
@media print {
  .navbar,
  .btn,
  .dropdown,
  footer {
    display: none !important;
  }

  .container-fluid {
    margin-top: 0 !important;
  }

  .card {
    border: 1px solid #000 !important;
    box-shadow: none !important;
  }
}

/* Assignment Detail Modal Styles */
.timeline {
  position: relative;
  padding: 0;
}

.timeline-item {
  position: relative;
  margin-bottom: 1.5rem;
}

.timeline-marker {
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
}

.timeline-content {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  padding: 1rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* Assignment Detail Cards */
.assignment-detail-card {
  transition: all 0.3s ease;
}

.assignment-detail-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Status specific colors */
.timeline-marker.bg-primary {
  background-color: var(--primary-color) !important;
}

.timeline-marker.bg-success {
  background-color: var(--success-color) !important;
}

.timeline-marker.bg-warning {
  background-color: var(--warning-color) !important;
}

.timeline-marker.bg-danger {
  background-color: var(--danger-color) !important;
}

.timeline-marker.bg-secondary {
  background-color: var(--secondary-color) !important;
}

/* Action buttons in modal */
.modal-footer .btn-group .btn {
  margin-left: 0.5rem;
}

.modal-footer .btn-group .btn:first-child {
  margin-left: 0;
}

/* Patient info styling */
.patient-info-table th {
  color: var(--secondary-color);
  font-weight: 600;
  font-size: 0.875rem;
}

.patient-info-table td {
  font-weight: 500;
}

/* Medical history timeline styling */
.medical-history-timeline {
  border-left: 2px solid #dee2e6;
  margin-left: 6px;
  padding-left: 1rem;
}

.medical-history-timeline .timeline-item {
  position: relative;
}

.medical-history-timeline .timeline-item::before {
  content: "";
  position: absolute;
  left: -1.375rem;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--primary-color);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px #dee2e6;
}

/* Bootstrap Override - Medical Theme */
.bg-primary {
  background-color: var(--primary-color) !important;
  background-image: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--primary-dark) 100%
  ) !important;
}

.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  background-image: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--primary-dark) 100%
  );
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
  background-image: linear-gradient(
    135deg,
    var(--primary-dark) 0%,
    var(--accent-color) 100%
  );
  transform: translateY(-1px);
  box-shadow: var(--box-shadow-hover);
}

.text-primary {
  color: var(--primary-color) !important;
}

.border-primary {
  border-color: var(--primary-color) !important;
}

.navbar-dark .navbar-brand {
  color: white !important;
  font-weight: 600;
}

.navbar-dark .navbar-nav .nav-link {
  transition: var(--transition);
}

.navbar-dark .navbar-nav .nav-link:hover {
  color: var(--light-accent) !important;
  transform: translateY(-1px);
}
