/* css/components/modals.css */

/* =========================================================================
   1. GLOBAL MODAL BASE STYLES
   ========================================================================= */

/* Modal overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.85); /* Darker Slate for focus */
  display: none;
  align-items: flex-start; 
  justify-content: center;
  padding: 100px var(--space-4) var(--space-8) var(--space-4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: modalFadeIn var(--transition-fast) var(--ease-out);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  z-index: 11000;
}
.modal-overlay.is-visible {
  display: flex;
}
  
@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
  
/* Modal content container */
.modal-content {
  width: 100%;
  max-width: 500px;
  background-color: var(--color-white);
  border-radius: 16px; /* Modern radius */
  padding: var(--space-6);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  position: relative;
  animation: modalSlideIn var(--transition-fast) var(--ease-out);
  max-height: 90vh;
  overflow-y: auto;
}
  
@keyframes modalSlideIn {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
  
/* Modal close button */
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--color-gray-500);
  transition: all var(--transition-fast) var(--ease-in-out);
  cursor: pointer;
  background-color: transparent;
  border: none;
  z-index: 10;
  font-size: 24px;
}

.modal-close:hover {
  background-color: var(--color-gray-100);
  color: var(--color-gray-900);
  transform: rotate(90deg);
}
  
/* Modal title */
.modal-content h2,
.modal-content h3 {
  color: var(--color-gray-900);
  margin-bottom: var(--space-4);
  font-weight: var(--font-weight-semibold);
}
  
/* Modal buttons container */
.modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-6);
}
  
.btn-modal-primary {
  background-color: var(--color-primary);
  color: var(--color-white);
  border: none;
  border-radius: var(--radius-lg);
  padding: var(--space-2) var(--space-4);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: all var(--transition-fast) var(--ease-in-out);
}
  
.btn-modal-primary:hover {
  background-color: var(--color-primary-dark);
}
  
.btn-modal-secondary {
  background-color: var(--color-gray-200);
  color: var(--color-gray-700);
  border: none;
  border-radius: var(--radius-lg);
  padding: var(--space-2) var(--space-4);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: all var(--transition-fast) var(--ease-in-out);
}
  
.btn-modal-secondary:hover {
  background-color: var(--color-gray-300);
  color: var(--color-gray-800);
}
  
/* Modal form elements */
.modal-content .form-group {
  margin-bottom: var(--space-4);
}

.modal-content .form-label {
  display: block;
  margin-bottom: var(--space-2);
  font-weight: var(--font-weight-medium);
}

.modal-content .form-control {
  width: 100%;
  padding: var(--space-3);
  border: 1px solid var(--color-gray-300);
  border-radius: var(--radius-lg);
  transition: all var(--transition-fast) var(--ease-in-out);
}

.modal-content .form-control:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
  outline: none;
}

/* =========================================================================
   2. EARNINGS INFO & TOOLTIPS (Existing Feature)
   ========================================================================= */

#creditEarningsInfo {
  background-color: var(--color-gray-50);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  margin: var(--space-4) 0;
}

.earnings-row {
  display: flex;
  align-items: center;
  padding: var(--space-1) 0;
  position: relative;
}

.earnings-row.total {
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--color-gray-200);
  font-size: var(--font-size-base);
}

.earnings-row .fa-coins {
  color: #F7C702;
  margin-right: var(--space-1);
}

.tooltip-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-color: var(--color-gray-300);
  color: var(--color-white);
  font-size: var(--font-size-xs);
  margin-right: var(--space-2);
  cursor: pointer;
}

.tooltip-content {
  position: absolute;
  top: 100%;
  left: 0;
  background-color: var(--color-white);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  box-shadow: var(--shadow-md);
  z-index: 10;
  display: none;
  width: 250px;
  font-size: var(--font-size-sm);
}

#suggestedNicheWrapper { margin-top: 12px; }

/* =========================================================================
   3. CURRENCY CONVERTER MODAL (Existing Feature)
   ========================================================================= */

.currency-converter-modal-dialog {
  max-width: 450px;
}

.currency-converter-modal-header {
  text-align: center;
  margin-bottom: var(--space-4);
}

.currency-converter-modal-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--color-gray-900);
  margin: 0 0 var(--space-2);
}

.currency-converter-modal-header p {
  color: var(--color-gray-600);
  margin: 0;
}

.currency-converter-modal-body {
  margin-bottom: var(--space-4);
}

.currency-result-container {
  margin-top: var(--space-4);
  background-color: var(--color-gray-50);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  text-align: center;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#currency-result-text {
  font-size: var(--font-size-lg);
  color: var(--color-gray-800);
  margin: 0;
}

#currency-result-text strong {
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
}

.currency-converter-modal-footer {
  font-size: var(--font-size-sm);
  color: var(--color-gray-500);
  text-align: center;
  background-color: var(--color-gray-100);
  padding: var(--space-3);
  margin: var(--space-6) calc(-1 * var(--space-6)) calc(-1 * var(--space-6)); /* Negative margin to bleed */
  border-bottom-left-radius: var(--radius-xl);
  border-bottom-right-radius: var(--radius-xl);
}

