/**
 * Frontend Styles - FTP Resultados por Pastas
 * Federação de Triatlo de Portugal
 */

.ftp-results-folders {
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
  font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.ftp-event-title {
  font-family: "Alexandria", Arial, Helvetica, sans-serif;
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 1.5rem 0;
  padding: 0;
  text-align: left;
  line-height: 1.3;
}

@media (max-width: 768px) {
  .ftp-event-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
  }
}

.ftp-folders {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.ftp-folder {
  background: #f8f8f8;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  will-change: transform, box-shadow;
}

.ftp-folder:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(0,0,0,0.1);
}

.ftp-folder-tab {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 1.6rem;
  cursor: pointer;
  color: #fff;
  font-weight: 600;
  font-size: 1.15rem;
  user-select: none;
  transition: background-color 0.2s ease;
  will-change: background-color;
}

.ftp-folder-tab:active {
  opacity: 0.95;
}

.sprint-tab {
  background-color: #078569;
}

.standard-tab {
  background-color: #136356;
}

.ftp-folder-tab .ftp-arrow {
  display: inline-block;
  transition: transform 0.35s cubic-bezier(0.65, 0, 0.35, 1);
  will-change: transform;
  transform-origin: center;
}

.ftp-folder.open .ftp-folder-tab .ftp-arrow {
  transform: rotate(90deg);
}

/* Conteúdo interno */
.ftp-folder-content {
  max-height: 0;
  overflow: hidden;
  background: #fff;
  border-top: 2px solid rgba(0,0,0,0.05);
  transition: max-height 0.9s cubic-bezier(0.65, 0, 0.35, 1);
  will-change: max-height;
}

.ftp-folder.open .ftp-folder-content {
  max-height: 90vh;
}

/* Área de scroll */
.ftp-inner-scroll {
  height: 70vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #999 transparent;
}

/* PDF viewer */
.pdf-viewer {
  width: 100%;
  height: 70vh;
  border: none;
  display: block;
}

/* Controles mobile para PDF */
.pdf-mobile-controls {
  display: none;
  padding: 15px;
  background: #f5f5f5;
  border-bottom: 2px solid #ddd;
  position: sticky;
  top: 0;
  z-index: 100;
}

.pdf-open-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  background: #078569;
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background-color 0.3s ease;
  border: none;
  cursor: pointer;
}

.pdf-open-button:hover,
.pdf-open-button:focus {
  background-color: #136356;
  text-decoration: none;
  outline: 2px solid rgba(7, 133, 105, 0.3);
  outline-offset: 2px;
}

.pdf-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

/* Mensagem quando não há conteúdo */
.ftp-no-content {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  padding: 20px;
  color: #666;
  font-size: 1.1rem;
  font-style: italic;
  background: #f9f9f9;
  border-radius: 8px;
  margin: 20px;
  text-align: center;
}

/* Scrollbar customizada para webkit */
.ftp-inner-scroll::-webkit-scrollbar {
  width: 8px;
}

.ftp-inner-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.ftp-inner-scroll::-webkit-scrollbar-thumb {
  background-color: #999;
  border-radius: 8px;
}

.ftp-inner-scroll::-webkit-scrollbar-thumb:hover {
  background-color: #666;
}

/* Estados de carregamento */
.ftp-folder-content.loading::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin-left: -20px;
  margin-top: -20px;
  border: 4px solid #f3f3f3;
  border-top-color: #078569;
  border-radius: 50%;
  animation: ftp-spin 0.8s linear infinite;
  z-index: 10;
}

@keyframes ftp-spin {
  to { transform: rotate(360deg); }
}

/* Mensagem de erro */
.ftp-error {
  padding: 20px;
  background: #fff8dc;
  border-left: 4px solid #f39c12;
  border-radius: 4px;
  color: #c87f0a;
  margin: 20px 0;
  font-size: 0.95rem;
}

/* Responsivo - Tablet */
@media (max-width: 768px) {
  .ftp-folder-tab {
    font-size: 1rem;
    padding: 1rem;
  }

  .ftp-folder.open .ftp-folder-content {
    max-height: 85vh;
  }

  .ftp-inner-scroll,
  .pdf-viewer {
    height: 65vh;
  }

  /* Mostrar botão mobile */
  .pdf-mobile-controls {
    display: block;
  }
}

