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

/* ===== Map ===== */
#map {
    height: 600px;
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#map .leaflet-control-container {
    z-index: 0;
}

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

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

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

/* ===== Responsive ===== */
@media screen and (max-width: 768px) {
    .hero-search.is-medium .hero-body {
        padding: 2rem 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 {
        height: 50vh;
        min-height: 300px;
        border-radius: 6px;
    }

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

    .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;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.latest-tournament-date {
    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;
}

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

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

.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: #7f8c8d;
    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: #48c78e;
}

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

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

.tables-section-title .tag {
    background: var(--tt-orange);
    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: #7f8c8d;
}

.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-description {
    width: 100%;
    font-size: 1rem;
    color: #7f8c8d;
    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);
}