.currency-result-container .spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* =========================================================================
   4. UPGRADE MODAL LISTS (Existing Feature)
   ========================================================================= */

.feature-list-aligned {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: left;
}

.feature-list-aligned li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--color-gray-700);
}

.feature-list-aligned li:last-child {
  margin-bottom: 0;
}

.feature-list-aligned li i {
  margin-top: 3px;
  flex-shrink: 0;
  width: 16px;
  text-align: center;
}

.feature-list-aligned li span strong {
  color: var(--color-gray-900);
  font-weight: 600;
}

/* =========================================================================
   5. DNA VERIFICATION MODAL - HIGH END FLAT DESIGN (REVAMPED)
   ========================================================================= */

.dna-modal-content {
  max-width: 600px;
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 16px; /* Larger radius for premium feel */
  overflow: visible;
}

/* Header */
.dna-modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
  border-radius: 16px 16px 0 0;
}

/* Alignment Fix: Ensures content is vertically centered */
.dna-modal-header .dna-header-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dna-modal-content .dna-modal-title {
  margin: 0;
  font-size: 1.25rem;
  color: #0f172a;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1; /* Stops large line-height from shifting text up */
}

/* Avatar */
.dna-modal-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #e2e8f0;
  margin: 0; /* Prevent margins from breaking alignment */
}

/* Body */
.dna-modal-body {
  padding: 2rem;
  background-color: #ffffff;
}

/* Inputs - High End Feel (Taller, Flatter) */
.dna-modal-content .form-control,
.dna-modal-content .form-select-sm {
  height: 50px; /* Force Height */
  padding: 0 16px;
  font-size: 0.95rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background-color: #ffffff;
  color: #1e293b;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.dna-modal-content .form-control:focus {
  border-color: #7c3aed; /* Force Purple Focus */
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
  outline: none;
}

/* Custom Dropdown Arrow */
.dna-modal-content select.form-control {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23334155' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 12px 12px;
  padding-right: 2.5rem;
}

/* Tag Container */
.dna-tags-input-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px;
  min-height: 50px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  transition: all 0.2s;
}

.dna-tags-input-wrapper:focus-within {
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

/* --- INLINE VALIDATION STYLES (Error State) --- */
.dna-tags-input-wrapper.is-invalid {
  border-color: #ef4444; /* Red */
  background-color: #fef2f2;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
  animation: shake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.dna-field-error {
  color: #ef4444;
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  animation: slideDown 0.2s ease-out;
}

.dna-field-error::before {
  content: "\f071"; /* FontAwesome Exclamation Triangle */
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  font-size: 0.8em;
}

@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

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

/* The actual text input inside the tag box */
.dna-tag-input {
  border: none;
  outline: none;
  flex: 1;
  min-width: 120px;
  font-size: 0.95rem;
  padding: 4px 0;
  margin-top: 2px;
  background: transparent;
  color: #1e293b;
}

/* Tag Chips - Rectangular/Flat */
.dna-tag-chip {
  display: inline-flex;
  align-items: center;
  background-color: #f8fafc;
  color: #334155;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.85rem;
  font-weight: 600;
  user-select: none;
}

.dna-tag-chip:hover {
  background-color: #f1f5f9;
  border-color: #cbd5e1;
}

.dna-tag-chip__remove {
  background: none;
  border: none;
  color: #94a3b8;
  margin-left: 8px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
}
.dna-tag-chip__remove:hover { color: #ef4444; }

/* The "Velvet Rope" Sponsor Box (Green Highlight) */
.dna-sponsor-wrapper {
  background: #f0fdf4; /* Mint Green */
  border: 1px solid #86efac;
  border-radius: 12px;
  padding: 16px;
  margin-top: 24px;
}

.dna-sponsor-wrapper label {
  color: #166534; /* Dark Green Text */
  font-weight: 700;
}

.dna-sponsor-wrapper .dna-tags-input-wrapper {
  border-color: #86efac;
  box-shadow: none;
}

/* Footer & Main Button */
.dna-modal-footer {
  padding: 1.5rem 2rem;
  background-color: #ffffff;
  border-top: 1px solid #f1f5f9;
  border-radius: 0 0 16px 16px;
}

/* Force Purple Button - High Specificity */
#save-dna-btn {
  background-color: #7c3aed;
  border: 1px solid #7c3aed;
  color: white;
  font-size: 1rem;
  font-weight: 700;
  height: 52px;
  border-radius: 10px;
  box-shadow: 0 4px 6px -1px rgba(124, 58, 237, 0.3);
  width: 100%;
  transition: all 0.2s ease;
}

#save-dna-btn:hover {
  background-color: #6d28d9;
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(124, 58, 237, 0.3);
}

/* "Complete Later" Dismiss Button */
.dna-dismiss-btn {
  display: block;
  width: 100%;
  margin-top: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: none;
  border: none;
  color: var(--color-gray-500);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: color 0.2s ease;
  text-align: center;
}
.dna-dismiss-btn:hover {
  color: var(--color-gray-700);
}

/* Alerts */
.dna-context-alert {
  background-color: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  display: flex;
  gap: 12px;
  font-size: 0.9rem;
}

.dna-context-alert.alert-warning {
  background-color: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}

/* Loading Animation - Radar */
.dna-scanner-wrapper {
  position: relative;
  width: 100px;
  height: 100px;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dna-scanner-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #e2e8f0;
  position: relative;
  z-index: 2;
  background-color: #f1f5f9;
}

.dna-radar-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid #7c3aed; /* Brand Purple */
  opacity: 0;
  z-index: 1;
}

