/* ==========================================================================
   MODALS.CSS - Styles des modals et popups GrainBoard
   
   Charte graphique: style professionnel et sobre
   - Fond sombre avec dégradé subtil
   - Accents bleus pour la cohérence avec la plateforme
   - Bordures discrètes, pas de couleurs vives
   ========================================================================== */

/* --------------------------------------------------------------------------
   Unified Upgrade Modal (generated by JS access-control.js)
   Single, consistent design for all upgrade prompts
   -------------------------------------------------------------------------- */
.upgrade-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.upgrade-modal-content {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  padding: 32px 40px;
  max-width: 480px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.upgrade-modal-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(148, 163, 184, 0.3);
  border-radius: 50%;
}

.upgrade-modal-icon svg {
  width: 24px;
  height: 24px;
}

.upgrade-modal-content h3 {
  color: #e6eef8;
  margin: 0 0 12px 0;
  font-size: 1.35rem;
  font-weight: 600;
}

.upgrade-modal-content p {
  color: #94a3b8;
  line-height: 1.6;
  margin: 0 0 20px 0;
  font-size: 0.95rem;
}

.upgrade-modal-benefits {
  text-align: left;
  margin: 0 0 24px 0;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  border-left: 3px solid rgba(148, 163, 184, 0.3);
  list-style: none;
}

.upgrade-modal-benefits li {
  color: #94a3b8;
  font-size: 0.9rem;
  line-height: 1.8;
  padding-left: 20px;
  position: relative;
}

.upgrade-modal-benefits li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #60a5fa;
}

.upgrade-modal-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.upgrade-btn-primary {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 32px;
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
  color: white;
  border: none;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 200px;
}

