/*!* static/css/global.css *!*/
/* Keyframe animations */
@keyframes draw {
    to {
        stroke-dashoffset: 0;
    }
}

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

@keyframes fgxPulse {
  0%   { transform: scale(1);   box-shadow: 0 0 0 0 rgba(0,0,0,0.15); }
  70%  { transform: scale(1.08); box-shadow: 0 0 0 10px rgba(0,0,0,0); }
  100% { transform: scale(1);   box-shadow: 0 0 0 0 rgba(0,0,0,0); }
}

.fgx-pulse {
  animation: fgxPulse 1.8s ease-out infinite;
}

.sankeyWrapper {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    box-sizing: border-box;
}

#sankeyDiagram {
    box-sizing: border-box;
    margin: 10px;
    border: 1px solid #1E2761;
    border-radius: 8px;
    padding: 20px;
    overflow: hidden;
}

.fgx-btn {
  background-color: #1E2761;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  padding: 10px 20px;
  border: none;
  border-radius: 15px;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0; /* removes old 20px vertical margins */
  height: 35px; /* consistent height */
  line-height: 1;
}

.fgx-btn:hover { background-color: #2C9EFF; }
.fgx-btn:active { transform: translateY(1px); }

.fgx-btn--secondary {
  background: #fff;
  color: #1E2761;
  border: 1px solid #d7dcff;
}
.fgx-btn--secondary:hover { background: #eef2ff; }

#loading-bar-container {
    display: none;
    position: relative;
    width: 100%;
    height: 30px;
    background-color: #f3f3f3;
    border: 1px solid #ccc;
    border-radius: 50px;
    margin: 20px 0;
    text-align: center;
}

#loading-bar {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #2C9EFF, #1E2761);
    background-size: 200% 100%;
    background-position: left center;
    border-radius: 50px;
    transition: width 0.4s ease, background-position 1s linear;
    box-shadow: 0 0 8px rgba(44, 158, 255, 0.5);
    overflow: hidden;
}

#loading-bar-text {
    position: absolute !important;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: black;
    font-weight: bold;
    font-size: 14px;
    display: block;
}

/* Animate background shifting while loading */
@keyframes shimmer {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 100% 50%;
    }
}

#loading-bar.active {
    animation: shimmer 2s infinite linear;
}

.form-container {
    margin: 20px auto; /* center horizontally */
    padding: 20px;
    background-color: white; /* optional: makes it pop on light blue background */
    border-radius: 10px; /* optional: soft rounded corners */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05); /* optional: subtle shadow */
    width: calc(100% - 40px); /* full width minus padding on small screens */
}

.form-container h1 {
    padding: 0;
}

.form-container h2 {
    color: #1E2761;
    padding: 10px 0;
}

/* Stop the global 50% widths from affecting the toolbar */
#sankeyForm .advanced-options .fgx-toolbar label,
#sankeyForm .advanced-options .fgx-toolbar button,
#sankeyForm .advanced-options .fgx-toolbar select {
  width: auto;
  display: inline-flex;
  margin-bottom: 0;
}

.dropdown-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap; /* allows wrapping on smaller screens */
}

.dropdown-field {
    flex: 1;
    min-width: 200px;
}

.dropdown-field label {
    white-space: nowrap;         /* ❌ Prevent line wrapping */
    display: inline-block;       /* ✅ Let it respect container sizing */
    max-width: 100%;             /* ✅ Allow it to shrink when needed */
    overflow: hidden;            /* optional: clean cutoff if too long */
    text-overflow: ellipsis;     /* optional: add "..." if trimmed */
    color: #1E2761;
}

.dropdown-field select {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 1rem;
}

/* generic reveal helper */
.is-visible {
  opacity: 1;
  transform: none;
}

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

#fiscalSection { display: none; }
#fiscalSection.show {
  display: block;
  animation: fadeIn 0.25s ease-out forwards;
  position: relative;
  z-index: 20; /* keep it above toolbar */
}

#advancedOptions { display: none; }
#advancedOptions.show {
  display: block;
  animation: fadeIn 0.25s ease-out forwards;
}

/* reset any stray margins */
.advanced-options label,
.advanced-options input,
.advanced-options select,
.advanced-options button {margin: 0;}
.advanced-options { width: 100%; }

/* ensure the overall choices container is positioned so its dropdown can escape */
.choices {
  position: relative;
  z-index: 10;             /* ensure its wrapper sits above #advancedOptions */
}

/* the menu itself must be absolutely positioned and very high z-index */
.choices__list--dropdown {z-index: 10000;}

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

.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    max-width: 500px;
    text-align: center;
    width: 90%;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    z-index: 100000; /* Make sure it's above other elements */
}

.modal-button {
    display: inline-block;
    padding: 0.6rem 1rem;
    margin: 0.5rem;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 4px;
}

.modal-button.secondary {
    background: #6c757d;
}

