/* /public/css/components/tooltip-modal.css */

/*
Standardized Tooltip Modal Styles (Pro Version)
Matches the cohesive aesthetic of 'contact-modal.css' but with enhanced
internal typography to avoid the "wall of text" look.
Targets all IDs starting with "infoModal_" to style globally.
*/

/* 1. Overlay & Positioning */
[id^="infoModal_"].modal-overlay {
  position: fixed; /* Force fixed positioning */
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(17, 24, 39, 0.85); /* Dark premium backdrop */
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);

  /*
  Z-INDEX FIX:
  Must be higher than Sidebar (1040) and Mobile Nav (10001).
  Compound selector [id^=].modal-overlay beats .modal-overlay specificity.
  */
  z-index: 12000;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fadeInTooltip 0.2s ease-out;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* 2. Modal Content Box */
[id^="infoModal_"] .modal-content {
  width: 100%;
  max-width: 550px; /* Slightly wider for better readability */
  background-color: var(--color-white);
  border-radius: var(--radius-2xl); /* Premium rounded corners */
  padding: 0;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  position: relative;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 4rem); /* Prevent overflow on small screens */
  margin: auto;
  animation: slideInTooltip 0.3s ease-out;
  border: 1px solid var(--color-gray-200);
}

/* 3. Header Styling */
[id^="infoModal_"] .modal-header {
  padding: var(--space-5) var(--space-6) var(--space-4);
  background-color: var(--color-gray-50); /* Subtle grey bg for contrast */
  border-top-left-radius: var(--radius-2xl);
  border-top-right-radius: var(--radius-2xl);
  border-bottom: 1px solid var(--color-gray-200);
  text-align: center;
  flex-shrink: 0;
}

/* Title Typography */
[id^="infoModal_"] .modal-title,
[id^="infoModal_"] h3 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--color-gray-900);
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  font-family: var(--font-family-base);
  line-height: 1.2;
}

/* Title Icon - Visible and colored for visual anchor */
[id^="infoModal_"] .modal-icon {
  display: inline-block;
  color: var(--color-primary);
  font-size: 1.1em;
}

/* 4. Body Styling */
[id^="infoModal_"] .modal-body {
  padding: var(--space-6);
  overflow-y: auto;
  color: var(--color-gray-700);
  line-height: 1.6;
  font-size: 0.95rem;
  font-family: var(--font-family-base);
}

/* Section spacing */
.info-modal-section {
  margin-bottom: var(--space-5);
}

.info-modal-section:last-child {
  margin-bottom: 0;
}

/* "Follow these steps:" header */
.info-modal-section-title {
  font-weight: 700;
  color: var(--color-gray-900);
  margin-bottom: var(--space-3);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--color-gray-100);
  padding-bottom: var(--space-2);
}

/* --- PRO LIST STYLING (Legacy Support) --- */
.info-modal-steps {
  padding: 0;
  margin: 0;
  list-style: none;
  counter-reset: step-counter;
}

.info-modal-steps li {
  position: relative;
  padding-left: 3rem; /* Space for the number badge */
  margin-bottom: var(--space-4);
  color: var(--color-gray-600);
}

.info-modal-steps li:last-child {
  margin-bottom: 0;
}

/* Number Badge */
.info-modal-steps li::before {
  counter-increment: step-counter;
  content: counter(step-counter);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  background-color: var(--color-gray-100);
  color: var(--color-gray-700);
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-gray-300);
}

/* Step Title styling (Needs <strong> in HTML) */
.info-modal-steps li strong {
  display: block;
  color: var(--color-gray-900);
  font-weight: 700;
  margin-bottom: 2px;
}

/* 5. Close Button */
[id^="infoModal_"] .modal-close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--color-gray-500);
  background-color: var(--color-white);
  border: 1px solid var(--color-gray-200);
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease-in-out;
  z-index: 20;
}

[id^="infoModal_"] .modal-close:hover {
  background-color: var(--color-gray-100);
  color: var(--color-gray-900);
  transform: rotate(90deg);
}

/* Hide generic font-awesome icons inside close button if they exist */
[id^="infoModal_"] .modal-close i {
  display: none;
}

