/* ===== Variables ===== */
:root {
    --tt-blue: #1a4b8c;
    --tt-blue-dark: #0e2f5a;
    --tt-orange: #f39200;
    --tt-orange-hover: #e07f00;
    --tt-green: #16a34a;
    --tt-green-dark: #15803d;
}

/* ===== Bulma overrides ===== */
.button.is-success { background-color: var(--tt-green); color: #fff; }
.button.is-success:hover { background-color: var(--tt-green-dark); color: #fff; }
.tag.is-success { background-color: var(--tt-green); }

.detail-hero .tags .tag {
    border-radius: 999px;
    padding: 1.333em;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.75rem;
}

.detail-hero .tags .tag.tournament-type-tag {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
}

.detail-hero .tags .tag.is-success,
.detail-hero .tags .tag.is-danger {
    color: #fff;
}

/* ===== Hero compact (homepage) ===== */
.hero-compact {
    background: linear-gradient(135deg, #001f4d 0%, #0046ad 60%, var(--tt-blue) 100%);
    padding: 1.5rem 0 1.75rem;
    position: relative;
    overflow: hidden;
}

.hero-compact::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><circle cx='85' cy='15' r='40' fill='rgba(255,255,255,0.06)'/><circle cx='15' cy='85' r='30' fill='rgba(212,112,0,0.1)'/></svg>") no-repeat center;
    background-size: cover;
    pointer-events: none;
}

.hero-compact-container { position: relative; padding: 0 1.25rem; }

.hero-compact-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.hero-compact-title {
    font-size: 1.65rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
    margin: 0;
    line-height: 1.2;
}

.hero-compact-title em { font-style: normal; color: var(--tt-orange); }

.hero-compact-subtitle {
    color: rgba(255,255,255,0.7);
    font-size: .85rem;
    margin-top: .2rem;
}

.hero-stats { display: flex; gap: .5rem; }

.hero-stat {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 10px;
    padding: .6rem 1rem;
    text-align: center;
    min-width: 90px;
}

@supports (backdrop-filter: blur(16px)) {
    .hero-stat { backdrop-filter: blur(16px); }
}

.hero-stat-number { font-size: 1.35rem; font-weight: 800; color: #fff; line-height: 1; }
.hero-stat-number.accent { color: #fbbf24; }

.hero-stat-label {
    font-size: .62rem;
    color: rgba(255,255,255,0.65);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-top: .15rem;
}

/* ===== Search toolbar (sticky) ===== */
.search-toolbar {
    position: sticky;
    top: 0;
    z-index: 90;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: .65rem 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.search-toolbar-container { padding: 0 .75rem; }

.search-toolbar-row {
    display: flex;
    gap: .45rem;
    align-items: stretch;
}

.search-toolbar-row > .geolocation-input-wrapper {
    flex: 1;
    min-width: 0;
}

.search-toolbar-row .input,
.search-toolbar-row .select select,
.search-toolbar-btn {
    height: 2.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: .88rem;
}

.search-toolbar-row .input:focus {
    border-color: var(--tt-orange);
    box-shadow: 0 0 0 3px rgba(243,146,0,0.12);
}

.search-toolbar-distance { width: 200px; }

.search-toolbar-btn {
    white-space: nowrap;
    font-weight: 700;
    border-color: transparent;
    padding-left: 2rem;
    padding-right: 2rem;
}

.search-toolbar-filters {
    display: flex;
    gap: .35rem;
    margin-top: .5rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.search-toolbar-filters::-webkit-scrollbar { display: none; }

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .28rem .65rem;
    border-radius: 999px;
    font-size: .73rem;
    font-weight: 600;
    background: #f8fafc;
    color: #475569;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    white-space: nowrap;
    transition: all .15s;
    font-family: inherit;
}

.filter-chip:hover { border-color: var(--tt-blue); color: var(--tt-blue); }
.filter-chip.is-active { background: var(--tt-blue); color: #fff; border-color: var(--tt-blue); }
.filter-chip svg { flex-shrink: 0; }

/* ===== Split-pane layout ===== */
.split-pane {
    display: flex;
    height: calc(100vh - 170px);
    overflow: hidden;
}

.split-pane-list {
    width: 420px;
    min-width: 340px;
    flex-shrink: 0;
    overflow-y: auto;
    border-right: 1px solid #e2e8f0;
    background: #fff;
    display: flex;
    flex-direction: column;
}

.split-pane-map {
    flex: 1;
    position: relative;
}

.split-pane-map #map {
    height: 100%;
    width: 100%;
    border-radius: 0;
    box-shadow: none;
    background: #e8e0d8 url('/images/map-placeholder.webp') center/cover no-repeat;
}

.split-pane-map #map.map-loaded { background: none; }

.split-pane-map .loading-overlay { border-radius: 0; }

/* ===== Ongoing banner (inside hero) ===== */
.ongoing-banner {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-top: 1rem;
    padding-top: .75rem;
    border-top: 1px solid rgba(255,255,255,0.15);
}

.ongoing-banner-title {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: rgba(255,255,255,0.7);
    display: flex;
    align-items: center;
    gap: .3rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.ongoing-banner-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fbbf24;
    color: #78350f;
    font-size: .58rem;
    font-weight: 700;
    min-width: 1.15rem;
    height: 1.15rem;
    border-radius: 50%;
}

.ongoing-banner-chips {
    display: flex;
    gap: .4rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.ongoing-banner-chips::-webkit-scrollbar { display: none; }

.ongoing-banner-chip {
    flex-shrink: 0;
    padding: .25rem .65rem;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    text-decoration: none;
    color: #fff;
    font-size: .78rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background .15s, border-color .15s;
}

.ongoing-banner-chip:hover { background: rgba(255,255,255,0.2); border-color: rgba(255,255,255,0.35); color: #fff; }

/* ===== Results header ===== */
.results-header {
    padding: .75rem 1.15rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 5;
}

.results-count {
    font-size: .8rem;
    font-weight: 700;
    color: #64748b;
}

/* ===== Alert CTA (results panel) ===== */
.results-alert-cta {
    padding: .7rem 1.15rem;
    border-bottom: 1px solid #f1f5f9;
    background: #fefce8;
    display: flex;
    align-items: center;
    gap: .5rem;
    cursor: pointer;
    transition: background .15s;
}

.results-alert-cta:hover { background: #fef9c3; }
.results-alert-cta svg { flex-shrink: 0; color: var(--tt-orange); }

.results-alert-cta-text {
    font-size: .78rem;
    font-weight: 600;
    color: #92400e;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
}

/* ===== Result cards ===== */
.result-card {
    display: block;
    padding: .85rem 1.15rem;
    border-bottom: 1px solid #f1f5f9;
    text-decoration: none;
    color: inherit;
    transition: background .15s;
    cursor: pointer;
    border-left: 3px solid transparent;
}

.result-card:hover { background: #fefce8; }
.result-card.is-highlighted { background: #fff7ed; border-left-color: var(--tt-orange); }

.result-card-top {
    display: flex;
    align-items: center;
    gap: .35rem;
    margin-bottom: .3rem;
}

.result-card-type {
    font-size: .62rem;
    font-weight: 700;
    color: #fff;
    background: var(--tt-orange);
    padding: .08rem .4rem;
    border-radius: 4px;
    text-transform: uppercase;
}

.result-card-new {
    font-size: .62rem;
    font-weight: 700;
    color: #fff;
    background: #48c78e;
    padding: .08rem .4rem;
    border-radius: 4px;
}

.result-card-date {
    margin-left: auto;
    font-size: .72rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: .2rem;
}

.result-card-name {
    font-size: .9rem;
    font-weight: 700;
    color: var(--tt-blue);
    margin-bottom: .25rem;
    line-height: 1.3;
}

.result-card-city {
    font-size: .78rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: .2rem;
    margin-bottom: .3rem;
}

.result-card-meta {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-size: .72rem;
    color: #94a3b8;
    flex-wrap: wrap;
}

.result-card-distance {
    font-weight: 600;
    color: var(--tt-green);
    background: #f0fdf4;
    padding: .1rem .4rem;
    border-radius: 4px;
}

.result-card-cta {
    font-weight: 700;
    color: var(--tt-green);
}

/* ===== Results empty state ===== */
.results-empty {
    display: none;
    padding: 2rem 1.15rem;
    text-align: center;
    color: #94a3b8;
    font-size: .88rem;
}

.results-empty.active { display: block; }

/* ===== Hero Detail (listing, calendar, account pages) ===== */
.hero-detail {
    background: linear-gradient(135deg, #001f4d 0%, var(--tt-blue) 100%);
    position: relative;
    overflow: hidden;
}

.hero-detail::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><circle cx='85' cy='15' r='40' fill='rgba(255,255,255,0.06)'/><circle cx='15' cy='85' r='30' fill='rgba(212,112,0,0.1)'/></svg>") no-repeat center;
    background-size: cover;
    pointer-events: none;
}

.hero-detail .hero-body {
    position: relative;
}

.hero-detail .title {
    font-weight: 800;
    letter-spacing: -0.02em;
}

.hero-detail .breadcrumb { font-size: 0.8rem; }
.hero-detail .breadcrumb a { color: rgba(255, 255, 255, 0.7); }
.hero-detail .breadcrumb a:hover { color: #fff; }
.hero-detail .breadcrumb li + li::before { color: rgba(255, 255, 255, 0.4); }
.hero-detail .breadcrumb li.is-active a { color: rgba(255, 255, 255, 0.9); }

.hero-detail p.has-text-white {
    opacity: 0.85;
}

@media screen and (max-width: 768px) {
    .hero-detail .hero-body { padding: 2rem 1rem; }
    .hero-detail .title.is-3 { font-size: 1.4rem; }
}

/* ===== Navbar ===== */
.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.logo-text {
    font-size: 1.2rem;
    font-weight: 700;
    margin-left: 0.5rem;
    font-family: Arial, Helvetica, sans-serif;
}

.logo-text-blue {
    color: var(--tt-blue);
}

.logo-text-orange {
    color: var(--tt-orange);
}

.navbar-item img.logo-img {
    max-height: 2.5rem;
}

/* ===== Boutons orange ===== */
.button.is-tt-orange {
    background-color: var(--tt-orange);
    border-color: transparent;
    color: #fff;
    font-weight: 600;
}

.button.is-tt-orange:hover {
    background-color: var(--tt-orange-hover);
    color: #fff;
}

.button.is-tt-orange.is-outlined {
    background-color: transparent;
    border-color: var(--tt-orange);
    color: var(--tt-orange);
}

.button.is-tt-orange.is-outlined:hover {
    background-color: var(--tt-orange);
    color: #fff;
}

.geolocation-input-wrapper {
    position: relative;
}

.geolocation-input-wrapper .icon.is-right {
    pointer-events: all;
    cursor: pointer;
    color: var(--tt-blue);
}

.geolocation-input-wrapper .icon.is-right:hover {
    color: var(--tt-orange);
}

.geolocation-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #dbdbdb;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 260px;
    overflow-y: auto;
    z-index: 10000;
    display: none;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.geolocation-suggestions.active {
    display: block;
}

.suggestion-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9rem;
    color: #363636;
    transition: background-color 0.15s, padding-left 0.15s;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item:focus {
    background-color: var(--tt-orange);
    color: #fff;
    padding-left: 1.25rem;
}

/* ===== Map ===== */
#map {
    height: 600px;
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background: #e8e0d8 url('/images/map-placeholder.webp') center/cover no-repeat;
    z-index: 0;
}

#map.map-loaded {
    background: none;
}

.department-map {
    height: 400px;
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 0;
    overflow: hidden;
}

.map-wrapper {
    position: relative;
}

.loading-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
}

.loading-overlay.active {
    display: flex;
}

.no-results-overlay {
    display: none;
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    z-index: 1000;
    text-align: center;
    pointer-events: none;
}

.no-results-overlay.active {
    display: block;
}

/* ===== Popups markers ===== */
.tournament-marker-popup {
    min-width: 200px;
}

.tournament-marker-popup h6 {
    margin: 0 0 8px 0;
    font-weight: 600;
    color: var(--tt-blue);
    font-size: 0.95rem;
}

.tournament-marker-popup .date {
    color: #7f8c8d;
    font-size: 0.85rem;
}

.tournament-marker-popup .city {
    color: #34495e;
    margin-top: 4px;
    font-size: 0.85rem;
}

.tournament-marker-popup .distance {
    color: #27ae60;
    font-weight: 600;
    margin-top: 4px;
    font-size: 0.85rem;
}

/* ===== Custom map markers ===== */
.tt-marker {
    width: 36px;
    height: 44px;
    position: relative;
}

.tt-marker svg {
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
}

.tt-cluster-icon {
    width: 44px;
    height: 52px;
    position: relative;
}

.tt-cluster-icon svg {
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
}

.tt-cluster-icon .cluster-count {
    position: absolute;
    bottom: 10px;
    right: -6px;
    background: var(--tt-orange);
    color: #fff;
    border-radius: 50%;
    min-width: 22px;
    height: 22px;
    line-height: 22px;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* ===== New tournament indicators ===== */
.new-tournament-dot {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 10px;
    height: 10px;
    background: #48c78e;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.popup-new-tag {
    margin-bottom: 6px;
}

/* ===== Results count ===== */
.results-count {
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* ===== Responsive homepage ===== */
@media screen and (max-width: 1023px) {
    .hero-compact-inner { flex-direction: column; align-items: flex-start; gap: .75rem; }
    .hero-compact-title { font-size: 1.3rem; }
    .hero-stats { width: 100%; }
    .hero-stat { flex: 1; min-width: 0; padding: .5rem .6rem; display: flex; flex-direction: column; align-items: center; gap: .15rem; }
    .hero-stat-number { font-size: 1.1rem; }

    .split-pane { flex-direction: column; height: auto; }
    .split-pane-map { height: 45vh; min-height: 280px; order: -1; flex: none; }
    .split-pane-map #map { height: 100%; }
    .split-pane-list { width: 100%; min-width: 0; max-height: 60vh; border-right: none; border-top: 2px solid #e2e8f0; }
}

@media screen and (max-width: 768px) {
    .hero-compact { padding: 1rem 0 1.25rem; }
    .hero-stat-label { font-size: .55rem; }

    .search-toolbar-row {
        flex-wrap: wrap;
    }

    .search-toolbar-row .geolocation-input-wrapper {
        width: 100%;
        flex: none;
    }

    .search-toolbar-distance { flex: 1; width: auto; }
    .search-toolbar-btn { flex: none; }

    .department-map { height: 300px; }
    .tournament-marker-popup { min-width: 160px; }
}

.latest-tournament-card {
    display: block;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #eee;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.latest-tournament-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
    border-color: var(--tt-orange);
}

.latest-tournament-card-body {
    padding: 1.25rem;
}

.latest-tournament-header {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}

.latest-tournament-date {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    color: #7f8c8d;
}

.latest-tournament-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--tt-blue);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.latest-tournament-city {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.85rem;
    color: #555;
}

/* ===== Regions Section ===== */
.regions-section {
    background: linear-gradient(135deg, var(--tt-blue) 0%, var(--tt-blue-dark) 100%);
}

.regions-section .title,
.regions-section p {
    color: #fff;
}

.regions-section p.has-text-grey {
    color: rgba(255, 255, 255, 0.7) !important;
}

.regions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem;
}

.region-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #fff;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
}

.region-link:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--tt-orange);
    color: #fff;
}

.region-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.region-count {
    background: var(--tt-orange);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ===== Tournament Tags (shared with listings) ===== */
.tournament-type-tag { background-color: var(--tt-orange); color: #fff; font-weight: 600; }
.tournament-new-tag { background-color: #48c78e; color: #fff; font-weight: 600; }
.tournament-upcoming-tag { background-color: #3e8ed0; color: #fff; font-weight: 600; }
.tournament-ongoing-tag { background-color: #ffe08a; color: #946c00; font-weight: 600; }
.share-button { cursor: pointer; border: none; font-weight: 600; }

/* ===== Tournament Detail - Hero ===== */
.detail-hero {
    background: linear-gradient(135deg, #001f4d 0%, #0046ad 60%, var(--tt-blue) 100%);
    color: #fff;
    padding: 1.5rem 1.5rem 2.5rem;
    position: relative;
    overflow: hidden;
}

.detail-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><circle cx='85' cy='15' r='40' fill='rgba(255,255,255,0.06)'/><circle cx='15' cy='85' r='30' fill='rgba(212,112,0,0.1)'/></svg>") no-repeat center;
    background-size: cover;
    pointer-events: none;
}

.detail-hero .breadcrumb { font-size: 0.8rem; }
.detail-hero .breadcrumb ul { align-items: center; flex-wrap: nowrap; min-width: 0; }
.detail-hero .breadcrumb li.is-active { overflow: hidden; min-width: 0; }
.detail-hero .breadcrumb li.is-active a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: rgba(255, 255, 255, 0.9); }
.detail-hero .breadcrumb a { color: rgba(255, 255, 255, 0.7); }
.detail-hero .breadcrumb li + li::before { color: rgba(255, 255, 255, 0.4); }

.detail-hero-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2rem;
    align-items: center;
    position: relative;
}



.detail-hero-title { font-size: 2.25rem; font-weight: 800; line-height: 1.15; margin-bottom: 0.5rem; letter-spacing: -0.02em; }
.detail-hero-sub { font-size: 1rem; opacity: 0.85; }

/* Hero stats card (glassmorphism) */
.detail-stats-card {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
    min-width: 280px;
}

@supports (backdrop-filter: blur(20px)) {
    .detail-stats-card {
        backdrop-filter: blur(20px);
    }
}

.detail-stat-row {
    display: flex;
    justify-content: space-between;
    padding: 0.55rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 0.9rem;
}

.detail-stat-row:last-of-type { border-bottom: none; }
.detail-stat-row strong { font-weight: 700; color: #fff; }
.detail-stat-accent { color: #fbbf24; }

.detail-stats-cta { display: flex; gap: 0.5rem; margin-top: 1rem; }
.detail-stats-cta .button { flex: 1; }

/* ===== Tournament Detail - Tabs Nav ===== */
.detail-tabs {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.detail-tabs-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.detail-tabs-links {
    display: flex;
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-shrink: 1;
    min-width: 0;
}

.detail-tabs-links::-webkit-scrollbar { display: none; }

/* Fade hint pour indiquer le scroll horizontal */
.detail-tabs-inner::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 40px;
    background: linear-gradient(to right, transparent, #fff);
    pointer-events: none;
    display: none;
}

@media screen and (max-width: 768px) {
    .detail-tabs-inner::after { display: block; }
}

.detail-tab {
    padding: 0.85rem 1.15rem;
    font-weight: 700;
    font-size: 0.9rem;
    color: #64748b;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    transition: all 0.15s;
}

.detail-tab:hover { color: var(--tt-blue); }
.detail-tab.is-active { color: var(--tt-blue); font-weight: 700; border-bottom-color: var(--tt-orange); }

.detail-tab-count {
    display: inline-block;
    background: #f1f5f9;
    padding: 0.05rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    margin-left: 0.25rem;
    font-weight: 600;
}

.detail-tab.is-active .detail-tab-count { background: #dbeafe; color: var(--tt-blue); }
.detail-tabs-cta { padding: 0.5rem 0; margin-left: 1rem; }
.detail-tabs-cta .button { border-radius: 6px; padding: 0.5em 1em; font-size: 0.85rem; font-weight: 700; }

/* ===== Tournament Detail - Shared components ===== */
.detail-map { height: 300px; width: 100%; z-index: 0; }
.detail-map-wrapper { border-radius: 12px; overflow: hidden; box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08); }

.detail-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.detail-info-list { padding: 0.5rem 0; }

.detail-info-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    transition: background-color 0.15s;
}

.detail-info-item:hover { background-color: #fafafa; }

.detail-info-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 8px;
    color: var(--tt-blue);
}

.detail-info-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #626b6e;
    margin-bottom: 2px;
}

.detail-info-value { font-size: 0.9rem; color: #363636; line-height: 1.4; }
.detail-info-value a { color: var(--tt-blue); font-weight: 500; }
.detail-info-value a:hover { color: var(--tt-orange); }

/* ===== Tournament Detail - Overview grid ===== */
.detail-overview-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    align-items: stretch;
}

.detail-overview-main { display: flex; }
.detail-overview-card { flex: 1; display: flex; flex-direction: column; }
.detail-overview-card p { flex: 1; }
.detail-overview-aside { display: flex; }
.detail-overview-map-card { flex: 1; display: flex; flex-direction: column; }
.detail-overview-map { flex: 1; min-height: 180px; }

.detail-overview-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.75rem 2rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.detail-overview-card h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--tt-blue-dark);
}

.detail-overview-card p {
    color: #475569;
    font-size: 0.88rem;
    line-height: 1.85;
}

.detail-description {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.detail-description.is-expanded {
    display: block;
    -webkit-line-clamp: unset;
}

.detail-description-toggle {
    display: inline-block;
    margin-top: .5rem;
    font-size: .85rem;
    font-weight: 600;
    color: var(--tt-blue);
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
}

.detail-description-toggle:hover {
    color: var(--tt-orange);
}

.detail-overview-map-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.detail-overview-map {
    height: 200px;
    width: 100%;
}

.detail-overview-map-info {
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
    color: #334155;
    line-height: 1.4;
}

.detail-overview-map-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 0.2rem;
}

@media screen and (max-width: 768px) {
    .detail-overview-grid { grid-template-columns: 1fr; }
    .detail-overview-aside { display: none; }
}

.detail-count-tag { background: var(--tt-orange); color: #fff; font-weight: 700; }

/* ===== Tournament Detail - Tables toolbar ===== */
.detail-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.detail-chips { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.detail-chip {
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    background: #fff;
    border: 1px solid #cbd5e1;
    color: #334155;
    cursor: pointer;
    transition: all 0.15s;
}

.detail-chip:hover { border-color: var(--tt-blue); }
.detail-chip.is-active { background: var(--tt-blue); color: #fff; border-color: var(--tt-blue); }
.detail-chip-count { opacity: 0.65; margin-left: 0.2rem; font-weight: 500; }
.detail-chip.is-active .detail-chip-count { opacity: 0.85; }


/* ===== Tournament Detail - Dense table ===== */
.detail-dense-table-wrapper {
    position: relative;
}

.detail-dense-table-wrapper::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 32px;
    background: linear-gradient(to right, transparent, #fff);
    pointer-events: none;
    border-radius: 0 12px 12px 0;
    z-index: 1;
    transition: opacity .2s;
}

.detail-dense-table-wrapper.is-scrolled-end::after {
    opacity: 0;
}

.detail-dense-table {
    background: #fff;
    border-radius: 12px;
    overflow-x: auto;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    -webkit-overflow-scrolling: touch;
}

.detail-dense-table table { border-collapse: collapse; min-width: 600px; }
.detail-dense-table th { background: #f8fafc; color: #64748b; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; border-bottom: 1px solid #e2e8f0; }
.detail-dense-table td, .detail-dense-table th { padding: 0.65rem 0.85rem; font-size: 0.88rem; white-space: nowrap; }
.detail-dense-table tbody tr { border-bottom: 1px solid #f1f5f9; transition: background 0.1s; }
.detail-dense-table tbody tr:last-child { border-bottom: none; }
.detail-dense-table tbody tr:hover { background: #f8fafc; }
.detail-dense-table tbody tr.is-full { opacity: 0.5; }
.detail-table-time { font-weight: 600; color: var(--tt-orange); }

.detail-date-separator td {
    background: #f0f4f8;
    font-weight: 700;
    color: var(--tt-blue-dark);
    padding: 0.6rem 0.85rem;
    text-transform: capitalize;
    font-size: 0.82rem;
    letter-spacing: 0.03em;
    border-left: 3px solid var(--tt-orange);
}

/* ===== Tournament Detail - Table type tags ===== */
.table-type-tag { font-size: 0.72rem; font-weight: 600; }
.table-type-tag.table-type-I { background-color: #eef6ff; color: var(--tt-blue); }
.table-type-tag.table-type-D { background-color: #fef3e2; color: #b45309; }
.table-type-tag.table-type-E { background-color: #f0fdf4; color: #15803d; }



/* ===== Tournament Detail - Venue, Organizer, Rules ===== */
.detail-venue-info { max-width: 600px; }

.detail-organizer {
    background: #f8fafc;
    border-radius: 10px;
    padding: 1.5rem 2rem;
    max-width: 500px;
}

.detail-rule-tag {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    max-width: 100%;
    padding: .45rem .75rem;
    background: #f5f5f5;
    font-weight: 600;
    font-size: .88rem;
    cursor: pointer;
    transition: all .15s;
    text-decoration: none;
    border-radius: 8px;
    color: #4a4a4a;
}

.detail-rule-tag:hover {
    background: #dbeafe;
    color: var(--tt-blue);
}

.detail-rule-icon {
    flex-shrink: 0;
    display: flex;
}

.detail-rule-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}



/* ===== Tournament Detail - Popup link ===== */
.tournament-marker-popup .detail-link {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 10px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    background-color: var(--tt-orange);
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.15s;
}

.tournament-marker-popup .detail-link:hover { background-color: var(--tt-orange-hover); color: #fff; }

/* ===== Tournament Detail - Responsive ===== */
@media screen and (max-width: 768px) {
    .detail-hero { padding: 1.5rem 1rem 2rem; }
    .detail-hero-grid { grid-template-columns: 1fr; gap: 1.25rem; }
    .detail-hero-title { font-size: 1.6rem; }
    .detail-stats-card { min-width: 0; }

    .detail-tab { padding: 0.7rem 0.85rem; font-size: 0.82rem; }

    .detail-map { height: 220px; }

    .detail-toolbar { flex-direction: column; align-items: stretch; }
}

/* ===== Footer ===== */
.footer {
    background: var(--tt-blue-dark);
    color: rgba(255, 255, 255, 0.7);
    padding: 2rem 1.5rem;
}

.footer a {
    color: #fff;
}

.footer a:hover {
    color: var(--tt-orange);
}

/* ===== Alert Toast ===== */
.alert-toast-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 10001;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.alert-toast-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.alert-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 400px;
    background: #fff;
    border-radius: 12px;
    border-left: 4px solid var(--tt-orange);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.25);
    padding: 24px;
    z-index: 10002;
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.alert-toast.is-visible {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.alert-toast-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-size: 1.3rem;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

.alert-toast-close:hover {
    color: #333;
}

.alert-toast-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: #333;
    margin-bottom: 4px;
}

.alert-toast-search-summary {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--tt-blue);
    background-color: #eef3fa;
    padding: 3px 10px;
    border-radius: 4px;
    margin-bottom: 8px;
}

.alert-toast-subtitle {
    font-size: 0.82rem;
    color: #777;
    margin-bottom: 12px;
}

@media screen and (max-width: 480px) {
    .alert-toast {
        width: calc(100% - 32px);
    }
}

/* ===== Calendar ===== */
.calendar-month {
    border: 1px solid #e2e6ea;
    border-radius: 10px;
    overflow: hidden;
    background: #e2e6ea; /* grille de séparation entre colonnes */
}

.calendar-col-headers {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr 2fr 2fr;
    column-gap: 1px;
    background: #e2e6ea;
    border-bottom: 2px solid #e2e6ea;
}

.calendar-col-header {
    background: #f0f3f7;
    text-align: center;
    padding: 0.5rem 0.25rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
}

.calendar-col-header.cal-weekend {
    color: var(--tt-blue);
    font-weight: 800;
}

.calendar-week {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr 2fr 2fr;
    grid-auto-rows: auto;
    column-gap: 1px;
    row-gap: 0;
    background: #e2e6ea;
    border-bottom: 2px solid #e2e6ea;
}

.calendar-week:last-child {
    border-bottom: none;
}

.cal-bg {
    background: #fff;
    z-index: 0;
    min-height: 80px;
}

.cal-bg.cal-empty {
    background: #f7f8fa;
}

.cal-bg.cal-today {
    background: #edf3fb;
}

.cal-day-num {
    padding: 4px 6px 0;
    font-size: 0.78rem;
    font-weight: 700;
    color: #444;
    z-index: 2;
    pointer-events: none;
    align-self: start;
    justify-self: start;
    line-height: 1;
}

.cal-day-num.is-today {
    color: var(--tt-blue);
}

.cal-event {
    display: block;
    font-size: 0.68rem;
    background: var(--tt-orange);
    color: #fff;
    border-radius: 3px;
    padding: 2px 6px;
    margin: 2px 3px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
    z-index: 1;
    align-self: start;
    line-height: 1.4;
}

.cal-event:hover,
.cal-event.cal-event-active {
    background: #b86000;
    color: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
    text-decoration: underline;
}

.cal-event-overflow {
    display: none;
}

.calendar-month.calendar-expanded .cal-event-overflow {
    display: block;
}

.calendar-month.calendar-expanded .cal-overflow {
    display: none;
}

.cal-overflow {
    display: block;
    font-size: 0.65rem;
    color: var(--tt-blue);
    font-weight: 600;
    padding: 2px 6px;
    margin: 2px 3px 0;
    z-index: 1;
    align-self: start;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
}

.cal-overflow:hover {
    text-decoration: underline;
}

.calendar-month-empty {
    opacity: 0.45;
    pointer-events: none;
}

@media screen and (max-width: 768px) {
    .cal-bg {
        min-height: 52px;
    }

    .cal-event {
        font-size: 0.6rem;
        padding: 1px 3px;
        margin: 1px 2px 0;
    }

    .cal-day-num {
        font-size: 0.7rem;
        padding: 3px 4px 0;
    }

    .cal-overflow {
        font-size: 0.58rem;
        padding: 1px 4px;
    }

    .calendar-col-header {
        font-size: 0.62rem;
        padding: 0.35rem 0;
    }
}

/* Error pages */
.error-code {
    font-size: 8rem;
    font-weight: 800;
    line-height: 1;
    color: var(--tt-blue);
    opacity: 0.15;
    margin-bottom: -0.5rem;
}