/* Responsivo - Dispositivos pequenos */
@media (max-width: 480px) {
  .ftp-folders {
    gap: 0.8rem;
  }

  .ftp-folder {
    border-radius: 8px;
  }

  .ftp-folder-tab {
    font-size: 0.9rem;
    padding: 0.9rem 1rem;
  }

  .ftp-folder.open .ftp-folder-content {
    max-height: 80vh;
  }

  .ftp-inner-scroll,
  .pdf-viewer {
    height: 60vh;
  }

  .pdf-open-button {
    font-size: 0.9rem;
    padding: 12px 16px;
    width: 100%;
  }

  .pdf-icon {
    font-size: 1.2rem;
  }
}

/* Acessibilidade */
.ftp-folder-tab:focus {
  outline: 2px solid #078569;
  outline-offset: -2px;
}

.ftp-folder-tab:focus:not(:focus-visible) {
  outline: none;
}

/* Print styles */
@media print {
  .ftp-folder-tab .ftp-arrow {
    display: none;
  }

  .ftp-folder-content {
    max-height: none !important;
  }

  .ftp-folder {
    page-break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
  }

  .pdf-mobile-controls {
    display: none;
  }
}
/* =================================================================
   COUNTDOWN STYLES
   ================================================================= */

.ftp-countdown-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  min-height: 400px;
  background: linear-gradient(135deg, #078569 0%, #136356 100%);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  margin: 20px 0;
}

.ftp-countdown-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 10px;
  text-align: center;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.ftp-countdown-subtitle {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 40px;
  text-align: center;
}

.ftp-countdown-timer {
  display: flex;
  gap: 20px;
  margin-bottom: 30px;
  flex-wrap: wrap;
  justify-content: center;
}

.ftp-countdown-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  padding: 20px 25px;
  border-radius: 12px;
  min-width: 100px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
}

.ftp-countdown-item:hover {
  transform: translateY(-5px);
}

.ftp-countdown-value {
  font-size: 3rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  margin-bottom: 2px; 
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.ftp-countdown-label {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.ftp-countdown-info {
  text-align: center;
  color: rgba(255, 255, 255, 0.8);
  font-size: 1rem;
  line-height: 1.6;
}

.ftp-countdown-date {
  font-weight: 600;
  color: #fff;
  display: block;
  margin-top: 5px;
  font-size: 1.1rem;
}

/* =================================================================
   LIVE BANNER STYLES
   ================================================================= */

.ftp-live-banner {
  position: relative;
  z-index: -1;
  width: 100%;
  max-width: 100%;
  left: auto;
  right: auto;
  margin-left: 0;
  margin-right: 0;
  margin: 0;
  padding: 0.62rem 1rem;
  background: linear-gradient(125deg, #136356 0%, #078569 100%);
  color: #fff;
  box-sizing: border-box;
  overflow: hidden;
  isolation: isolate;
  border-radius: 0;
}

.ftp-live-banner p,
.ftp-live-banner dl,
.ftp-live-banner ol,
.ftp-live-banner ul,
.ftp-live-banner blockquote,
.ftp-live-banner pre,
.ftp-live-banner table {
  margin-top: 0;
  margin-bottom: 0;
}

.ftp-live-banner p:not(:last-child),
.ftp-live-banner dl:not(:last-child),
.ftp-live-banner ol:not(:last-child),
.ftp-live-banner ul:not(:last-child),
.ftp-live-banner blockquote:not(:last-child),
.ftp-live-banner pre:not(:last-child),
.ftp-live-banner table:not(:last-child) {
  margin-bottom: 0;
}

/* Breakout controlado para temas/builder (ex: Avada) */
.fusion-builder-row .ftp-live-banner,
.fusion-text .ftp-live-banner,
.post-content .ftp-live-banner {
  width: 100vw;
  max-width: 100vw;
  left: auto;
  transform: none;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

.ftp-live-banner::before {
  content: "";
  position: absolute;
  z-index: 0;
  pointer-events: none;
  inset: 0 auto 0 -35%;
  width: 35%;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0),
    rgba(255, 255, 255, 0.18),
    rgba(255, 255, 255, 0)
  );
  transform: skewX(-18deg);
  animation: ftp-live-sweep 4.5s linear infinite;
}

.ftp-live-banner::after {
  content: none;
}

.ftp-live-banner-inner {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
}

.ftp-live-banner-text {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content 1fr;
  align-items: center;
  column-gap: 0.65rem;
  min-width: 0;
  flex: 1 1 auto;
}

.ftp-live-banner-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(0, 0, 0, 0.15);
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  flex-shrink: 0;
  line-height: 1;
  height: 24px;
  align-self: center;
}

.ftp-live-banner-badge::before {
  content: "";
  display: block;
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #ff5b5b;
  box-shadow: 0 0 0 0 rgba(255, 91, 91, 0.9);
  animation: ftp-live-pulse 1.4s ease-out infinite;
}

.ftp-live-banner-event-title {
  display: flex;
  align-items: center;
  margin: 0;
  font-size: clamp(0.92rem, 1.45vw, 1.05rem);
  line-height: 1;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 24px;
}

.ftp-live-banner-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.42rem 0.9rem;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid #fff;
  color: #136356;
  background: #fff;
  font-weight: 700;
  font-size: 0.78rem;
  white-space: nowrap;
  flex-shrink: 0;
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
  line-height: 1;
  height: 24px;
  align-self: center;
}

