/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Note: CSS @import does not work with Propshaft's fingerprinted URLs.
 * All styles are inlined below instead.
 */

/* =============================================
   Sync Status Loader Animation
   ============================================= */

.sync-loader {
  width: 282px; /* Half size to match other images */
  height: 319px;
  background: url("/assets/sync_loader_sprite-f62d7754.png") -0 -0;
  background-size: 1410px 319px; /* Scale sprite to 50%: original 2820x638 → 1410x319 */
  background-repeat: no-repeat;
  animation: sync-frames 1.5s steps(5) infinite;
  margin: 0 auto;
  max-width: 100%;
}

/* Small variant for inline use */
.sync-loader--sm {
  width: 47px;
  height: 53px;
  background-size: 235px 53px; /* Scale down to ~1/6 of original size */
  animation: sync-frames-sm 1.5s steps(5) infinite;
}

/* Responsive sizing */
@media (max-width: 768px) {
  .sync-loader {
    width: 200px;
    height: 226px;
  }
}

@media (max-width: 480px) {
  .sync-loader {
    width: 150px;
    height: 170px;
  }
}

@keyframes sync-frames {
  from { background-position: 0px 0px; }
  to { background-position: -1410px 0px; }
}

@keyframes sync-frames-sm {
  from { background-position: 0px 0px; }
  to { background-position: -235px 0px; }
}

/* Pause animation on hover for accessibility */
.sync-loader:hover {
  animation-play-state: paused;
}

/* Loading state specific styling */
.sync-status--loading .sync-loader {
  opacity: 1;
  transition: opacity 0.3s ease;
}

