/**
 * Modern Patient Editor Styles
 * Medical-grade professional design for MDT patient creation
 * Compatible with AngularJS + AdminLTE
 */

/* ==========================================
   MODERN CARD SYSTEM
   ========================================== */

.modern-patient-editor {
  background: #f4f6f9;
  padding: 20px 0;
}

.modern-card {
  background: #ffffff;
  border-radius: 3px;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
  overflow: hidden;
  border: 1px solid #d2d6de;
}

.modern-card-header {
  background: #f9fafc;
  color: #444;
  padding: 15px 20px;
  border-bottom: 1px solid #d2d6de;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modern-card-header.medical-blue,
.modern-card-header.medical-green,
.modern-card-header.medical-purple,
.modern-card-header.medical-orange,
.modern-card-header.medical-teal {
  background: #f9fafc;
  color: #444;
}

.modern-card-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #444;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modern-card-header h3 i {
  color: #05396b;
}

.modern-card-header .required-indicator {
  color: #dd4b39;
  font-size: 16px;
  font-weight: bold;
  margin-left: 4px;
}

.modern-card-body {
  padding: 20px;
}

.modern-card-footer {
  background: #f9fafc;
  padding: 15px 20px;
  border-top: 1px solid #d2d6de;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ==========================================
   PROGRESS INDICATOR SIDEBAR
   ========================================== */

.progress-sidebar {
  position: fixed;
  right: 30px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1000;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  padding: 20px;
  min-width: 220px;
  max-width: 250px;
}

.progress-sidebar-title {
  font-size: 14px;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.progress-step {
  display: flex;
  align-items: center;
  padding: 12px 0;
  cursor: pointer;
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
  padding-left: 12px;
  margin-left: -12px;
}

.progress-step:hover {
  background: rgba(92, 219, 148, 0.08);
  border-left-color: #5cdb94;
}

.progress-step.active {
  background: rgba(92, 219, 148, 0.12);
  border-left-color: #5cdb94;
}

.progress-step.completed {
  opacity: 0.7;
}

.progress-step-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e9ecef;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.progress-step.active .progress-step-icon {
  background: #05396b;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(5, 57, 107, 0.4);
}

.progress-step.completed .progress-step-icon {
  background: #5cdb94;
  color: #ffffff;
}

.progress-step-text {
  font-size: 13px;
  color: #495057;
  font-weight: 500;
  line-height: 1.4;
}

.progress-step.active .progress-step-text {
  color: #05396b;
  font-weight: 600;
}

/* ==========================================
   MODERN FORM ELEMENTS
   ========================================== */

.modern-form-group {
  margin-bottom: 20px;
  position: relative;
}

.modern-form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #444;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.modern-form-label .required-indicator {
  color: #dd4b39;
  font-size: 13px;
  font-weight: bold;
  margin-left: 2px;
}

.modern-form-label i {
  color: #05396b;
  font-size: 14px;
}

.modern-form-control {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.42857143;
  color: #555;
  background-color: #fff;
  border: 1px solid #d2d6de;
  border-radius: 3px;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  font-family: inherit;
}

.modern-form-control:focus {
  outline: none;
  border-color: #5cdb94;
  box-shadow: none;
  background-color: #fff;
}

.modern-form-control.ng-invalid.ng-touched,
.modern-form-control.ng-invalid.ng-dirty {
  border-color: #e74c3c;
  background-color: #fff5f5;
}

.modern-form-control.ng-valid.ng-touched {
  border-color: #5cdb94;
}

.modern-form-control:disabled {
  background-color: #f8f9fa;
  cursor: not-allowed;
  opacity: 0.7;
}

textarea.modern-form-control {
  resize: vertical;
  min-height: 100px;
}

/* Validation messages */
.validation-message {
  font-size: 12px;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  animation: slideInDown 0.3s ease;
}

.validation-message.error {
  color: #e74c3c;
}

.validation-message.success {
  color: #5cdb94;
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================
   MODERN BUTTONS
   ========================================== */

.modern-btn {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 3px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  line-height: 1.42857143;
}

.modern-btn-primary {
  background: #5cdb94;
  color: #ffffff;
  border-color: #5cdb94;
  font-family: Poppins-SemiBold;
}

.modern-btn-primary:hover {
  background: #48b879;
  border-color: #48b879;
  color: #ffffff;
}

.modern-btn-primary:active {
  transform: translateY(0);
}

.modern-btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.modern-btn-success {
  background: #5cdb94;
  color: #ffffff;
  border-color: #5cdb94;
  font-family: Poppins-SemiBold;
}

.modern-btn-success:hover {
  background: #48b879;
  border-color: #48b879;
  color: #ffffff;
}

.modern-btn-secondary {
  background: #f4f4f4;
  color: #444;
  border: 1px solid #ddd;
}

.modern-btn-secondary:hover {
  background: #e9e9e9;
  border-color: #ccc;
}

.modern-btn-danger {
  background: #dd4b39;
  color: #ffffff;
  border-color: #dd4b39;
}

.modern-btn-danger:hover {
  background: #d73925;
  border-color: #d73925;
  color: #ffffff;
}

.modern-btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.modern-btn-lg {
  padding: 12px 24px;
  font-size: 16px;
}

.modern-btn[disabled],
.floating-action-btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
  background: #d1d5db;
  color: #6b7280;
  border-color: #d1d5db;
}

/* Floating action button */
.floating-action-btn {
  position: fixed;
  right: 30px;
  bottom: 30px;
  z-index: 999;
  padding: 16px 28px;
  font-size: 16px;
  font-weight: 600;
  font-family: Poppins-SemiBold;
  border-radius: 50px;
  background: #5cdb94;
  color: #ffffff;
  border: none;
  box-shadow: 0 8px 24px rgba(92, 219, 148, 0.4);
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

.floating-action-btn.is-visible {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
  pointer-events: auto;
}

.floating-action-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(92, 219, 148, 0.5);
  background: #48b879;
}

/* ==========================================
   DRAG & DROP FILE UPLOAD ZONE
   ========================================== */

.modern-file-upload-zone {
  border: 3px dashed #dee2e6;
  border-radius: 12px;
  padding: 40px 20px;
  text-align: center;
  transition: all 0.3s ease;
  background: #f8f9fa;
  cursor: pointer;
  position: relative;
}

.modern-file-upload-zone:hover {
  border-color: #5cdb94;
  background: rgba(92, 219, 148, 0.05);
}

.modern-file-upload-zone.drag-over {
  border-color: #5cdb94;
  background: rgba(92, 219, 148, 0.1);
  transform: scale(1.02);
}

.modern-file-upload-zone.has-files {
  border-style: solid;
  border-color: #5cdb94;
  background: rgba(92, 219, 148, 0.05);
}

.file-upload-icon {
  font-size: 48px;
  color: #05396b;
  margin-bottom: 16px;
  transition: all 0.3s ease;
}

.modern-file-upload-zone:hover .file-upload-icon {
  transform: scale(1.1);
  color: #5cdb94;
}

.file-upload-text {
  font-size: 16px;
  color: #495057;
  font-weight: 600;
  margin-bottom: 8px;
}

.file-upload-hint {
  font-size: 13px;
  color: #6c757d;
}

/* File preview grid */
.file-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.file-preview-item {
  position: relative;
  background: #ffffff;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  transition: all 0.3s ease;
}

.file-preview-item:hover {
  border-color: #5cdb94;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.file-preview-icon {
  font-size: 40px;
  color: #05396b;
  margin-bottom: 8px;
}

.file-preview-name {
  font-size: 12px;
  color: #495057;
  word-break: break-word;
  margin-bottom: 4px;
}

.file-preview-size {
  font-size: 11px;
  color: #6c757d;
}

.file-preview-remove {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e74c3c;
  color: #ffffff;
  border: 2px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.3s ease;
}

.file-preview-remove:hover {
  background: #c0392b;
  transform: scale(1.1);
}

.file-upload-progress {
  height: 4px;
  background: #e9ecef;
  border-radius: 2px;
  overflow: hidden;
  margin-top: 8px;
}

.file-upload-progress-bar {
  height: 100%;
  background: #5cdb94;
  transition: width 0.3s ease;
}

/* ==========================================
   DIAGNOSIS TYPE SELECTOR
   ========================================== */

.diagnosis-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.diagnosis-option {
  background: #ffffff;
  border: 1px solid #d2d6de;
  border-radius: 3px;
  padding: 15px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.diagnosis-option:hover {
  border-color: #5cdb94;
  background: #f9fafc;
}

.diagnosis-option.selected {
  border-color: #5cdb94;
  border-width: 2px;
  background: rgba(92, 219, 148, 0.05);
}

.diagnosis-option-icon {
  font-size: 32px;
  color: #05396b;
  margin-bottom: 10px;
}

.diagnosis-option-title {
  font-size: 14px;
  font-weight: 600;
  color: #444;
  margin-bottom: 4px;
}

.diagnosis-option-description {
  font-size: 12px;
  color: #777;
}

.diagnosis-option .checkmark {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #5cdb94;
  color: #ffffff;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.diagnosis-option.selected .checkmark {
  display: flex;
}

/* ==========================================
   LOADING SKELETONS
   ========================================== */

.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s ease-in-out infinite;
  border-radius: 4px;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

.skeleton-text {
  height: 16px;
  margin-bottom: 12px;
}

.skeleton-input {
  height: 44px;
  margin-bottom: 20px;
}

.skeleton-button {
  height: 40px;
  width: 120px;
}

/* ==========================================
   ENCRYPTION BADGE & TOGGLE
   ========================================== */

.encryption-toggle-card {
  background: #f9fafc;
  border: 1px solid #d2d6de;
  border-left: 3px solid #3498db;
  border-radius: 3px;
  padding: 15px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
}

.encryption-toggle-icon {
  font-size: 32px;
  color: #3498db;
  flex-shrink: 0;
}

.encryption-toggle-content {
  flex: 1;
}

.encryption-toggle-title {
  font-size: 16px;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.encryption-toggle-description {
  font-size: 13px;
  color: #6c757d;
  line-height: 1.5;
}

.encryption-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

/* Modern toggle switch */
.modern-toggle {
  position: relative;
  width: 56px;
  height: 28px;
  flex-shrink: 0;
}

.modern-toggle input[type="checkbox"] {
  opacity: 0;
  width: 0;
  height: 0;
}

.modern-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 28px;
}

.modern-toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

.modern-toggle input:checked+.modern-toggle-slider {
  background: #5cdb94;
}

.modern-toggle input:checked+.modern-toggle-slider:before {
  transform: translateX(28px);
}

/* ==========================================
   SECTION DIVIDERS
   ========================================== */

.section-divider {
  display: flex;
  align-items: center;
  margin: 32px 0;
  gap: 16px;
}

.section-divider-line {
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, transparent, #e9ecef, transparent);
}

.section-divider-text {
  font-size: 13px;
  font-weight: 600;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ==========================================
   ALERT & NOTIFICATION STYLES
   ========================================== */

.modern-alert {
  padding: 12px 15px;
  border-radius: 3px;
  margin-bottom: 15px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid;
  border-left-width: 3px;
}

.modern-alert-info {
  background: #d9edf7;
  border-color: #bce8f1;
  color: #31708f;
}

.modern-alert-success {
  background: #dff0d8;
  border-color: #d6e9c6;
  color: #3c763d;
}

.modern-alert-warning {
  background: #fcf8e3;
  border-color: #faebcc;
  color: #8a6d3b;
}

.modern-alert-danger {
  background: #f2dede;
  border-color: #ebccd1;
  color: #a94442;
}

.modern-alert-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.modern-alert-content {
  flex: 1;
}

.modern-alert-title {
  font-weight: 600;
  margin-bottom: 4px;
}

/* Auto-save alert animations */
.modern-alert.auto-save-alert {
  transition: all 0.3s ease;
  animation: slideInDown 0.3s ease;
}

.modern-alert.auto-save-alert.saving {
  background: #d9edf7;
  border-color: #bce8f1;
  color: #31708f;
}

.modern-alert.auto-save-alert.saved {
  background: #dff0d8;
  border-color: #d6e9c6;
  color: #3c763d;
}

.modern-alert.auto-save-alert.error {
  background: #f2dede;
  border-color: #ebccd1;
  color: #a94442;
}

.modern-alert.auto-save-alert.fade-out {
  animation: fadeOut 0.5s ease forwards;
}

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

/* ==========================================
   WIZARD MODE TABS
   ========================================== */

.wizard-mode {
  background: #f4f6f9;
}

.wizard-tabs-container {
  background: #ffffff;
  border-bottom: 1px solid #d2d6de;
  margin-bottom: 20px;
  padding: 15px 20px;
}

.wizard-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 900px;
  margin: 0 auto;
}

.wizard-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 8px 16px;
  border-radius: 4px;
  min-width: 120px;
  background: #f9fafc;
  border: 1px solid #d2d6de;
}

.wizard-tab:hover:not(.disabled) {
  background: #f4f6f9;
  border-color: #5cdb94;
}

.wizard-tab.active {
  background: #05396b;
  border-color: #05396b;
  color: white;
}

.wizard-tab.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.wizard-tab-number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #d2d6de;
  color: #777;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.wizard-tab.active .wizard-tab-number {
  background: #5cdb94;
  color: #05396b;
}

