/* ============================================================================
 *  MOBILE UX FIXES — v1.40.0
 *  Στόχος: κανένα cut element, κανένα overflow, σωστή ροή σε κινητό.
 *  Φόρτωσε ΜΕΤΑ το styles.css για να υπερισχύσει.
 * ============================================================================ */

/* ── Global mobile safety ── */
* { box-sizing: border-box; }
html, body { max-width: 100vw; overflow-x: clip; }
.view, .page { max-width: 100%; min-width: 0; }

/* Όλες οι εικόνες & video να μη ξεχειλίζουν */
img, video, svg, canvas { max-width: 100%; height: auto; }

/* Πίνακες & wide elements να scrollάρουν αντί να σπάνε */
.list, .stats, .panel, .card { max-width: 100%; }
.list__row, .rowitem { min-width: 0; }
.list__main { min-width: 0; flex: 1; }
.list__title, .list__sub, .rowitem__title, .rowitem__meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* ── Stats grid responsive ── */
@media (max-width: 480px) {
  .stats {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
  .stats--3 {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px !important;
  }
  .stat, .ministat {
    padding: 10px 8px !important;
    min-width: 0;
  }
  .stat__value, .ministat__value {
    font-size: 18px !important;
  }
  .stat__label, .ministat__label {
    font-size: 11px !important;
    line-height: 1.2;
  }
}

/* ── Race countdown — να μη κόβεται ── */
.race-countdown {
  overflow: hidden;
  word-wrap: break-word;
}
@media (max-width: 420px) {
  .race-countdown {
    padding: 14px !important;
  }
  .race-countdown > div > div {
    min-width: 0 !important;
  }
}

/* ── Race leaderboards: στήλες σε κινητό ── */
@media (max-width: 480px) {
  .race-lb {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
}

/* ── Routes ── */
.route-card {
  overflow: visible;
  max-width: 100%;
}
.route-card__img {
  height: 120px;
  background-size: cover;
  background-position: center;
}
.route-card__actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.route-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 2px 0 4px;
}
.route-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}
.route-badge--gpx {
  background: color-mix(in srgb, var(--yes) 18%, var(--surface-2));
  color: var(--yes);
  border: 1px solid color-mix(in srgb, var(--yes) 35%, var(--border));
}
.route-badge--cutoff {
  background: color-mix(in srgb, var(--no) 14%, var(--surface-2));
  color: var(--no);
  border: 1px solid color-mix(in srgb, var(--no) 30%, var(--border));
}
.route-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 8px;
  margin: 8px 0 4px;
}
@media (max-width: 480px) {
  .route-card__img { height: 130px; }
  .route-stats {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .route-stat { padding: 8px 6px; }
  .route-stat__v { font-size: 14px; }
  .route-stat__l { font-size: 10px; }
}
.route-map {
  position: relative;
  z-index: 0; /* να μη σκεπάζει το menu */
  min-height: 220px;
}
.route-tabs {
  display: flex;
  gap: 6px;
  margin: 14px 0 10px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.route-tabs::-webkit-scrollbar { display: none; }
.route-tabs__btn {
  flex: 0 0 auto;
  border: 0;
  background: none;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  min-height: 40px;
  touch-action: manipulation;
}
.route-tabs__btn.is-active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ── Results ── */
.result-row {
  min-width: 0;
}
.result-row__main {
  min-width: 0;
  flex: 1;
}
.result-row__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Dashboard feed preview (mobile) ── */
.dash-feed { display: none; }
.dash-feed__list { display: grid; gap: 2px; }
.dash-feed__row {
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  cursor: pointer;
  font-family: inherit;
  padding: 10px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
}
.dash-feed__row:last-child { border-bottom: none; }
.dash-feed__ava {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
  color: var(--primary);
  background: var(--primary-soft);
}
.dash-feed__copy {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
}
.dash-feed__time { font-size: 11px; margin-top: 2px; }
@media (max-width: 900px) {
  .dash-feed {
    display: block;
    margin-top: 4px;
  }
  .dash-feed__row {
    min-height: 56px;
    align-items: center;
    gap: 10px;
    display: flex;
    padding: 10px 2px;
  }
}

/* ── Community feed (mobile) ── */
.community .feed__post,
.community .feed__media,
.community .ig-media {
  max-width: 100%;
  overflow: hidden;
}
@media (max-width: 480px) {
  .community .feed__post { border-radius: 14px; }
  .community .feed__media,
  .community .ig-media { max-height: min(72vw, 420px); }
  .community .feed__acts { flex-wrap: wrap; }
  .community .feed__act { min-height: 44px; padding: 8px 10px; }
  .community .rc-hero__cta { flex-direction: column; align-items: stretch; }
  .community .rc-cta { width: 100%; min-height: 44px; justify-content: center; }
  .community .rc-count { flex-direction: column; align-items: flex-start; gap: 10px; }
  .community .composer__bar { flex-wrap: wrap; }
  .community .composer__input,
  .community .cmt-add .input { font-size: 16px !important; }
  .community-post, .feed-item, .feed__post {
    max-width: 100%;
    overflow: hidden;
    word-wrap: break-word;
  }
}

/* ── Community feed (posts, comments, composer) — root-cause overflow fix ──
   Το feed είναι grid και τα comments/σχόλια flex. Τα grid/flex items έχουν
   εξ ορισμού min-width:auto, οπότε πολύ μεγάλες λέξεις/links «σπρώχνουν» το
   περιεχόμενο έξω από την κάρτα (κόβεται στην άκρη λόγω του overflow-x:hidden).
   Εδώ επιβάλλουμε min-width:0 + σωστό σπάσιμο λέξεων για να μη ξεχειλίζει τίποτα. */
.feed { min-width: 0; }
.feed__post {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.feed__head { min-width: 0; }
.feed__meta { min-width: 0; flex: 1; }
.feed__author,
.feed__time,
.feed__body {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.feed__media {
  max-width: 100%;
  height: auto;
}
.feed__comments { min-width: 0; }
.cmt { min-width: 0; }
.cmt__body {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.cmt__name,
.cmt__text {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.cmt-add { min-width: 0; }
.cmt-add .input { min-width: 0; }

/* Composer: textarea & κουμπιά να μη ξεχειλίζουν σε στενή οθόνη */
.composer__top { min-width: 0; }
.composer__top .textarea { min-width: 0; }
.composer__bar { flex-wrap: wrap; }

/* ── Community feed Phase 3 — mobile hardening ──
   Φίλτρα, enterprise post header, hero & sponsors σε στενές οθόνες. */
.community.view {
  min-width: 0;
  overflow-x: hidden;
}
@media (max-width: 480px) {
  .community.view {
    padding-bottom: calc(120px + env(safe-area-inset-bottom, 0)) !important;
  }
  .community .re-feed-filters {
    -webkit-overflow-scrolling: touch;
    margin: 0 -2px 8px;
    padding-bottom: 4px;
  }
  .community .re-feed-filter {
    min-height: 44px;
    padding: 8px 14px;
    font-size: 12px;
  }
  .community .ep-post,
  .community .ep-post__head {
    min-width: 0;
  }
  .community .ep-post__author,
  .community .ep-post__meta,
  .community .ep-post__body,
  .community .ig-caption {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .community .ep-post__meta {
    gap: 4px;
  }
  .community .ep-post__org {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .community .ep-post__acts {
    flex-wrap: wrap;
    gap: 2px;
  }
  .community .rc-hero__id {
    min-width: 0;
    flex: 1;
  }
  .community .rc-hero__title {
    overflow-wrap: anywhere;
    word-break: break-word;
    font-size: 20px;
  }
  .community .rc-hero {
    padding: 16px;
    border-radius: 18px;
  }
  .community .sponsors__head {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .community .sponsors__strip {
    -webkit-overflow-scrolling: touch;
  }
  .community .cmt-add {
    flex-wrap: wrap;
  }
  .community .cmt-add .input {
    flex: 1 1 140px;
    min-width: 0;
  }
  .community .cmt-add .btn {
    min-height: 44px;
    flex-shrink: 0;
  }
  .community .composer__bar .btn {
    min-height: 44px;
  }
}

/* ── Athlete profile hero ── */
.athlete-profile .card {
  max-width: 100%;
  overflow: hidden;
}

/* ── Volunteers ── */
.vol__card {
  max-width: 100%;
  overflow: hidden;
}

/* ── Modal: να μη πιάνει όλη την οθόνη με padding ── */
@media (max-width: 480px) {
  .modal {
    max-width: 100vw !important;
    width: 100% !important;
    margin: 0 !important;
    border-radius: 16px 16px 0 0 !important;
    max-height: 92vh;
  }
  .modal__body {
    max-height: calc(92vh - 120px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ── Drawer width fix ── */
@media (max-width: 480px) {
  .drawer {
    max-width: 88vw !important;
  }
}

/* ── Form inputs: full width με padding ── */
@media (max-width: 480px) {
  .input, .textarea, select.input {
    font-size: 16px !important; /* iOS zoom prevention */
    max-width: 100%;
  }
  .grid2 {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
}

/* ── Page header & breadcrumbs ── */
.pagehead {
  flex-wrap: wrap;
  gap: 8px;
}
.pagehead__text {
  min-width: 0;
  flex: 1;
}
.pagehead__title {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* ── Membership card mobile ── */
@media (max-width: 480px) {
  .mcard {
    max-width: 100%;
    padding: 16px !important;
  }
  .mcard__qr svg {
    max-width: 90px;
    max-height: 90px;
  }
  .mcard__name {
    font-size: 16px !important;
    word-break: break-word;
  }
}

/* ── Tabs: scroll αντί για σπάσιμο ── */
.tabs {
  overflow-x: auto;
  flex-wrap: nowrap !important;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs__tab { white-space: nowrap; flex-shrink: 0; }

/* ── Bottom nav safety (iOS notch) ── */
.tabbar {
  padding-bottom: env(safe-area-inset-bottom, 0);
}

/* ── Hero sections ── */
.identity-hero, .hero {
  max-width: 100%;
  overflow: hidden;
}

/* ── Fix για κάρτες με grid 3 στηλών ── */
@media (max-width: 380px) {
  .stats--3 {
    grid-template-columns: repeat(3, 1fr) !important;
  }
  .ministat__value {
    font-size: 16px !important;
  }
}

/* ── Buttons: μη κόβονται ── */
.btn {
  min-width: 0;
  white-space: nowrap;
}
.btn--block {
  width: 100%;
  white-space: normal;
}

/* ============================================================================
 *  HOMEPAGE MOBILE NAV — δείξε "Σύνδεση Μελών" σε ΟΛΕΣ τις οθόνες
 *  Bug: το αρχικό CSS έκρυβε το login button κάτω από 920px (μόνο desktop).
 * ============================================================================ */
.lp-nav__login {
  display: inline-flex !important;
  align-items: center;
  background: none;
  border: 1.5px solid var(--border, #d1d5db);
  border-radius: 8px;
  cursor: pointer;
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
  padding: 7px 12px;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .lp-nav {
    padding: 10px 12px !important;
    gap: 6px !important;
  }
  .lp-nav__brand span,
  .lp-nav__brand b {
    font-size: 16px !important;
  }
  .lp-nav__right {
    gap: 6px !important;
  }
  .lp-nav__login {
    font-size: 12px !important;
    padding: 6px 10px !important;
  }
  .lp-nav__cta {
    font-size: 12px !important;
    padding: 7px 12px !important;
  }
}

@media (max-width: 360px) {
  .lp-nav__brand b,
  .lp-nav__brand > span:not(.lp-nav__logoMark):not(.lp-nav__logoGlow) {
    display: none;
  }
  .lp-nav__login {
    font-size: 11.5px !important;
    padding: 6px 8px !important;
  }
}

/* ============================================================================
 *  EXTRA MOBILE POLISH — v1.41.0
 *  Volunteers, Members, Events, Settings — full mobile parity
 * ============================================================================ */

/* Volunteers card */
.vol__card {
  max-width: 100%;
  overflow: hidden;
  word-wrap: break-word;
}
.vol__head {
  flex-wrap: wrap;
  gap: 6px;
}

/* Members list — όλα τα row να μη ξεχειλίζουν */
.list__row {
  flex-wrap: nowrap;
  min-width: 0;
}
.member-row {
  flex-wrap: wrap;
  gap: 8px;
}

/* Section labels — μη κόβονται */
.section__label {
  font-size: 12px;
  letter-spacing: 0.8px;
  word-wrap: break-word;
}

/* Card accent (public link) */
.card--accent {
  word-wrap: break-word;
  overflow: hidden;
}

/* Event cards */
.event__top {
  flex-wrap: wrap;
  gap: 10px;
}
.datechip--lg {
  flex-shrink: 0;
}

/* Calendar */
.cal__cell {
  font-size: 12px;
  min-width: 0;
}
@media (max-width: 380px) {
  .cal__cell { font-size: 11px; padding: 4px 2px; }
  .cal__num { font-size: 13px; }
}

/* Profile photo big */
.avatar--lg {
  flex-shrink: 0;
}

/* Form fields better mobile */
.field {
  width: 100%;
  min-width: 0;
}
.field__label {
  display: block;
  margin-bottom: 4px;
}

/* Photo edit row */
.photo-edit {
  flex-wrap: wrap;
  gap: 8px;
}

/* Setting rows */
.setting {
  width: 100%;
  text-align: left;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}
.setting__label {
  flex: 1;
  min-width: 0;
  white-space: normal;
}

/* Toast positioning iOS notch safe */
#toast-host {
  bottom: calc(80px + env(safe-area-inset-bottom, 0)) !important;
}

/* Race countdown specifically iPhone SE etc */
@media (max-width: 380px) {
  .race-countdown > div {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }
  .race-countdown > div > div:last-child {
    align-self: center;
  }
}

/* Routes — tabs no scroll cut */
.route-tabs button,
.route-tabs__btn {
  flex-shrink: 0;
  min-width: max-content;
}

/* Athlete profile heroes */
.athlete-profile section {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Better tap targets για κουμπιά */
.btn, .iconbtn, .tab, .setting {
  min-height: 40px;
  touch-action: manipulation;
}
.btn--sm {
  min-height: 34px;
}

/* Inbox/Messages */
.inbox__content {
  max-width: 100%;
  overflow: hidden;
}
.dm-row {
  flex-wrap: nowrap;
  min-width: 0;
}
.dm-row__main {
  min-width: 0;
  flex: 1;
}
.dm-row__name, .dm-row__last {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Documents */
.doc__ic {
  flex-shrink: 0;
}

/* Bottom safe area για όλη την εφαρμογή */
.view, .page {
  padding-bottom: calc(env(safe-area-inset-bottom, 0) + 12px) !important;
}

/* iOS PWA standalone fix */
@supports (-webkit-touch-callout: none) {
  body {
    -webkit-tap-highlight-color: transparent;
  }
  input:not([type="checkbox"]):not([type="radio"]), textarea, select {
    -webkit-appearance: none;
    border-radius: 8px;
  }
}

/* ============================================================================
 *  RACE VERTICAL VISUAL POLISH — v1.42.0
 *  Race community has its own visual identity (red/rose accent)
 * ============================================================================ */

/* Race countdown card mobile */
@media (max-width: 480px) {
  .race-countdown {
    padding: 14px !important;
  }
  .race-countdown p {
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
}

/* Race statistics grid: 3 cols always */
.race-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
@media (max-width: 360px) {
  .race-stats-grid {
    gap: 6px;
  }
}

/* Athlete card */
.athlete-card {
  background: linear-gradient(135deg, #f43f5e, #be123c);
  color: #fff;
  border-radius: 14px;
  padding: 16px;
  max-width: 100%;
  overflow: hidden;
}

/* Route card mobile fully responsive */
.route-card {
  margin-bottom: 14px;
}
.route-card__body {
  padding: 12px 14px;
}
@media (max-width: 480px) {
  .ep-event__actions {
    gap: 8px;
  }
  .ep-event__actions .btn {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    justify-content: center;
  }
  .ep-event__register {
    margin-bottom: 4px;
  }
  .ep-event .card__footer {
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
  }
  .ep-event .card__footer .btn {
    width: 100%;
    justify-content: center;
  }
  .route-card__body {
    padding: 10px 12px;
  }
  .route-card__top {
    flex-wrap: wrap;
    gap: 6px;
  }
  .route-card__top h3 {
    font-size: 15px !important;
    margin: 0;
  }
}

/* Race stats individual */
.route-stat {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 8px 10px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.route-stat__v {
  font-weight: 800;
  font-size: 14px;
  line-height: 1.2;
  color: var(--text);
}
.route-stat__l {
  font-size: 10.5px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Dashboard «Σήμερα» — σαφές κείμενο σε dark mode */
.today__item {
  color: var(--text);
}
.today__n {
  color: var(--text);
}
.today__l,
.today__summary {
  color: var(--text-secondary);
}
.today__item--has {
  border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
  background: color-mix(in srgb, var(--primary) 10%, var(--surface));
}
.today__item--has .today__n {
  color: var(--primary);
}

/* Results table mobile */
@media (max-width: 480px) {
  .result-row--top3 {
    background: linear-gradient(90deg, color-mix(in srgb, var(--accent, #f59e0b) 18%, transparent) 0%, transparent 70%) !important;
  }
}

/* Volunteer hero card */
@media (max-width: 380px) {
  .vol__card {
    padding: 12px 14px;
  }
}

/* Inbox content height */
.chat__thread, .dm-thread {
  max-height: 50vh;
  min-height: 240px;
}
@media (max-width: 480px) {
  .chat__thread, .dm-thread {
    min-height: 200px;
  }
}

/* Form labels πιο readable */
.field__label {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 4px;
}

/* Hero membership card */
.mcard {
  max-width: 100%;
  margin: 0 auto 16px;
}

/* Stats numbers σε mobile */
@media (max-width: 380px) {
  .stat__value, .ministat__value, .kpi__value {
    font-size: 18px !important;
  }
  .stat__label, .ministat__label, .kpi__label {
    font-size: 10.5px !important;
    line-height: 1.2 !important;
  }
}

/* Card title clamp */
.card__title {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Modal action buttons πάντα ορατά */
.modal__footer {
  position: sticky;
  bottom: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 10px !important;
  z-index: 2;
}

/* Floating action buttons μη ξεχειλίζουν */
.fab-inline {
  flex-shrink: 0;
}

/* Όλοι οι πίνακες σε mobile responsive */
table {
  width: 100%;
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* PWA install prompt */
.install-prompt {
  position: fixed;
  bottom: calc(70px + env(safe-area-inset-bottom, 0));
  left: 12px;
  right: 12px;
  z-index: 9000;
}

/* ============================================================================
 *  ROUTE MAP — Leaflet polish
 * ============================================================================ */

/* Leaflet attribution πιο μικρή & διακριτική */
.leaflet-control-attribution {
  font-size: 9px !important;
  background: rgba(255,255,255,0.8) !important;
  padding: 1px 4px !important;
}

/* Marker icons άριστο rendering */
.route-marker {
  background: transparent !important;
  border: none !important;
}

/* Demo banner overlay δεν θέλουμε να σκεπάζει το χάρτη */
.demo-banner, .demo-toast {
  z-index: 5 !important;
}

/* Map container fix — μη ξεχειλίζει στο route card */
.route-map {
  width: 100%;
  margin: 0;
}

/* Scoped to .route-map specifically -- an earlier unscoped `.leaflet-container`
   rule here forced `height:100% !important` on EVERY Leaflet map in the app
   (Leaflet stamps that class onto whatever container it's given), which
   silently collapsed any other map's own height (e.g. the activity-track
   viewer's .atv__map, height:320px) to 0 once Leaflet's !important 100%
   lost its percentage basis on a flex parent with no explicit height. */
.route-map .leaflet-container {
  height: 100% !important;
  width: 100% !important;
  z-index: 0;
}

/* Leaflet zoom controls πιο touch-friendly */
.leaflet-control-zoom a {
  width: 36px !important;
  height: 36px !important;
  line-height: 36px !important;
  font-size: 20px !important;
}

@media (max-width: 480px) {
  .route-map {
    height: 280px !important;
    min-height: 280px;
  }
}

/* ============================================================================
 *  DEMO BANNER — πιο διακριτικό, να μη σκεπάζει χάρτες
 * ============================================================================ */
#demoBar {
  opacity: 0.92 !important;
  transition: opacity 0.3s !important;
}

#demoBar:hover {
  opacity: 1 !important;
}

/* Όταν το mouse είναι πάνω από χάρτη, fade out το banner */
.leaflet-container:hover ~ #demoBar,
.leaflet-container:focus-within ~ #demoBar {
  opacity: 0.3 !important;
}

/* Σε mobile, μετακινούμε το banner λίγο ψηλότερα ώστε να μη σκεπάζει χάρτες */
@media (max-width: 480px) {
  #demoBar {
    bottom: 88px !important;
    font-size: 11.5px !important;
    padding: 5px 6px 5px 10px !important;
  }
  #demoBar button {
    padding: 4px 10px !important;
    font-size: 11px !important;
  }
}



/* ============================================================================
 *  TEMPLATES SECTION v3 — Premium SaaS Showcase
 *  Inspired by: Stripe, Notion, Linear, Framer, Webflow
 * ============================================================================ */

/* SECTION CONTAINER */
.lp-templates--v3 {
  position: relative;
  padding: 100px 20px;
  overflow: hidden;
  background: linear-gradient(180deg, transparent, rgba(244, 63, 94, 0.015) 50%, transparent);
}

@media (max-width: 640px) {
  .lp-templates--v3 { padding: 60px 16px; }
}

/* Floating decorative shapes */
.lp-tpl__bgFloat {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
}
.lp-tpl__bgFloat--1 {
  top: 10%; left: -5%;
  width: 380px; height: 380px;
  background: radial-gradient(circle, rgba(244, 63, 94, 0.25), transparent 70%);
  animation: floatSlow 18s ease-in-out infinite;
}
.lp-tpl__bgFloat--2 {
  top: 55%; right: -8%;
  width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.22), transparent 70%);
  animation: floatSlow 22s ease-in-out infinite reverse;
}
.lp-tpl__bgFloat--3 {
  bottom: 5%; left: 35%;
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(147, 51, 234, 0.2), transparent 70%);
  animation: floatSlow 20s ease-in-out infinite;
}

@keyframes floatSlow {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, -30px) scale(1.08); }
}

[data-theme="dark"] .lp-tpl__bgFloat { opacity: 0.3; }

/* HEADER */
.lp-tpl__header {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 720px;
  margin: 0 auto 56px;
}

.lp-tpl__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 0, 0, 0.06);
  color: var(--text);
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .lp-tpl__badge {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
}

.lp-tpl__badgeDot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f43f5e, #be123c);
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.5);
  animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}

.lp-tpl__h2 {
  font-size: clamp(32px, 5vw, 52px) !important;
  font-weight: 800 !important;
  line-height: 1.08 !important;
  letter-spacing: -1.2px;
  margin: 0 0 18px;
  background: linear-gradient(135deg, var(--text) 30%, #6b7280 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

[data-theme="dark"] .lp-tpl__h2 {
  background: linear-gradient(135deg, #fff 30%, #94a3b8 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.lp-tpl__sub {
  font-size: 17px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
  max-width: 620px;
  margin: 0 auto;
}

@media (max-width: 640px) {
  .lp-tpl__sub { font-size: 15px; }
  .lp-tpl__header { margin-bottom: 36px; }
}

/* GRID */
.lp-tpl--v3 {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  max-width: 1280px;
  margin: 0 auto;
}

@media (max-width: 1024px) {
  .lp-tpl--v3 {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

@media (max-width: 640px) {
  .lp-tpl--v3 {
    grid-template-columns: 1fr;
    gap: 18px;
    max-width: 480px;
  }
}

/* ============================================
 *  TCARD — Premium card
 * ============================================ */
.tcard {
  position: relative;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 24px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.02),
    0 8px 24px rgba(0, 0, 0, 0.05),
    0 20px 48px rgba(0, 0, 0, 0.04);
  transition:
    transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.4s ease;
}

[data-theme="dark"] .tcard {
  background: rgba(18, 24, 38, 0.78);
  border-color: rgba(255, 255, 255, 0.06);
}

.tcard:hover {
  transform: translateY(-8px) scale(1.025);
  border-color: color-mix(in srgb, var(--from) 25%, transparent);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.03),
    0 12px 28px rgba(0, 0, 0, 0.08),
    0 32px 80px rgba(0, 0, 0, 0.1),
    0 0 0 1px color-mix(in srgb, var(--from) 20%, transparent);
}

.tcard:hover .tcard__glow {
  opacity: 0.4;
}

.tcard:hover .tcard__mock {
  transform: translateY(-4px) scale(1.02);
}

.tcard:hover .tcard__btn--primary {
  background: linear-gradient(135deg, var(--from), var(--to));
  transform: translateY(-1px);
}

.tcard:hover .tcard__btnArrow {
  transform: translateX(3px);
}

/* Glow */
.tcard__glow {
  position: absolute;
  inset: -3px;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--from), var(--to));
  opacity: 0;
  z-index: -1;
  filter: blur(28px);
  transition: opacity 0.5s ease;
  pointer-events: none;
}

/* MOST POPULAR BADGE */
.tcard--popular {
  border-color: rgba(245, 158, 11, 0.35);
}

.tcard__badge {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #fff;
  box-shadow:
    0 4px 12px rgba(245, 158, 11, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.15) inset;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.12);
}

/* ============================================
 *  PREVIEW — Faux App Screenshot
 * ============================================ */
.tcard__preview {
  position: relative;
  height: 180px;
  overflow: hidden;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .tcard__preview {
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

.tcard__previewBg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.tcard__previewBg::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.25), transparent 50%),
    radial-gradient(circle at 70% 80%, rgba(255, 255, 255, 0.15), transparent 50%);
}

/* Mini app mock */
.tcard__mock {
  position: absolute;
  top: 28px;
  left: 24px;
  right: 24px;
  bottom: -16px;
  background: #fff;
  border-radius: 12px 12px 0 0;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.12),
    0 0 0 1px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] .tcard__mock {
  background: #1a2233;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.08);
}

.tcard__mockHeader {
  height: 26px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 6px;
  position: relative;
}

.tcard__mockDot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
}

.tcard__mockTitle {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9.5px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  white-space: nowrap;
  letter-spacing: 0.3px;
}

.tcard__mockBody {
  flex: 1;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tcard__mockRow {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tcard__mockAvatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
}

.tcard__mockAvatar--muted {
  background: linear-gradient(135deg, #e5e7eb, #d1d5db) !important;
}

[data-theme="dark"] .tcard__mockAvatar--muted {
  background: linear-gradient(135deg, #374151, #1f2937) !important;
}

.tcard__mockLines {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tcard__mockLine {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, #f1f5f9, #e2e8f0, #f1f5f9);
  background-size: 200% 100%;
  animation: shimmer 2.4s ease-in-out infinite;
}

[data-theme="dark"] .tcard__mockLine {
  background: linear-gradient(90deg, #1e293b, #334155, #1e293b);
  background-size: 200% 100%;
}

.tcard__mockLine--sm { width: 40%; }
.tcard__mockLine--md { width: 65%; }
.tcard__mockLine--lg { width: 85%; }

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.tcard__mockStats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin-top: 2px;
}

.tcard__mockStat {
  height: 28px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.03);
}

/* ============================================
 *  BODY
 * ============================================ */
.tcard__body {
  padding: 22px 24px 22px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 10px;
}

.tcard__name {
  margin: 0;
  font-size: 19px !important;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--text);
  line-height: 1.2;
}

.tcard__desc {
  margin: 0;
  font-size: 13.5px !important;
  line-height: 1.5;
  color: var(--muted);
  min-height: 40px;
}

/* Feature tags */
.tcard__feats {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 2px 0 6px;
}

.tcard__tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.04);
  color: var(--text);
  letter-spacing: 0.1px;
  transition: all 0.3s ease;
}

[data-theme="dark"] .tcard__tag {
  background: rgba(255, 255, 255, 0.06);
}

.tcard:hover .tcard__tag {
  background: color-mix(in srgb, var(--from) 12%, transparent);
  color: var(--from);
}

[data-theme="dark"] .tcard:hover .tcard__tag {
  color: color-mix(in srgb, var(--from) 60%, white);
}

/* ============================================
 *  CTA BUTTONS
 * ============================================ */
.tcard__cta {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 6px;
}

.tcard__btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 14px;
  border: none;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.1px;
  white-space: nowrap;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.tcard__btn--primary {
  background: var(--text);
  color: var(--bg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

[data-theme="dark"] .tcard__btn--primary {
  background: #fff;
  color: #0f172a;
}

.tcard__btnArrow {
  display: inline-block;
  font-size: 14px;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.tcard__btn--ghost {
  background: transparent;
  color: var(--text);
  border: 1.5px solid rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .tcard__btn--ghost {
  border-color: rgba(255, 255, 255, 0.14);
}

.tcard__btn--ghost:hover {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .tcard__btn--ghost:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* Mobile tweaks */
@media (max-width: 640px) {
  .tcard__preview { height: 150px; }
  .tcard__mock { top: 20px; }
  .tcard__body { padding: 18px 18px 18px; }
  .tcard__name { font-size: 17px !important; }
  .tcard__desc { font-size: 13px !important; min-height: 0; }
  .tcard__btn { padding: 10px 12px; font-size: 12.5px; }
}

/* Accessibility — reduced motion */
@media (prefers-reduced-motion: reduce) {
  .tcard,
  .tcard:hover,
  .tcard__mock,
  .tcard__btn,
  .lp-tpl__bgFloat,
  .lp-tpl__badgeDot,
  .tcard__mockLine {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }
}

/* ============================================================================
 *  HORIZONTAL SCROLL — ευρεία δεδομένα χωρίς κόψιμο (v1.117.0)
 *  Πίνακες διαδρομών, αποτελεσμάτων κ.λπ. — σύρε αριστερά/δεξιά.
 * ============================================================================ */
.data-scroll-x {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x pan-y;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--primary) 45%, var(--border)) transparent;
}

.data-scroll-x::-webkit-scrollbar {
  height: 6px;
}

.data-scroll-x::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--primary) 50%, var(--border));
  border-radius: 99px;
}

.route-card__body,
.route-tab-body,
.route-elev,
.route-analysis {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}

.route-elev__details,
.route-analysis__table-wrap,
.results-table-wrap {
  min-width: max(100%, 720px);
  width: max-content;
  max-width: none;
}

.route-elev__row,
.route-analysis__row {
  white-space: nowrap;
}

.route-elev__row > span,
.route-analysis__row > span {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.results-table {
  min-width: 640px;
}

@media (max-width: 1023px) {
  .content,
  .content--enterprise,
  .view {
    overflow-x: clip;
    max-width: 100%;
  }

  /* Μην κόβουν τα scrollable παιδιά — χρησιμοποιούμε .data-scroll-x για πίνακες */
  .card:not(.feed__post):not(.ep-post),
  .panel:not(.today) {
    overflow-x: auto;
    overflow-y: visible;
  }
}