/* WNF 2.0 - Setup Modal Styles */

.setup-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.setup-modal {
  background: linear-gradient(145deg, #1a1a2e 0%, #16213e 100%);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 20px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(0, 212, 255, 0.2);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Header */
.setup-modal-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 25px 30px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 212, 255, 0.05);
}

.setup-modal-icon {
  font-size: 48px;
  line-height: 1;
}

.setup-modal-title {
  flex: 1;
}

.setup-modal-title h2 {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 5px 0;
}

.setup-modal-title p {
  font-size: 14px;
  color: #aaa;
  margin: 0;
  line-height: 1.5;
}

.setup-modal-close {
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #888;
  font-size: 24px;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.setup-modal-close:hover {
  background: rgba(255, 0, 0, 0.2);
  color: #ff4444;
  transform: rotate(90deg);
}

/* Body */
.setup-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 30px;
}

/* Form */
.setup-form {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.required {
  color: #ff4444;
  margin-left: 3px;
}

.field-description {
  font-size: 12px;
  color: #888;
  margin: 0;
  line-height: 1.5;
}

/* Inputs */
.wnf-input {
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  transition: all 0.2s ease;
}

.wnf-input:focus {
  outline: none;
  border-color: #00d4ff;
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.2);
}

.wnf-input::placeholder {
  color: #666;
}

.wnf-select {
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2300d4ff' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.wnf-select:focus {
  outline: none;
  border-color: #00d4ff;
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.2);
}

.wnf-select option {
  background: #1a1a2e;
  color: #fff;
}

/* Profiles List */
.profiles-list-container {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 15px;
}

.profiles-list-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 15px;
  max-height: 200px;
  overflow-y: auto;
}

.no-profiles {
  text-align: center;
  color: #666;
  padding: 20px;
  font-style: italic;
}

.profile-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 15px;
  background: rgba(0, 212, 255, 0.1);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.profile-item:hover {
  background: rgba(0, 212, 255, 0.15);
}

.profile-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile-network {
  font-weight: 600;
  color: #fff;
  font-size: 14px;
}

.profile-url {
  font-size: 12px;
  color: #888;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-remove {
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(255, 0, 0, 0.2);
  color: #ff4444;
  font-size: 18px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-remove:hover {
  background: rgba(255, 0, 0, 0.4);
  transform: scale(1.1);
}

.add-profile-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.add-profile-row .wnf-select {
  width: 150px;
  flex-shrink: 0;
}

.add-profile-row .wnf-input {
  flex: 1;
}

.add-profile-row .wnf-btn {
  white-space: nowrap;
}

.profiles-hint {
  font-size: 12px;
  color: #666;
  margin: 10px 0 0 0;
  text-align: center;
}

/* Networks Checkboxes */
.networks-checkboxes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.network-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.network-checkbox:hover {
  border-color: rgba(0, 212, 255, 0.3);
  background: rgba(0, 212, 255, 0.1);
}

.network-checkbox input {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(0, 212, 255, 0.5);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.network-checkbox input:checked {
  background: #00d4ff;
  border-color: #00d4ff;
}

.network-checkbox input:checked::after {
  content: '✓';
  display: block;
  text-align: center;
  color: #000;
  font-size: 12px;
  font-weight: bold;
  line-height: 14px;
}

.network-checkbox span {
  color: #ddd;
  font-size: 14px;
}

/* DB Connection */
.db-connection-fields {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.db-row {
  display: flex;
  gap: 15px;
}

.db-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.db-field label {
  font-size: 12px;
  color: #888;
}

.db-field-small {
  max-width: 100px;
}

#test-connection-btn {
  align-self: flex-start;
}

#connection-status {
  margin-left: 10px;
  font-size: 14px;
}

#connection-status .loading {
  color: #ffd700;
}

#connection-status .success {
  color: #00ff00;
}

#connection-status .error {
  color: #ff4444;
}

/* Visual Mapper */
.visual-mapper-container {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 20px;
  min-height: 150px;
}

.mapper-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 30px;
  color: #666;
}

.mapper-placeholder span {
  font-size: 48px;
}

.mapper-hint {
  font-size: 12px;
  color: #888;
  margin: 0 0 15px 0;
}

.mapper-tables {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.table-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.table-checkbox:hover {
  background: rgba(0, 212, 255, 0.2);
}

.table-checkbox input {
  appearance: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0, 212, 255, 0.5);
  border-radius: 3px;
  cursor: pointer;
}

.table-checkbox input:checked {
  background: #00d4ff;
  border-color: #00d4ff;
}

.table-checkbox span {
  color: #ddd;
  font-size: 13px;
}

/* Footer */
.setup-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 15px;
  padding: 20px 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
}

/* Buttons */
.wnf-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.wnf-btn-primary {
  background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
  color: #000;
}

.wnf-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(0, 212, 255, 0.5);
}

.wnf-btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.wnf-btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.wnf-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Scrollbar */
.setup-modal-body::-webkit-scrollbar {
  width: 8px;
}

.setup-modal-body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.setup-modal-body::-webkit-scrollbar-thumb {
  background: rgba(0, 212, 255, 0.3);
  border-radius: 4px;
}

.setup-modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 212, 255, 0.5);
}

/* Responsive */
@media (max-width: 600px) {
  .setup-modal {
    width: 95%;
    max-height: 95vh;
    border-radius: 15px;
  }

  .setup-modal-header {
    padding: 20px;
  }

  .setup-modal-icon {
    font-size: 36px;
  }

  .setup-modal-title h2 {
    font-size: 20px;
  }

  .setup-modal-body {
    padding: 20px;
  }

  .add-profile-row {
    flex-wrap: wrap;
  }

  .add-profile-row .wnf-select,
  .add-profile-row .wnf-input {
    width: 100%;
  }

  .db-row {
    flex-direction: column;
  }

  .db-field-small {
    max-width: none;
  }

  .setup-modal-footer {
    flex-direction: column;
  }

  .setup-modal-footer .wnf-btn {
    width: 100%;
  }
}