.modal-close {
    background: transparent;
    border: none;
    color: #333;
    font-size: 1rem;
    margin-top: 1rem;
    cursor: pointer;
}


.spinner-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(255, 255, 255, 0.8);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-family: sans-serif;
  color: #333;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 5px solid #999;
  border-top: 5px solid #3498db;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin-bottom: 15px;
}

/* ---- FinGraphicx Sankey toolbar ---- */
.fgx-toolbar{
  display:flex;
  align-items:center;
  gap:16px;
  flex-wrap:wrap;
  padding:12px 16px;
  background:#fff;
  border:1px solid #e7eaf3;
  border-radius:14px;
  box-shadow:0 1px 2px rgba(16,24,40,.04);
  width: 100%;
}

.fgx-field{display:flex;flex-direction:column;gap:6px;min-width:180px}
.fgx-field--slim{min-width:220px}
.fgx-field label{font-size:1rem;font-weight:600;color:#475467}

.fgx-slider{display:flex;align-items:center;gap:10px;min-width:220px}
.fgx-badge{
  min-width:36px;text-align:center;font-weight:600;font-size:13px;
  color:#1d2559;background:#eef2ff;border:1px solid #d7dcff;
  border-radius:10px;padding:6px 8px
}

.fgx-hint {
  margin-top: 12px;
  font-size: 1rem;
  color: #475467;
}
.fgx-hintpanel {
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid #e7eaf3;
  border-radius: 12px;
  background: #f9fafb;
  color: #475467;
  font-size: 1rem;
}
.fgx-hintpanel p { margin: 0.35rem 0; }

.fgx-link {
  background: none;
  border: none;
  color: #2C9EFF;
  cursor: pointer;
  font-weight: 600;
}

/* Range input */
input[type="range"]{appearance:none;-webkit-appearance:none;width:100%;height:6px;background:#dfe3f0;border-radius:999px;outline:none}
input[type="range"]::-webkit-slider-thumb{
  -webkit-appearance:none;appearance:none;width:18px;height:18px;background:#fff;border:2px solid #1d2559;border-radius:50%;
  box-shadow:0 1px 2px rgba(16,24,40,.14);cursor:pointer
}
input[type="range"]::-moz-range-track{height:6px;background:#dfe3f0;border-radius:999px}
input[type="range"]::-moz-range-thumb{
  width:18px;height:18px;background:#fff;border:2px solid #1d2559;border-radius:50%;box-shadow:0 1px 2px rgba(16,24,40,.14);cursor:pointer
}

/* Select */
.fgx-select{
  appearance:none;-webkit-appearance:none;-moz-appearance:none;
  padding:10px 36px 10px 12px;
  border:1px solid #e6e8ef;border-radius:12px;background:#fff;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 20 20' fill='none'><path d='M5 7l5 6 5-6' stroke='%231d2559' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat:no-repeat;background-position:right 10px center;
  font-weight:600;color:#1d2559;min-width:140px;cursor:pointer
}
.fgx-select:focus{outline:none;border-color:#b8bef5;box-shadow:0 0 0 3px rgba(29,37,89,.12)}

/* Buttons */
.fgx-spacer{flex:1}

/* Mobile: stack nicely */
@media (max-width: 900px){
  .fgx-field--slim{min-width:100%}
  .fgx-slider{min-width:0;width:100%}
}

.fgx-switch {
  margin-top: 8px;
  font-size: 1rem;
  color: #475467;
}

.fgx-switch__link {
  color: #2C9EFF;
  font-weight: 600;
  text-decoration: none;
}

.fgx-switch__link:hover {
  text-decoration: underline;
}

.fgx-switch__link.is-disabled {
  color: #98A2B3;
  cursor: not-allowed;
  pointer-events: none;
  text-decoration: none;
}

.fgx-switch__note {
  margin-left: 10px;
  color: #667085;
  font-size: 1rem;
}

.seo-text {
  margin: 1rem auto 0 auto;         /* center */
  padding: 1.5rem 1.25rem 0 1.25rem;/* add side padding */
  border-top: 1px solid #e7eaf3;
  color: #667085;
  font-size: 1rem;
}

.seo-text summary {
  cursor: pointer;
  font-weight: 700;
  color: #101828;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  user-select: none;
  outline: none;
}

/* Remove default marker and provide a clean chevron */
.seo-text summary::-webkit-details-marker { display: none; }
.seo-text summary::before {
  content: "▸";
  display: inline-block;
  transform: translateY(-1px);
  transition: transform 0.15s ease;
  color: #475467;
}
.seo-text[open] summary::before { transform: rotate(90deg) translateY(-1px); }

.seo-text__body {
  margin-top: 0.75rem;
}

.seo-text__body h2 {
  margin: 0 0 0.5rem 0;
  color: #101828;
  font-size: 1.5rem;
  line-height: 1.25;
}

.seo-text__body p {
  margin: 0.5rem 0;
}

