/**
 * Astra Project Create Dialog Styles
 */

/* Modal Mask */
.astra-modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 40000;
}

/* Modal Dialog */
.astra-modal-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 560px;
  max-height: 90vh;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
  z-index: 40001;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header */
.astra-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
  background: #fafafa;
}

.astra-modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #111;
}

.astra-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #6b7280;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.astra-modal-close:hover {
  background: #f3f4f6;
  color: #111;
}

/* Step Indicators */
.astra-modal-steps {
  display: flex;
  padding: 16px 20px;
  gap: 8px;
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
}

.astra-step {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 13px;
  color: #9ca3af;
  background: #f9fafb;
  border-radius: 6px;
  transition: all 0.2s;
}

.astra-step span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: #e5e7eb;
  color: #6b7280;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 600;
}

.astra-step.active {
  background: #eff6ff;
  color: #1d4ed8;
}

.astra-step.active span {
  background: #3b82f6;
  color: #fff;
}

.astra-step.completed {
  color: #059669;
}

.astra-step.completed span {
  background: #10b981;
  color: #fff;
}

/* Body */
.astra-modal-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  min-height: 300px;
}

.astra-step-content {
  animation: fadeIn 0.2s ease;
}

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

.astra-step-desc {
  margin: 0 0 16px;
  color: #6b7280;
  font-size: 14px;
}

/* Loading */
.astra-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: #6b7280;
  font-size: 14px;
}

/* Domain Selection */
.astra-domain-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.astra-domain-card {
  padding: 14px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}

.astra-domain-card:hover:not(.disabled) {
  border-color: #93c5fd;
  background: #f0f9ff;
}

.astra-domain-card.selected {
  border-color: #3b82f6;
  background: #eff6ff;
}

.astra-domain-card.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #f9fafb;
}

.astra-domain-name {
  font-weight: 600;
  font-size: 15px;
  color: #111;
  margin-bottom: 4px;
}

.astra-domain-desc {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.4;
}

.astra-domain-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 11px;
  padding: 2px 8px;
  background: #fef3c7;
  color: #92400e;
  border-radius: 4px;
  font-weight: 500;
}

/* Form Groups */
.astra-form-group {
  margin-bottom: 16px;
}

.astra-form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 6px;
}

.astra-form-group label .required {
  color: #ef4444;
}

.astra-form-group input[type="text"],
.astra-form-group textarea,
.astra-form-group select {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  color: #111;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}

.astra-form-group input:focus,
.astra-form-group textarea:focus,
.astra-form-group select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.astra-form-group select:disabled {
  background: #f3f4f6;
  color: #9ca3af;
  cursor: not-allowed;
}

.astra-form-group textarea {
  resize: vertical;
  min-height: 80px;
}

/* Selected Domain Display */
.astra-selected-domain {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #f0f9ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
}

.astra-selected-domain .astra-label {
  color: #6b7280;
}

.astra-selected-domain .astra-value {
  font-weight: 600;
  color: #1d4ed8;
}

/* Confirmation */
.astra-confirm-list {
  background: #f9fafb;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}

.astra-confirm-item {
  display: flex;
  padding: 10px 0;
  border-bottom: 1px solid #e5e7eb;
}

.astra-confirm-item:last-child {
  border-bottom: none;
}

.astra-confirm-item .astra-label {
  flex: 0 0 100px;
  font-size: 13px;
  color: #6b7280;
}

.astra-confirm-item .astra-value {
  flex: 1;
  font-size: 14px;
  color: #111;
  font-weight: 500;
}

.astra-confirm-note {
  background: #fefce8;
  border: 1px solid #fde047;
  border-radius: 8px;
  padding: 14px;
  font-size: 13px;
  color: #713f12;
}

.astra-confirm-note p {
  margin: 0 0 8px;
  font-weight: 500;
}

.astra-confirm-note ul {
  margin: 0;
  padding-left: 20px;
}

.astra-confirm-note li {
  margin: 4px 0;
}

/* Footer */
.astra-modal-footer {
  padding: 16px 20px;
  border-top: 1px solid #e5e7eb;
  background: #fafafa;
}

.astra-error {
  display: none;
  margin-bottom: 12px;
  padding: 10px 14px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  color: #dc2626;
  font-size: 13px;
}

.astra-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Buttons */
.astra-btn {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
}

.astra-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.astra-btn-primary {
  background: #3b82f6;
  color: #fff;
}

.astra-btn-primary:hover:not(:disabled) {
  background: #2563eb;
}

.astra-btn-secondary {
  background: #fff;
  color: #374151;
  border: 1px solid #d1d5db;
}

.astra-btn-secondary:hover:not(:disabled) {
  background: #f3f4f6;
}

/* ============================================
   Project Dashboard Styles
   ============================================ */

.astra-projects-page {
  font-family: system-ui, sans-serif;
  margin: 16px;
  padding-bottom: 60px;
}

.astra-projects-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.astra-projects-header h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
}

.astra-projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

/* Project Card */
.astra-project-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.2s, transform 0.2s;
  cursor: pointer;
}

.astra-project-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.astra-project-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.astra-project-card-title {
  font-size: 16px;
  font-weight: 600;
  color: #111;
  margin: 0;
}

.astra-project-card-domain {
  font-size: 12px;
  padding: 4px 10px;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 4px;
  font-weight: 500;
}

.astra-project-card-location {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 12px;
}

.astra-project-card-phase {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 500;
}

.astra-project-card-phase.setup {
  background: #f3f4f6;
  color: #6b7280;
}

.astra-project-card-phase.data_collection {
  background: #fef3c7;
  color: #92400e;
}

.astra-project-card-phase.analysis {
  background: #dbeafe;
  color: #1e40af;
}

.astra-project-card-phase.review {
  background: #d1fae5;
  color: #065f46;
}

.astra-project-card-phase.complete {
  background: #dcfce7;
  color: #166534;
}

.astra-project-card-date {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 12px;
}

/* Empty State */
.astra-empty-state {
  text-align: center;
  padding: 60px 20px;
  background: #f9fafb;
  border-radius: 12px;
  border: 2px dashed #e5e7eb;
}

.astra-empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.astra-empty-state-title {
  font-size: 18px;
  font-weight: 600;
  color: #374151;
  margin: 0 0 8px;
}

.astra-empty-state-desc {
  font-size: 14px;
  color: #6b7280;
  margin: 0 0 20px;
}

/* Responsive */
@media (max-width: 640px) {
  .astra-modal-dialog {
    width: 95%;
    max-height: 95vh;
  }

  .astra-modal-steps {
    padding: 12px 16px;
    gap: 4px;
  }

  .astra-step {
    padding: 6px 8px;
    font-size: 11px;
  }

  .astra-step span {
    width: 18px;
    height: 18px;
    font-size: 10px;
  }

  .astra-modal-body {
    padding: 16px;
  }

  .astra-projects-grid {
    grid-template-columns: 1fr;
  }
}
