/*──────────────────────────────────────────────
       BE-REPUBLIC · UTM-CREATOR  (DARK UI KIT)
──────────────────────────────────────────────*/
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/*── TOKENS ───────────────────────────────────*/
:root {
  --bg: #0b0f1d;
  --panel: #111729;
  --header: #162036;
  --control: #1c2742;
  --accent: #a08bff;
  --accent-lite: #c3b0ff;
  --badge: #f6c65b;
  --border: #202432;
  --good: #36d399;
  --text: #e8ecfa;
  --muted: #9aa5ce;

  --r-base: 12px;
  --r-lg: 16px;
  --gap: 20px;
  --pad: 14px;
  --fz-base: 14px;
  --fz-sm: 12px;

  --tr-fast: .18s ease;

  --peek: 72px;
  /* trozo visible del card siguiente */

  font-family: 'Inter', system-ui, sans-serif;
}

/*── RESET ───────────────────────────────────*/
*,
::before,
::after {
  box-sizing: border-box
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-size: var(--fz-base);
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  overflow: hidden
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--tr-fast)
}

a:hover {
  color: var(--accent-lite)
}

button {
  font: inherit;
  border: none;
  background: none;
  cursor: pointer
}

/*── SCROLLBARS ───────────────────────────────*/
::-webkit-scrollbar {
  background: transparent;
  width: 8px;
  height: 8px
}

::-webkit-scrollbar-thumb {
  background: var(--control);
  border-radius: 6px
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent)
}

/*── FLEX LAYOUT ──────────────────────────────*/
body {
  display: flex;
  flex-direction: column;
  height: 100vh
}

.topbar {
  flex: 0 0 auto
}

.carousel-wrap {
  flex: 1 1 auto;
  min-height: 0;
  position: relative
}

footer {
  flex: 0 0 28px
}

/* 28 px fijo, mucho más bajo */

/*── TOPBAR ───────────────────────────────────*/
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--header);
  padding: var(--pad) var(--gap);
  border-bottom: 1px solid var(--border);
  height: 56px
}

.logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: .5px
}

.sheet-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fz-sm)
}

.sheet-picker select {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 4px 8px;
  border-radius: var(--r-base);
  min-width: 120px
}

.sheet-picker select:hover,
.sheet-picker select:focus {
  border-color: var(--accent);
  outline: none
}

/*── STRIP TABS ──────────────────────────────*/
.country-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  flex: 1;
  justify-content: center;
}

.country-tab {
  background: var(--panel);
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: var(--r-base);
  font-size: 13px;
  font-weight: 600;
  transition: .2s;
  cursor: pointer;
}

.country-tab:hover {
  border-color: var(--accent);
  color: var(--text);
}

.country-tab.active {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

/*── CARRUSEL ─────────────────────────────────*/
.carousel {
  display: flex;
  gap: var(--gap);
  padding: var(--gap);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-padding-left: var(--gap);
  scroll-behavior: smooth
}

.carousel::-webkit-scrollbar-track {
  background: transparent
}

.carousel::-webkit-scrollbar-thumb {
  background: var(--accent)
}

/*── FLECHAS ─────────────────────────────────*/
.nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  z-index: 10;
  transition: background 0.2s, color 0.2s;
}

.nav:hover {
  background: var(--accent);
  color: #000
}

.nav.prev {
  left: 10px
}

.nav.next {
  right: 10px
}

/*── CARD ─────────────────────────────────────*/
.card {
  flex: 0 0 calc(100% - (var(--peek) + var(--gap)));
  max-width: calc(100% - (var(--peek) + var(--gap)));
  height: calc(100vh - 56px - 28px - var(--gap)*2);
  /* topbar + footer + paddings */
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  scroll-snap-align: start;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .35)
}