.sync-status--completed .sync-loader,
.sync-status--failed .sync-loader {
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* =============================================
   Utility Classes
   ============================================= */

/* Height utility */
.h-100 {
  height: 100%;
}

/* Full height grid layout - for split-screen layouts */
.full-height-grid {
  min-height: 60vh; /* Minimum 60% of viewport height for better visual balance */
  align-items: stretch; /* Allow columns to stretch */
}

.full-height-grid .fr-col-12:first-child {
  display: flex;
  align-items: center; /* Center only the left column content */
}

.full-height-grid .fr-background-alt--blue-france {
  display: flex; /* Make right column flex to fill height */
}

/* Utility class for centering content (images, etc.) */
.center-content {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 2rem;
}

.center-content img {
  max-width: 100%;
  height: auto;
}

/* Field display layout classes */
.field-layout-container {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
  margin-bottom: 1.5rem;
}

.field-layout-container:last-child {
  margin-bottom: 0;
}

.field-layout-content {
  flex: 1;
  margin-right: 1rem;
}

.field-layout-badge {
  flex-shrink: 0;
}

.stepper__separator {
  border: none;
  border-bottom: 1px solid var(--border-default-grey);
  height: 0;
}

.badge--no-background {
  background-color: transparent;
  padding: 0;
}

/* Certificate two-columns layout */
.certificate-row {
  display: flex;
  gap: 40px;
  align-items: flex-start;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin-bottom: 20px
}

.certificate-col--left,
.certificate-col--right {
  width: 50%;
  min-width: 0;
}

.certificate-col {
  width: 100%;
}

/* Direct upload progress bar */
.direct-upload-progress {
  width: 100%;
  height: 4px;
  background-color: #e5e5e5;
  border-radius: 2px;
  overflow: hidden;
}

.direct-upload-progress-bar {
  height: 100%;
  background-color: var(--background-action-high-blue-france, #000091);
  transition: width 0.3s ease;
  width: 0%;
}

/* Visibility utility */
.hidden {
  display: none !important;
}

/* File item with delete button */
.file-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.file-link {
  flex: 1;
}

.file-delete-wrapper {
  flex-shrink: 0;
}

.file-delete-wrapper .fr-btn {
  margin: 0;
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
}

/* API Status Display */
.api-status-summary {
  font-size: 14px;
}

.api-status-count {
  font-weight: bold;
}

.api-status-count--success {
  color: #18753C;
}

.api-status-count--warning {
  color: #B34000;
}

.api-status-segments {
  display: flex;
  gap: 0.5rem;
}

.api-status-segment {
  height: 6px;
  flex: 1;
  border-radius: 2px;
}

.fr-header__operator {
  width: 128px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fr-header__operator .fr-responsive-img {
  width: 128px;
  height: 72px;
  object-fit: contain;
}

/* Renamed documents section */
.renamed-documents-list {
  margin-top: 0.5rem;
}

.renamed-document-item {
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.renamed-document-item > span {
  display: inline-block;
  vertical-align: middle;
}

.renamed-document-item .document-icon {
  margin-right: 0.5rem;
}

.renamed-document-item .rename-arrow {
  margin-right: 0.5rem;
}

.renamed-document-item svg {
  display: inline-block;
  vertical-align: middle;
}

.renamed-document-text {
  font-size: 14px;
}

/* Header navigation active state */
.fr-header .fr-links-group .fr-link.fr-link--active {
  background-color: #eee !important;
  padding: 0.25rem 0.75rem !important;
  border-radius: 4px !important;
}

.fr-badge.fr-badge--info-custom {
  background-color: var(--artwork-decorative-yellow-tournesol) !important;
  text-transform: none;
  font-weight: normal;
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Field separator */
.fr-fieldset__element--with-separator {
  border-bottom: 1px solid var(--border-default-grey, #ddd);
  padding-bottom: 1rem;
  margin-bottom: 1rem;
}

.field-badge-container {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}

/* Dropdown menu for action buttons */
.fr-dropdown {
  position: relative;
  display: inline-block;
}

.fr-dropdown__menu {
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 1000;
  min-width: 180px;
  background-color: var(--background-default-grey, #fff);
  box-shadow: 0 2px 6px rgba(0, 0, 18, 0.16);
  border: 1px solid var(--border-default-grey, #ddd);
  margin-top: 0.25rem;
}

.fr-dropdown__menu:not(.fr-collapse--expanded) {
  display: none;
}

.fr-dropdown__menu.fr-collapse--expanded {
  display: block;
}

.fr-dropdown__list {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
}

.fr-dropdown__link {
  display: block;
  padding: 0.5rem 1rem;
  color: var(--text-action-high-grey, #161616);
  text-decoration: none;
  font-size: 0.875rem;
  line-height: 1.5rem;
}

.fr-dropdown__link:hover {
  background-color: var(--background-default-grey-hover, #f6f6f6);
}

/* Modal dialog */
.fr-modal-dialog {
  border: none;
  border-radius: 4px;
  padding: 0;
  max-width: 600px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.fr-modal-dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.5);
}

.fr-modal-dialog__content {
  padding: 2rem;
}

.fr-modal-dialog__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

/* =============================================
   Shared Homepage Styles
   Common components: stepper, pictograms, screenshots
   ============================================= */

/* Stepper Component */
.homepage-step {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  position: relative;
}

.homepage-step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 23px;
  top: 48px;
  width: 0;
  height: calc(100% - 10px);
  border-left: 2px dashed var(--blue-france-sun-113-625);
}

.homepage-step__number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--blue-france-sun-113-625);
  flex-shrink: 0;
  background-color: var(--blue-france-925-125);
}

.homepage-step__content {
  padding-top: 0.25rem;
}

.homepage-step__text {
  margin: 0;
  color: var(--grey-200-850);
}

/* Pictogram Sizing */
.homepage-pictogram {
  width: 80px;
  height: 80px;
}

.homepage-pictogram--sm {
  width: 48px;
  height: 48px;
}

/* Screenshot Styling */
.homepage-screenshot {
  max-width: 400px;
  box-shadow: 0 2px 6px rgba(0, 0, 18, 0.16);
  border-radius: 4px;
}

/* =============================================
   Candidate Homepage
   ============================================= */

/* Hero Section */
.candidate-hero {
  background-color: var(--blue-france-sun-113-625);
  padding: 4rem 0;
}

.candidate-hero__title {
  color: var(--grey-1000-50);
  font-size: 2.5rem;
  line-height: 1.25;
  font-weight: 700;
}

.candidate-hero__illustration {
  width: 300px;
  height: 300px;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

/* Value Proposition Badges - Staggered layout matching Figma */
.candidate-badges-grid {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  padding-left: 1rem;
}

.candidate-badges-grid__item {
  display: inline-flex;
  align-items: center;
  font-size: 0.875rem;
  font-weight: 700;
  background-color: #f6f6f6;
  padding: 0.5rem 1rem;
  border-radius: 12px;
}

.candidate-badge-icon {
  color: #18753c !important;
}

.candidate-badges-grid__item--1 {
  margin-left: 4rem;
}

.candidate-badges-grid__item--2 {
  margin-left: 0;
}

.candidate-badges-grid__item--3 {
  margin-left: 6rem;
}

.candidate-badges-grid__item--4 {
  margin-left: 2rem;
}

/* =============================================
   Buyer Homepage
   ============================================= */

/* Hero Section - Light blue background matching Figma */
.buyer-hero {
  background-color: #F5F5FE;
  padding: 4rem 0;
}

.buyer-hero__title {
  color: #000091;
  font-size: 2.5rem;
  line-height: 1.25;
  font-weight: 700;
}

.buyer-hero__illustration {
  width: 300px;
  height: 300px;
}

/* Two Cards Component - Value Proposition Section */
.buyer-cards {
  display: flex;
  gap: 1.5rem;
  width: 100%;
}

.buyer-card {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background-color: var(--grey-1000-50);
  border-radius: 8px;
  padding: 1.5rem;
  border: 1px solid var(--grey-925-125);
}

.buyer-card__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.buyer-card__badge--green {
  background-color: #B8FEC9;
  color: #18753c;
}

.buyer-card__badge--blue {
  background-color: #E3E3FD;
  color: #000091;
}

.buyer-card__rows {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.buyer-card__row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.buyer-card__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.buyer-card__dot--green {
  background-color: #18753c;
}

.buyer-card__dot--blue {
  background-color: #000091;
}

.buyer-card__line {
  height: 6px;
  background-color: var(--grey-925-125);
  border-radius: 3px;
  flex-grow: 1;
}

/* Data columns for examples section */
.buyer-data-column {
  padding: 1.5rem;
}

.buyer-data-column .fr-list {
  margin: 0;
  padding-left: 1.25rem;
}

.buyer-data-column .fr-list li {
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

/* Drag handle */
[data-drag-handle] {
  cursor: grab;
}

/* Modal dialog */
.fr-modal-dialog {
  border: none;
  border-radius: 4px;
  padding: 0;
  max-width: 600px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.fr-modal-dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.5);
}

.fr-modal-dialog__content {
  padding: 2rem;
}

.fr-modal-dialog__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}
