/* MagnifyHope Import Utility Styles */

/* Import Button */
.btn-import {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  color: white !important;
  padding: 12px 24px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  box-shadow: 0 4px 14px rgba(102, 126, 234, 0.3);
  transition: all 0.3s ease;
}

.btn-import:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Import Modal */
.import-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 10100;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.import-modal-content {
  background: white;
  border-radius: 20px;
  width: 90%;
  max-width: 900px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.import-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  border-bottom: 1px solid #e3e8f0;
}

.import-modal-header h2 {
  margin: 0;
  color: #1f6feb;
  font-size: 1.5rem;
}

.import-close-btn {
  background: none;
  border: none;
  font-size: 28px;
  color: #6c757d;
  cursor: pointer;
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.import-close-btn:hover {
  background: #f8f9fa;
  color: #000;
}

.import-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.import-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #e3e8f0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

/* Import Sections */
.import-section {
  margin-bottom: 32px;
}

.import-section h3 {
  color: #333;
  font-size: 1.1rem;
  margin: 0 0 16px 0;
}

/* File Drop Zone */
.import-file-area {
  border: 2px dashed #cbd5e0;
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  background: #f7fafc;
  transition: all 0.3s ease;
  cursor: pointer;
}

.import-file-area:hover {
  border-color: #1f6feb;
  background: #eef2ff;
}

.import-file-area.import-drag-over {
  border-color: #1f6feb;
  background: #eef2ff;
  box-shadow: 0 0 0 4px rgba(31, 111, 235, 0.1);
}

.import-drop-text svg {
  color: #cbd5e0;
  margin-bottom: 16px;
}

.import-drop-text p {
  color: #718096;
  margin: 12px 0;
}

.import-formats {
  font-size: 0.85rem;
  color: #a0aec0;
  margin-top: 8px;
}

.import-file-name {
  margin-top: 12px;
  padding: 12px;
  background: #e8f5e9;
  border-radius: 8px;
  color: #2e7d32;
}

/* Field Mapping */
.import-mapping-info {
  background: #f0f7ff;
  border-left: 4px solid #1f6feb;
  padding: 12px;
  margin-bottom: 20px;
  border-radius: 4px;
  font-size: 0.9rem;
}

.import-mapping-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border: 1px solid #e3e8f0;
  border-radius: 8px;
  overflow: hidden;
}