/* Clean X icon */
[id^="infoModal_"] .modal-close::before {
  content: "\00d7";
  font-size: 24px;
  font-weight: 300;
  line-height: 1;
}

/* 6. Mobile Optimization */
@media (max-width: 767px) {
  /* Force overlay on top — compound selector (0,2,0) beats .modal-overlay (0,1,0) */
  [id^="infoModal_"].modal-overlay {
    position: fixed;
    z-index: 20000;
    padding: 1rem;
    align-items: center;
    justify-content: center;
  }

  [id^="infoModal_"] .modal-content {
    width: 100%;
    max-width: 100%;
    max-height: calc(100vh - 2rem);
    border-radius: var(--radius-xl);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  }

  [id^="infoModal_"] .modal-header {
    padding: var(--space-4);
  }

  [id^="infoModal_"] .modal-title {
    font-size: 1.25rem;
  }

  [id^="infoModal_"] .modal-body {
    padding: var(--space-4);
  }
}

/* Animations */
@keyframes fadeInTooltip {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* =================================================================
ECONOMY MODAL (Timeline Design)
================================================================= */

/* --- 1. Intro Header --- */
.economy-intro {
  text-align: center;
  margin-bottom: 2rem;
  background-color: var(--color-gray-50);
  padding: 1.5rem;
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-gray-100);
}

.economy-intro p {
  font-size: 1rem;
  color: var(--color-gray-600);
  margin: 0 0 0.75rem 0;
  font-weight: 500;
}

.economy-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 1.1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.flow-item.text-green { color: #10b981; }
.flow-item.text-red { color: var(--color-primary); }
.flow-item.text-purple { color: #7c3aed; }

.flow-arrow {
  font-size: 0.8rem;
  color: var(--color-gray-400);
}

/* --- 2. Process Label --- */
.process-header {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--color-gray-400);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1.5rem;
  padding-left: 8px; /* Align with timeline */
}

/* --- 3. Vertical Timeline (Fixed Alignment) --- */
.process-timeline {
  position: relative;
  padding: 0;
  margin-bottom: 2rem;
  margin-left: 4px; /* Slight offset from left edge */
}

/* The Vertical Line (The Spine) */
.process-timeline::before {
  content: '';
  position: absolute;
  top: 10px;
  bottom: 20px; /* Don't go all the way down */
  /*
  Math:
  Marker width = 36px. Center = 18px.
  Line width = 2px. Center = 1px.
  Left = 18px - 1px = 17px.
  */
  left: 17px;
  width: 2px;
  background-color: #e2e8f0; /* Darker Slate-200 for visibility */
  z-index: 0;
}

.timeline-step {
  position: relative;
  padding-left: 56px; /* Space for marker + gap */
  margin-bottom: 2rem;
}

.timeline-step:last-child {
  margin-bottom: 0;
}

/* The Icon Marker */
.timeline-marker {
  position: absolute;
  left: 0;
  top: 0;
  width: 36px; /* Slightly larger for icons */
  height: 36px;
  background-color: var(--color-white);
  border: 2px solid var(--color-primary);
  border-radius: 50%;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2; /* Sit on top of line */
  /* Large white shadow creates the "break" in the line */
  box-shadow: 0 0 0 6px var(--color-white);
  font-size: 0.95rem;
}

/* Icon specific alignment tweaks */
.timeline-marker i {
  /* Optical centering for specific icons */
  margin-top: 1px;
}

.timeline-marker .fa-play { 
  padding-left: 2px; /* Play icon usually looks off-center */
}

/* Content Typography */
.step-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-gray-900);
  margin: 0 0 0.5rem 0;
  line-height: 1.2;
}

.step-desc {
  font-size: 0.95rem;
  color: var(--color-gray-600);
  line-height: 1.6;
}

/* Bullet list inside description */
.step-bullet-list {
  padding-left: 1.25rem;
  margin: 0;
  list-style-type: disc;
}

.step-bullet-list li {
  margin-bottom: 0.25rem;
}

.step-bullet-list li strong {
  color: var(--color-gray-800);
}

/* --- 4. Footer Quote --- */
.economy-footer {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-gray-800);
  padding-top: 1.5rem;
  border-top: 1px dashed var(--color-gray-200);
  margin-top: 1rem;
}