.wizard-tab.completed .wizard-tab-number {
  background: #5cdb94;
  color: #ffffff;
}

.wizard-tab-label {
  font-size: 13px;
  font-weight: 600;
  color: #444;
  white-space: nowrap;
}


.wizard-tab.active .wizard-tab-label {
  color: #ffffff
}
.wizard-tab.active:hover .wizard-tab-label {
  color: #000000;
}

.wizard-tab.disabled .wizard-tab-label {
  color: #999;
}

.wizard-tab-divider {
  display: none;
}

.wizard-content {
  min-height: 400px;
  position: relative;
}

.wizard-step {
  animation: slideInRight 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  opacity: 0;
  animation-fill-mode: forwards;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.wizard-footer {
  background: #f9fafc;
  border-top: 1px solid #d2d6de;
  padding: 15px 20px;
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.wizard-footer-left {
  display: flex;
  gap: 12px;
}

.wizard-footer-right {
  display: flex;
  gap: 12px;
}

/* ==========================================
   RESPONSIVE ADJUSTMENTS
   ========================================== */

@media (max-width: 1200px) {
  .progress-sidebar {
    display: none;
  }
}

@media (max-width: 768px) {
  .modern-card-body {
    padding: 20px 16px;
  }

  .diagnosis-selector {
    grid-template-columns: 1fr;
  }

  .file-preview-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }

  .floating-action-btn {
    right: 20px;
    bottom: 20px;
    padding: 14px 24px;
    font-size: 14px;
  }

  /* Wizard responsive */
  .wizard-tabs {
    flex-wrap: wrap;
    gap: 8px;
  }

  .wizard-tab {
    min-width: 90px;
    padding: 6px 10px;
    font-size: 12px;
  }

  .wizard-tab-number {
    width: 20px;
    height: 20px;
    font-size: 11px;
  }

  .wizard-tab-label {
    font-size: 12px;
  }

  .wizard-footer {
    flex-direction: column;
    gap: 12px;
  }

  .wizard-footer-left,
  .wizard-footer-right {
    width: 100%;
    justify-content: center;
  }
}

/* ==========================================
   UTILITY CLASSES
   ========================================== */

.mb-0 {
  margin-bottom: 0 !important;
}

.mb-1 {
  margin-bottom: 8px !important;
}

.mb-2 {
  margin-bottom: 16px !important;
}

.mb-3 {
  margin-bottom: 24px !important;
}

.mb-4 {
  margin-bottom: 32px !important;
}

.mt-0 {
  margin-top: 0 !important;
}

.mt-1 {
  margin-top: 8px !important;
}

.mt-2 {
  margin-top: 16px !important;
}

.mt-3 {
  margin-top: 24px !important;
}

.mt-4 {
  margin-top: 32px !important;
}

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

.text-right {
  text-align: right;
}

.text-left {
  text-align: left;
}

.d-flex {
  display: flex;
}

.align-items-center {
  align-items: center;
}

.justify-content-between {
  justify-content: space-between;
}

.gap-2 {
  gap: 16px;
}

.fade-in {
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.slide-up {
  animation: slideUp 0.5s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}