.import-mapping-table th {
  background: linear-gradient(135deg, #f7f9fc 0%, #e3e8f0 100%);
  padding: 12px;
  text-align: left;
  font-weight: 600;
  color: #333;
  font-size: 0.9rem;
}

.import-mapping-table td {
  padding: 10px 12px;
  border-top: 1px solid #e3e8f0;
}

.import-field-map {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  font-size: 0.9rem;
}

.import-preview-cell {
  font-size: 0.85rem;
  color: #718096;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Import Options */
.import-options {
  background: #f8f9fa;
  padding: 16px;
  border-radius: 8px;
}

.import-checkbox {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  cursor: pointer;
}

.import-checkbox input[type="checkbox"] {
  margin-right: 10px;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.import-checkbox span {
  color: #333;
  font-size: 0.95rem;
}

/* Progress Bar */
.import-progress-bar {
  width: 100%;
  height: 24px;
  background: #e3e8f0;
  border-radius: 12px;
  overflow: hidden;
  margin: 16px 0;
}

.import-progress-fill {
  height: 100%;
  background: linear-gradient(135deg, #1f6feb 0%, #0056b3 100%);
  transition: width 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.85rem;
  font-weight: 600;
}

#importProgressText {
  text-align: center;
  color: #6c757d;
  font-size: 0.9rem;
  margin-top: 8px;
}

/* Import Results */
.import-results-summary {
  padding: 20px;
  background: #f8f9fa;
  border-radius: 12px;
}

.import-success {
  background: #e8f5e9;
  color: #2e7d32;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 8px;
  font-weight: 500;
}

.import-warning {
  background: #fff3e0;
  color: #f57c00;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 8px;
  font-weight: 500;
}

.import-errors {
  background: #ffebee;
  color: #c62828;
  padding: 12px 16px;
  border-radius: 8px;
  margin-top: 12px;
}

.import-errors h4 {
  margin: 0 0 8px 0;
  font-size: 0.95rem;
}

.import-errors ul {
  margin: 0;
  padding-left: 20px;
  font-size: 0.85rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .import-modal-content {
    width: 95%;
    max-height: 95vh;
    border-radius: 12px;
  }
  
  .import-modal-header {
    padding: 16px;
  }
  
  .import-modal-body {
    padding: 16px;
  }
  
  .import-file-area {
    padding: 24px;
  }
  
  .import-mapping-table {
    font-size: 0.85rem;
  }
  
  .import-mapping-table th,
  .import-mapping-table td {
    padding: 8px;
  }
  
  .import-preview-cell {
    max-width: 100px;
  }
}

/* Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Host dashboard: Manage Data page */
.mh-data-page {
  font-family: Poppins, sans-serif;
  background: linear-gradient(180deg, #f8fbff 0%, #eef4fb 100%);
  border: 1px solid #dbe7f3;
  border-radius: 16px;
  padding: 32px 28px 36px;
  box-shadow: 0 10px 28px rgba(15, 76, 129, 0.08);
  max-width: 1080px;
  margin: 0 auto;
  box-sizing: border-box;
}

.mh-data-page-header {
  text-align: center;
  margin: 0 auto 28px;
  max-width: 640px;
}

.mh-data-page-title {
  margin: 0 0 10px 0;
  font-family: Outfit, Poppins, sans-serif;
  font-size: 1.85rem;
  font-weight: 700;
  color: #0f3d73;
  letter-spacing: -0.02em;
  text-shadow: none;
}

.mh-data-page-lead {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.55;
  color: #475569;
}

.mh-data-page-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.mh-data-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 26px 24px 24px;
  display: flex;
  flex-direction: column;
  min-height: 280px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

.mh-data-card h3 {
  margin: 0 0 8px 0;
  font-family: Outfit, Poppins, sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
}

.mh-data-card-export h3 { color: #157347; }
.mh-data-card-import h3 { color: #1d4ed8; }

.mh-data-card p {
  margin: 0 0 14px 0;
  color: #64748b;
  font-size: 0.98rem;
  line-height: 1.5;
}

.mh-data-card ul {
  margin: 0 0 22px 0;
  padding-left: 1.15rem;
  color: #334155;
  font-size: 0.95rem;
  line-height: 1.55;
  flex: 1;
}

.mh-data-card li + li { margin-top: 6px; }

.mh-data-card-btn {
  width: 100%;
  min-height: 52px;
  border: none;
  border-radius: 10px;
  color: #fff !important;
  font-family: Outfit, Poppins, sans-serif;
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  cursor: pointer;
  padding: 14px 22px !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.mh-data-card-export .mh-data-card-btn {
  background: linear-gradient(135deg, #22c55e, #15803d);
  box-shadow: 0 6px 16px rgba(21, 128, 61, 0.28);
}

.mh-data-card-import .mh-data-card-btn {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  box-shadow: 0 6px 16px rgba(29, 78, 216, 0.28);
}

.mh-data-card-btn:hover {
  transform: translateY(-1px);
}

body.mh-host-import-open {
  overflow: hidden;
}

.mh-host-import-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10120;
  padding: 16px;
  box-sizing: border-box;
}

.mh-host-import-dialog {
  background: #fff;
  width: min(1080px, calc(100vw - 24px));
  max-height: min(92dvh, 920px);
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: Poppins, sans-serif;
  color: #1e293b;
}

.mh-host-import-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 22px 26px 18px;
  border-bottom: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #f8fbff, #fff);
  flex-shrink: 0;
}

.mh-host-import-header h2 {
  margin: 0 0 6px 0;
  font-family: Outfit, Poppins, sans-serif;
  font-size: 1.7rem;
  font-weight: 700;
  color: #0f3d73;
  letter-spacing: -0.02em;
}

.mh-host-import-header p {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.5;
  color: #64748b;
  max-width: 46rem;
}

.mh-host-import-close {
  flex-shrink: 0;
  min-height: 42px;
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  background: #64748b;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.mh-host-import-close:hover { background: #475569; }

.mh-host-import-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 22px 26px 8px;
}

.mh-host-import-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}

.mh-host-import-step {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 14px 16px;
}

.mh-host-import-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #1d4ed8;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.mh-host-import-step h3 {
  margin: 0 0 6px 0;
  font-size: 1.02rem;
  color: #0f172a;
}

.mh-host-import-step p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: #64748b;
}

.mh-host-import-block {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px 18px 16px;
  margin-bottom: 16px;
}

.mh-host-import-block h3 {
  margin: 0 0 6px 0;
  font-size: 1.08rem;
  color: #0f172a;
}

.mh-host-import-block > p {
  margin: 0 0 14px 0;
  font-size: 0.92rem;
  color: #64748b;
  line-height: 1.45;
}

.mh-host-import-templates {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mh-host-import-templates button {
  min-height: 44px;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
}

.mh-host-import-templates .mh-tpl-helpers {
  background: #1d4ed8;
}

.mh-host-import-templates .mh-tpl-projects {
  background: #0f766e;
}

.mh-host-import-file {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mh-host-import-file input[type="file"] {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 2px dashed #93c5fd;
  border-radius: 12px;
  background: #f8fbff;
  font-size: 1rem;
  box-sizing: border-box;
  cursor: pointer;
}

.mh-host-import-filename {
  font-size: 0.9rem;
  color: #64748b;
}

.mh-host-import-filename.is-chosen {
  color: #15803d;
  font-weight: 600;
}

.mh-host-import-select {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-size: 1rem;
  background: #fff;
  box-sizing: border-box;
}

.mh-host-import-note {
  background: #eff6ff;
  border-left: 4px solid #2563eb;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 0.92rem;
  color: #1e3a8a;
  line-height: 1.5;
}

.mh-host-import-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 100%;
  min-width: 0;
}

.mh-host-import-chip {
  background: #f1f5f9;
  color: #334155;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 600;
}

.mh-host-import-sources-lead {
  margin: 0 0 14px 0;
  font-size: 0.92rem;
  color: #64748b;
  line-height: 1.5;
}

.mh-host-import-source-group {
  margin: 0 0 16px 0;
  max-width: 100%;
  min-width: 0;
}

.mh-host-import-source-group:last-child {
  margin-bottom: 8px;
}

.mh-host-import-source-group h4 {
  margin: 0 0 8px 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #475569;
}

.mh-host-import-details {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 4px 16px 8px;
  margin-bottom: 16px;
  background: #fafafe;
}

.mh-host-import-details summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
  color: #0f172a;
  padding: 12px 0;
  list-style: none;
}

.mh-host-import-details summary::-webkit-details-marker { display: none; }

.mh-host-import-details summary::after {
  content: "Show";
  float: right;
  font-weight: 600;
  font-size: 0.85rem;
  color: #2563eb;
}

.mh-host-import-details[open] summary::after { content: "Hide"; }

.mh-host-import-guide h4 {
  margin: 12px 0 8px 0;
  font-size: 0.95rem;
  color: #334155;
}

.mh-host-import-sample {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 0.78rem;
  line-height: 1.45;
  overflow-x: auto;
  margin: 0 0 10px 0;
}

.mh-host-import-guide ul {
  margin: 0 0 12px 0;
  padding-left: 1.2rem;
  font-size: 0.9rem;
  color: #475569;
  line-height: 1.5;
}

.mh-host-import-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 26px 20px;
  border-top: 1px solid #e2e8f0;
  background: #fff;
  flex-shrink: 0;
}

.mh-host-import-footer button {
  min-height: 48px;
  min-width: 120px;
  padding: 12px 22px;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.mh-host-import-cancel {
  background: #e2e8f0;
  color: #334155;
}

.mh-host-import-submit {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  box-shadow: 0 6px 16px rgba(29, 78, 216, 0.25);
}

@media (max-width: 720px) {
  .mh-data-page {
    padding: 22px 16px 24px;
  }
  .mh-data-page-title {
    font-size: 1.45rem;
  }
  .mh-data-page-cards {
    grid-template-columns: 1fr;
  }
  .mh-data-card {
    min-height: 0;
  }
  .mh-host-import-overlay {
    padding: 8px;
    align-items: stretch;
  }
  .mh-host-import-dialog {
    width: 100%;
    max-height: 100dvh;
    border-radius: 12px;
  }
  .mh-host-import-header,
  .mh-host-import-body,
  .mh-host-import-footer {
    padding-left: 16px;
    padding-right: 16px;
  }
  .mh-host-import-header h2 {
    font-size: 1.35rem;
  }
  .mh-host-import-steps {
    grid-template-columns: 1fr;
  }
  .mh-host-import-footer {
    flex-direction: column-reverse;
  }
  .mh-host-import-footer button {
    width: 100%;
  }
}

#dataTab .mh-data-page {
  padding: 32px 28px 36px !important;
}
#dataTab .mh-data-page-title {
  font-size: 1.85rem !important;
  margin-bottom: 10px !important;
}
#dataTab .mh-data-page-lead,
#dataTab .mh-data-card p {
  font-size: 1.02rem !important;
  margin-top: 0 !important;
  color: #475569 !important;
}
#dataTab .mh-data-card-btn {
  padding: 14px 22px !important;
  font-size: 1.05rem !important;
}
@media (max-width: 720px) {
  #dataTab .mh-data-page {
    padding: 22px 16px 24px !important;
  }
  #dataTab .mh-data-page-title {
    font-size: 1.45rem !important;
  }
  #dataTab .mh-data-card-btn {
    padding: 14px 18px !important;
    font-size: 1rem !important;
  }
}