.dna-radar-ring:nth-child(1) {
  width: 72px;
  height: 72px;
  animation: pulse-ring 2s infinite ease-out;
}

.dna-radar-ring:nth-child(2) {
  width: 72px;
  height: 72px;
  animation: pulse-ring 2s infinite ease-out 0.6s;
}

.dna-radar-ring:nth-child(3) {
  width: 72px;
  height: 72px;
  animation: pulse-ring 2s infinite ease-out 1.2s;
}

@keyframes pulse-ring {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
  100% { transform: translate(-50%, -50%) scale(2); opacity: 0; }
}

/* Loading Text */
.dna-loading-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 8px;
  min-height: 1.5em;
}

/* Secure Badge */
.dna-secure-badge {
  margin-top: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  background-color: #f8fafc;
  padding: 6px 12px;
  border-radius: 99px;
  border: 1px solid #e2e8f0;
}
.dna-secure-badge i { color: #10b981; }

/* Responsive */
@media (max-width: 767px) {
  .modal-content {
    max-width: 90%;
    padding: var(--space-4);
  }
  
  .modal-buttons {
    flex-direction: column-reverse;
  }
  
  .modal-buttons button {
    width: 100%;
  }

  .modal-overlay {
    padding-top: 90px; 
    padding-left: var(--space-3);
    padding-right: var(--space-3);
    padding-bottom: var(--space-6);
  }
  
  /* DNA Specific Mobile Overrides */
  .dna-modal-content {
    max-width: 100%;
    width: 100%;
    border-radius: 0; 
    max-height: 100vh;
    height: 100vh;
  }
  
  .dna-modal-header {
    border-radius: 0;
  }
  
  .dna-modal-footer {
    border-radius: 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 20;
    box-shadow: 0 -4px 6px -1px rgba(0,0,0,0.05);
  }
  
  .dna-modal-body {
    padding-bottom: 100px; /* Make room for fixed footer */
  }
  
  .dna-modal-content .dna-form-row-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}


/* =========================================================================
   MEDIA KIT EXPLAINER MODAL
   ========================================================================= */

.mk-explainer-modal {
    z-index: 10000;
}

.mk-explainer-content {
    max-width: 500px;
    border-radius: var(--radius-xl);
}

.mk-explainer-header {
    border-bottom: 1px solid var(--color-gray-100);
    padding: 1.5rem 1.5rem 1rem;
}

.mk-explainer-header-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mk-explainer-icon {
    width: 42px;
    height: 42px;
    background: #f0fdf4;
    color: var(--color-success-dark);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.mk-explainer-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--color-gray-800);
}

.mk-explainer-subtitle {
    margin: 2px 0 0;
    color: var(--color-gray-500);
    font-size: 0.85rem;
}

.mk-explainer-body {
    padding: 1.5rem;
}

.mk-explainer-benefits {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.mk-explainer-benefit {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.mk-explainer-benefit-icon {
    font-size: 1.2rem;
    margin-top: 2px;
    flex-shrink: 0;
}
.mk-explainer-benefit-icon--money { color: var(--color-brand-blue); }
.mk-explainer-benefit-icon--commission { color: #ea580c; }
.mk-explainer-benefit-icon--verify { color: var(--color-gray-600); }

.mk-explainer-benefit-title {
    display: block;
    color: var(--color-gray-800);
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.mk-explainer-benefit-desc {
    margin: 0;
    font-size: 0.9rem;
    color: var(--color-gray-500);
    line-height: 1.4;
}

.mk-explainer-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--color-gray-100);
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    background-color: #fcfcfc;
    border-bottom-left-radius: var(--radius-xl);
    border-bottom-right-radius: var(--radius-xl);
}

.mk-explainer-footer-buttons {
    display: flex;
    gap: 12px;
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.mk-explainer-btn-preview {
    background: var(--color-white);
    border: 1px solid var(--color-gray-200);
    color: var(--color-gray-800);
    font-weight: 600;
    padding: 10px 16px;
    flex: 1 1 auto;
    justify-content: center;
    min-width: 140px;
}

.mk-explainer-btn-activate {
    background-color: var(--color-success-dark);
    border-color: var(--color-success-dark);
    color: var(--color-white);
    padding: 10px 20px;
    flex: 1 1 auto;
    justify-content: center;
    min-width: 140px;
}
.mk-explainer-btn-activate:hover {
    background-color: var(--color-success);
    border-color: var(--color-success);
}

.mk-explainer-btn-view {
    width: 100%;
    justify-content: center;
}

.mk-explainer-status-text {
    margin-right: auto;
}