﻿/* Import/Export Manager Styles */

.import-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  width: min(900px, 90vw);
  max-height: 90vh;
  overflow-y: auto;
  z-index: 1000;
}

.import-container::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: -1;
}

.import-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(15, 23, 42, 0.98);
  z-index: 10;
  backdrop-filter: blur(10px);
}

.import-header h4 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.import-body {
  padding: 24px;
  background: rgba(11, 18, 36, 0.5);
}

.import-instructions {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}

.import-instructions p {
  margin: 6px 0;
  color: var(--text);
  font-size: 14px;
}

.import-instructions strong {
  color: var(--primary);
}

.file-upload-area {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 40px 20px;
  text-align: center;
  background: rgba(15, 23, 42, 0.8);
  transition: all 0.3s ease;
  cursor: pointer;
}

.file-upload-area:hover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.08);
}

.file-upload-area p {
  margin: 8px 0;
  color: var(--muted);
}

.import-preview {
  animation: fadeIn 0.3s ease;
  background: rgba(15, 23, 42, 0.6);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

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

.import-preview h5 {
  color: var(--text);
  margin: 0 0 16px 0;
  font-size: 16px;
}

.mapping-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 10px;
  margin-bottom: 16px;
  color: var(--text);
}

.mapping-info strong {
  color: var(--success);
}

.mapping-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.mapping-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mapping-item label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.mapping-select {
  background: #0b1224;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 10px;
  outline: none;
  transition: border 0.2s;
  font-family: inherit;
}

.mapping-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.preview-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 20px;
  max-height: 300px;
  overflow-y: auto;
  background: rgba(11, 18, 36, 0.8);
}

.preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.preview-table thead {
  position: sticky;
  top: 0;
  background: #0b1224;
  z-index: 1;
}

.preview-table th,
.preview-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.preview-table th {
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}

.preview-table tbody tr:hover {
  background: rgba(99, 102, 241, 0.08);
}

.import-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* Enhanced table styles for patients view */
.data-table-enhanced {
  width: 100%;
  border-collapse: collapse;
}

.data-table-enhanced thead {
  position: sticky;
  top: 0;
  background: #0b1224;
  z-index: 5;
}

.data-table-enhanced th {
  padding: 12px;
  text-align: left;
  font-weight: 700;
  color: var(--primary);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.data-table-enhanced td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.data-table-enhanced tbody tr {
  transition: background 0.2s;
  cursor: pointer;
}

.data-table-enhanced tbody tr:hover {
  background: rgba(99, 102, 241, 0.08);
}

.data-table-enhanced tbody tr.selected {
  background: rgba(99, 102, 241, 0.15);
  border-left: 3px solid var(--primary);
}

/* Action buttons toolbar */
.actions-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.actions-toolbar button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: 14px;
  white-space: nowrap;
}

.actions-toolbar .divider {
  width: 1px;
  height: 24px;
  background: var(--border);
  margin: 0 4px;
}

/* Compact view for patient detail */
.patient-detail-compact {
  width: 400px;
  max-width: 100%;
  background: #0b1224;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 200px);
}

.patient-detail-header-compact {
  padding: 16px;
  background: rgba(99, 102, 241, 0.1);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
}

.patient-detail-header-compact h4 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
}

.patient-detail-body-compact {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.split-view-enhanced {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 16px;
  align-items: start;
}

@media (max-width: 1200px) {
  .split-view-enhanced {
    grid-template-columns: 1fr;
  }
  
  .patient-detail-compact {
    width: 100%;
  }
}

/* Professional detail view styles */
.professional-detail-view {
  padding: 4px;
}

.detail-sections {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.detail-section {
  background: rgba(15, 23, 42, 0.5);
  padding: 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.detail-section h5 {
  margin: 0 0 12px 0;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.detail-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-field label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.detail-field span {
  font-size: 14px;
  color: var(--text);
}

.detail-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