.ftp-live-banner-button:hover,
.ftp-live-banner-button:focus {
  text-decoration: none;
  color: #fff;
  background: transparent;
  transform: translateY(-1px);
}

@keyframes ftp-live-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 91, 91, 0.9);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(255, 91, 91, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 91, 91, 0);
  }
}

@keyframes ftp-live-sweep {
  0% {
    left: -35%;
  }
  100% {
    left: 125%;
  }
}

@media (max-width: 768px) {
  .ftp-live-banner {
    padding: 0.62rem 0.8rem;
  }

  .fusion-builder-row .ftp-live-banner,
  .fusion-text .ftp-live-banner,
  .post-content .ftp-live-banner {
    left: auto;
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    max-width: 100%;
  }

  .ftp-live-banner-inner {
    align-items: center;
    gap: 0.5rem;
  }

  .ftp-live-banner-text {
    column-gap: 0.5rem;
  }

  .ftp-live-banner-event-title {
    font-size: 0.9rem;
  }

  .ftp-live-banner-button {
    width: auto;
    padding: 0.36rem 0.72rem;
    font-size: 0.72rem;
  }
}

/* Responsivo - Tablet */
@media (max-width: 768px) {
  .ftp-countdown-container {
    padding: 40px 20px;
    min-height: 350px;
  }

  .ftp-countdown-title {
    font-size: 1.5rem;
  }

  .ftp-countdown-subtitle {
    font-size: 1rem;
    margin-bottom: 30px;
  }

  .ftp-countdown-timer {
    gap: 15px;
  }

  .ftp-countdown-item {
    padding: 15px 20px;
    min-width: 85px;
  }

  .ftp-countdown-value {
    font-size: 2.5rem;
  }

  .ftp-countdown-label {
    font-size: 0.8rem;
  }
}

/* Responsivo - Mobile */
@media (max-width: 480px) {
  .ftp-countdown-container {
    padding: 30px 15px;
    min-height: 300px;
  }

  .ftp-countdown-title {
    font-size: 1.3rem;
  }

  .ftp-countdown-subtitle {
    font-size: 0.9rem;
    margin-bottom: 25px;
  }

  .ftp-countdown-timer {
    gap: 10px;
  }

  .ftp-countdown-item {
    padding: 12px 15px;
    min-width: 70px;
  }

  .ftp-countdown-value {
    font-size: 2rem;
  }

  .ftp-countdown-label {
    font-size: 0.75rem;
  }

  .ftp-countdown-info {
    font-size: 0.9rem;
  }

  .ftp-countdown-date {
    font-size: 1rem;
  }
}