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

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

.hero-search .title,
.hero-search .subtitle {
    color: #fff;
}

.hero-search .subtitle strong {
    color: var(--tt-orange);
}

/* ===== 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;
}

/* ===== Search bar ===== */
.search-bar {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    margin-top: -1.5rem;
    position: relative;
    z-index: 1000;
}

.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;
}

/* ===== Upcoming Chips ===== */
.upcoming-chips-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--tt-blue);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.5rem;
}

.upcoming-chips-scroll {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.upcoming-chips-list {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.25rem;
    flex: 1;
    min-width: 0;
}

.upcoming-chips-list::-webkit-scrollbar {
    display: none;
}

.upcoming-chips-list::after {
    content: '';
    flex-shrink: 0;
    width: 1px;
}

.scroll-btn {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background: #fff;
    color: var(--tt-blue);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.scroll-btn.is-hidden {
    visibility: hidden;
}

.scroll-btn:hover {
    border-color: var(--tt-orange);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

@media screen and (max-width: 768px) {
    .scroll-btn {
        display: none;
    }
}

.upcoming-chip {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
    scroll-snap-align: start;
    padding: 0.5rem 0.75rem;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.upcoming-chip:hover {
    border-color: var(--tt-orange);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.upcoming-chip-date {
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
    background: var(--tt-orange);
    border-radius: 6px;
    padding: 0.2rem 0.4rem;
    white-space: nowrap;
}

.upcoming-chip-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.upcoming-chip-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #363636;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.upcoming-chip-city {
    font-size: 0.75rem;
    color: #7f8c8d;
    white-space: nowrap;
}

/* ===== Ongoing Chips ===== */
.ongoing-chips-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #946c00;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.ongoing-chips-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #946c00;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 1.4rem;
    height: 1.4rem;
    border-radius: 50%;
}

.ongoing-chip {
    border-color: #ffe08a;
}

.ongoing-chip:hover {
    border-color: #946c00;
}

.ongoing-chip-date {
    background: #ffe08a !important;
    color: #946c00 !important;
}

/* ===== 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;
}

#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 ===== */
@media screen and (max-width: 768px) {
    .hero-search.is-medium .hero-body {
        padding: 3rem 1rem;
    }

    .hero-search .title.is-2 {
        font-size: 1.5rem;
    }

    .hero-search .subtitle.is-5 {
        font-size: 0.95rem;
    }

    .search-bar {
        padding: 1rem;
        margin-top: -1rem;
        border-radius: 8px;
    }

    .map-wrapper {
        margin-left: -1.5rem;
        margin-right: -1.5rem;
    }

    #map {
        height: 50vh;
        min-height: 300px;
        border-radius: 0;
    }

    .department-map {
        height: 300px;
    }

    .tournament-marker-popup {
        min-width: 160px;
    }
}

/* ===== Latest Tournaments Section ===== */
.latest-tournaments-section {
    background: #f8f9fa;
}

.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;
}

/* ===== SEO Content Section ===== */
.seo-content-section {
    background: var(--card-bg);
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.seo-content {
    max-width: 800px;
    margin: 0 auto;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
}

.seo-content .title {
    color: var(--text-primary);
}

/* ===== Tournament Detail - Hero ===== */
.hero-detail {
    background: linear-gradient(135deg, var(--tt-blue) 0%, var(--tt-blue-dark) 100%);
}

.hero-detail .breadcrumb ul {
    align-items: center;
    flex-wrap: nowrap;
    min-width: 0;
}

.hero-detail .breadcrumb li.is-active {
    overflow: hidden;
    min-width: 0;
}

.hero-detail .breadcrumb li.is-active a {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hero-detail .breadcrumb a {
    color: rgba(255, 255, 255, 0.7);
}

.hero-detail .breadcrumb li.is-active a {
    color: rgba(255, 255, 255, 0.9);
}

.hero-detail .breadcrumb li + li::before {
    color: rgba(255, 255, 255, 0.4);
}

.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 - Map ===== */
.detail-map {
    height: 280px;
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
}

/* ===== Tournament Detail - Info Card ===== */
.detail-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.detail-card-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--tt-blue);
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f0f0f0;
    margin: 0;
}

.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-icon.has-text-success {
    color: #48c78e;
    background: #effaf5;
}

.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);
}

.detail-info-value a.has-text-success {
    color: #1a7d50;
}

.detail-info-value a.has-text-success:hover {
    color: #146842;
}

/* ===== Tournament Detail - Tables Section ===== */
.tables-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--tt-blue);
}

.tables-section-title .tag {
    background: #a86000;
    color: #fff;
    font-weight: 700;
}

.date-group-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--tt-blue-dark);
    padding: 0.6rem 1rem;
    background: linear-gradient(90deg, #f0f4f8, transparent);
    border-left: 3px solid var(--tt-orange);
    border-radius: 0 6px 6px 0;
    margin-bottom: 0.75rem;
    text-transform: capitalize;
}

.date-group-icon {
    color: var(--tt-orange);
    display: flex;
    align-items: center;
}

.table-cards {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.table-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
    border: 1px solid #eee;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}

.table-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.table-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem 0.25rem;
}

.table-card-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #363636;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.table-card-time {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    font-weight: 400;
    color: #626b6e;
}

.table-type-tag {
    font-size: 0.75rem;
    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;
}

.table-card-body {
    padding: 0.25rem 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.table-card-detail {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.85rem;
    color: #555;
}

.table-card-detail.has-text-success {
    color: #1a7d50 !important;
}

.table-card-description {
    width: 100%;
    font-size: 1rem;
    color: #626b6e;
    line-height: 1.4;
    margin-bottom: 0.4rem;
}

/* ===== 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-map {
        height: 200px;
        border-radius: 8px;
    }

    .date-group-header {
        font-size: 0.85rem;
    }

    .table-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
    }
}

/* ===== 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);
    }
}

/* ===== Alert CTA (sous la search bar) ===== */
.alert-cta {
    text-align: right;
    margin-top: 8px;
}

.alert-cta-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--tt-orange);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 0;
    transition: color 0.2s;
}

.alert-cta-button:hover {
    color: var(--tt-orange-hover);
}

.alert-cta-button svg {
    stroke: currentColor;
    flex-shrink: 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;
}