.upgrade-btn-primary:hover {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.upgrade-btn-price {
  font-size: 12px;
  opacity: 0.85;
  font-weight: 500;
  margin-top: 2px;
}

.upgrade-btn-close {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 13px;
  cursor: pointer;
  padding: 8px 16px;
  transition: color 0.2s;
}

.upgrade-btn-close:hover {
  color: #94a3b8;
}

.upgrade-btn-link {
  color: #60a5fa;
  font-size: 13px;
  text-decoration: none;
  transition: color 0.2s;
}

.upgrade-btn-link:hover {
  color: #93c5fd;
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Legacy Premium Modal (for backwards compatibility)
   These classes are still used in some PHP pages
   -------------------------------------------------------------------------- */
.premium-modal,
.premium-spread-modal,
.premium-overlay-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 10000;
  align-items: center;
  justify-content: center;
}

.premium-modal.show,
.premium-spread-modal.show,
.premium-overlay-modal.show {
  display: flex;
}

.premium-modal-content {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  padding: 32px 40px;
  max-width: 480px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.premium-modal-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(148, 163, 184, 0.3);
  border-radius: 50%;
  color: #94a3b8;
  font-size: 20px;
  font-weight: 600;
  /* Remove colored backgrounds - keep neutral */
  background: transparent !important;
}

.premium-modal-icon svg {
  width: 24px;
  height: 24px;
  stroke: #94a3b8 !important;
  fill: none;
}

.premium-modal-content h2 {
  color: #e6eef8;
  margin-bottom: 16px;
  font-size: 1.35rem;
  font-weight: 600;
}

/* Remove colored text in titles - keep all white */
.premium-modal-content h2 span {
  background: none !important;
  -webkit-background-clip: unset !important;
  background-clip: unset !important;
  -webkit-text-fill-color: #e6eef8 !important;
  color: #e6eef8 !important;
}

.premium-modal-content p {
  color: #94a3b8;
  line-height: 1.6;
  margin-bottom: 24px;
  font-size: 0.95rem;
}

/* Remove colored strong text */
.premium-modal-content p strong {
  color: #e6eef8 !important;
}

/* Premium Benefits Box - neutral styling */
.premium-benefits {
  text-align: left;
  margin: 20px 0;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  border-left: 3px solid rgba(148, 163, 184, 0.3);
  color: #94a3b8;
  font-size: 0.9rem;
  line-height: 1.8;
}

/* Modal Buttons Container - simplified */
.premium-modal-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.premium-modal-buttons button,
.premium-modal-buttons a {
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

/* Single upgrade button style - all blue */
.premium-modal-buttons .btn-premium {
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%) !important;
  color: white !important;
  border: none !important;
  min-width: 200px;
}

.premium-modal-buttons .btn-premium:hover {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* Link to see all features */
.premium-modal-buttons .btn-link {
  background: transparent !important;
  color: #60a5fa !important;
  font-size: 13px !important;
  padding: 8px 16px !important;
  min-width: auto !important;
}

.premium-modal-buttons .btn-link:hover {
  color: #93c5fd !important;
  text-decoration: underline;
}

/* Hide legacy secondary upgrade buttons (Or get Pro) but not btn-link */
.premium-modal-buttons a:not(.btn-premium):not(.btn-close):not(.btn-link) {
  display: none !important;
}

.premium-modal-buttons .btn-close {
  background: transparent;
  color: #64748b;
  border: none;
  font-size: 13px;
  padding: 8px 16px;
}

.premium-modal-buttons .btn-close:hover {
  color: #94a3b8;
}

/* Legacy compatibility buttons */
.premium-modal-content .btn {
  display: inline-block;
  padding: 12px 24px;
  margin: 4px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  font-size: 14px;
}

.premium-modal-content .btn-primary,
.premium-modal-content .btn-accent {
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
  color: white;
}

.premium-modal-content .btn-primary:hover,
.premium-modal-content .btn-accent:hover {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  transform: translateY(-1px);
}

.premium-modal-content .btn-secondary {
  background: transparent;
  border: none;
  color: #64748b;
}

.premium-modal-content .btn-secondary:hover {
  color: #94a3b8;
}

/* --------------------------------------------------------------------------
   Premium Locked Value (inline indicator)
   -------------------------------------------------------------------------- */
.premium-locked-value {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.premium-locked-value:hover {
  opacity: 0.8;
}

/* --------------------------------------------------------------------------
   Generic Modal
   -------------------------------------------------------------------------- */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 24px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h2 {
  margin: 0;
  color: #e6eef8;
  font-size: 1.25rem;
}

.modal-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.2s;
}

.modal-close:hover {
  color: #e6eef8;
}

.modal-body {
  color: #e6eef8;
}

.modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* --------------------------------------------------------------------------
   Map Popups (Leaflet)
   -------------------------------------------------------------------------- */
.popup-title {
  font-weight: bold;
  color: #e6eef8;
  font-size: 14px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.popup-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
}

.popup-label {
  color: #94a3b8;
  font-size: 12px;
}

.popup-value {
  font-weight: 600;
  color: #e6eef8;
  font-size: 12px;
}

/* --------------------------------------------------------------------------
   Confirmation Modal
   -------------------------------------------------------------------------- */
.confirm-modal-content {
  max-width: 400px;
  text-align: center;
}

.confirm-modal-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.confirm-modal-icon.warning {
  color: #f59e0b;
}

.confirm-modal-icon.danger {
  color: #ef4444;
}

.confirm-modal-icon.info {
  color: #60a5fa;
}

.confirm-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 24px;
}

/* --------------------------------------------------------------------------
   Tooltip
   -------------------------------------------------------------------------- */
.tooltip {
  position: absolute;
  background: #1e293b;
  color: #e6eef8;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  z-index: 10001;
  max-width: 300px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

.tooltip::after {
  content: '';
  position: absolute;
  border: 6px solid transparent;
}

.tooltip.top::after {
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-top-color: #1e293b;
}

.tooltip.bottom::after {
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-bottom-color: #1e293b;
}