.card h2 {
  margin: 0;
  padding: var(--pad) var(--gap);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.campaign-name {
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  max-width: 100%;
  text-align: center;
}

/*── CONTENIDO CON SCROLL ─────────────────────*/
.card .inner {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: var(--pad) var(--gap);
  scrollbar-width: thin
}

.card .inner::-webkit-scrollbar {
  width: 6px
}

/*── LISTA DE LINKS ───────────────────────────*/
.card .inner table {
  table-layout: fixed;
  width: 100%;
  border-collapse: collapse;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

thead {
  display: none
}

tbody {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  width: 100%;
}

tbody tr {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px;
  padding: 1px 0;
  border-bottom: 1px solid var(--border);
  flex: 1 1 auto;
  align-items: center;
  min-height: 28px;
}

tbody td {
  padding: 0;
  font-size: 11px;
  line-height: 1.1;
  color: var(--text)
}

tbody tr:nth-child(odd) {
  background: transparent
}

/* etiqueta – ahora SÍ hace wrap, nunca se corta */
tbody td:first-child {
  word-break: break-word;
  white-space: normal;
  font-weight: 500;
  color: var(--muted)
}

/* URL visible */
.url {
  display: block;
  font-size: 9px;
  line-height: 1;
  white-space: normal;
  word-break: break-all;
  color: var(--accent);
  padding: 0;
  transition: transform 0.2s ease, background 0.2s ease;
}

.url.copy:hover,
.url:hover {
  transform: scale(1.05);
  background: rgba(160, 139, 255, 0.1);
  border-radius: 4px;
}

/* badge + copy-icon */
.badge {
  background: var(--badge);
  color: #000;
  font-size: 9px;
  font-weight: 600;
  padding: 1px 4px;
  border-radius: 6px;
  margin-right: 6px;
  white-space: nowrap;
  vertical-align: text-top
}

.badge.country {
  background: #f87171;
  color: white;
  animation: blink 1s infinite alternate;
  margin-left: 0;
  margin-bottom: 2px;
  font-size: 15px;
  padding: 4px 10px;
  font-weight: 800;
  border-radius: 8px;
  text-transform: uppercase;
  box-shadow: 0 0 10px rgba(248, 113, 113, 0.6);
  display: inline-block;
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 15px rgba(248, 113, 113, 0.8);
  }

  50% {
    opacity: 0.7;
    transform: scale(0.98);
    background: #ff4747;
    box-shadow: 0 0 5px rgba(248, 113, 113, 0.3);
  }
}

.url.copy::after {
  content: '⧉';
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 10px;
  opacity: 0;
  transition: opacity var(--tr-fast)
}

.url.copy:hover::after {
  opacity: .7
}

.url.copied {
  background: var(--good) !important;
  color: #000 !important
}

.url.selected-permanent {
  background: rgba(54, 211, 153, 0.2) !important;
  color: var(--good) !important;
  border-left: 2px solid var(--good);
  padding-left: 4px;
}

/*── FOOTER ───────────────────────────────────*/
footer {
  text-align: center;
  font-size: 11px;
  padding: 4px;
  color: var(--muted);
  background: var(--control);
  border-top: 1px solid var(--border);
  z-index: 2;
}

/*── SWITCH ───────────────────────────────────*/
.switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  user-select: none;
  color: var(--muted);
  font-weight: 500
}

.switch input {
  display: none
}

.switch i {
  width: 34px;
  height: 18px;
  background: var(--border);
  border-radius: 10px;
  position: relative;
  cursor: pointer;
  transition: .25s
}

.switch i::after {
  content: '';
  position: absolute;
  left: 2px;
  top: 2px;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  transition: .25s
}

.switch input:checked+i {
  background: var(--accent)
}

.switch input:checked+i::after {
  transform: translateX(16px)
}

/*──────────────────────────────────────────────
   LANDING
──────────────────────────────────────────────*/
.landing-wrap {
  text-align: center;
  width: 100%;
  max-width: 480px;
  padding: 0 var(--gap)
}

/* branding */
.brand {
  font-size: 3rem;
  font-weight: 700;
  margin: 0 0 32px;
  color: var(--accent);
  letter-spacing: -.5px;
  transition: transform 0.3s;
}

.brand:hover {
  transform: scale(1.05);
}

/* uploader */
.uploader {
  display: flex;
  flex-direction: column;
  gap: 14px
}

.file {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 14px;
  border-radius: var(--r-lg);
  color: var(--muted);
  font-size: var(--fz-base);
  cursor: pointer;
  transition: border-color 0.3s, background 0.3s;
}

.file:hover {
  border-color: var(--accent);
  background: var(--control);
}

.file::file-selector-button {
  background: var(--accent);
  color: #000;
  font-weight: 600;
  border: none;
  padding: 8px 18px;
  border-radius: var(--r-base);
  cursor: pointer;
}

.go {
  background: var(--accent);
  color: #000;
  font-weight: 600;
  padding: 12px;
  border-radius: var(--r-lg);
  font-size: var(--fz-base);
  transition: background var(--tr-fast), transform 0.3s;
}

.go:hover {
  background: var(--accent-lite);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* hint */
.hint {
  display: block;
  margin-top: 18px;
  color: var(--muted);
  font-size: var(--fz-sm)
}