/* RESET Y BASE */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: #ffffff;
    min-height: 100vh;
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 20px rgba(0,0,0,0.05);
}

/* HEADER */
.map-header {
    background: #D24F8F;
    color: white;
    padding: 1.2rem 1.5rem;
    border-radius: 0 0 24px 24px;
}

.map-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.map-header p {
    opacity: 0.85;
    font-size: 0.85rem;
    margin-top: 6px;
}

/* LAYOUT PRINCIPAL */
.main-layout {
    display: flex;
    flex: 1;
    justify-content: center;
    align-items: center;
    padding: 1.2rem;
}

.map-wrapper {
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#svg-container {
    width: 100%;
    display: flex;
    justify-content: center;
    position: relative;
}

#mapa-clubes {
    width: 100%;
    height: auto;
    max-width: 800px;
    cursor: pointer;
    border-radius: 24px;
}

.tap-hint {
    font-size: 0.7rem;
    text-align: center;
    margin-top: 12px;
    color: #9e7a8e;
    background: #f9f0f4;
    padding: 5px 14px;
    border-radius: 40px;
    display: inline-block;
}

/* ========== POPUP EN ESCRITORIO (hover) ========== */
.popup-card {
    position: absolute;
    z-index: 100;
    background: white;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(210, 79, 143, 0.25), 0 2px 8px rgba(0,0,0,0.1);
    width: 340px;
    padding: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.95);
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    border: 1px solid rgba(210, 79, 143, 0.15);
    overflow: hidden;
}

.popup-card.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.popup-header {
    background: linear-gradient(135deg, #D24F8F 0%, #e06ba3 100%);
    color: white;
    padding: 1rem 1.2rem;
    border-radius: 20px 20px 0 0;
}

.popup-header h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
}

.popup-body {
    padding: 1rem 1.2rem;
    max-height: 320px;
    overflow-y: auto;
}

.popup-body .club-detail {
    margin: 6px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 0.82rem;
    border-left: 2px solid #f0e6ed;
    padding-left: 10px;
}

.popup-body .detail-label {
    font-weight: 700;
    color: #8a5a74;
    min-width: 100px;
}

.popup-body .detail-value {
    color: #2a3a24;
    word-break: break-word;
    line-height: 1.4;
    flex: 1;
}

.popup-body .detail-value a {
    color: #D24F8F;
    text-decoration: none;
}

.popup-body .detail-value a:hover {
    text-decoration: underline;
}

.popup-body .reseña {
    background: #fdf6f9;
    padding: 10px;
    border-radius: 14px;
    font-size: 0.8rem;
    line-height: 1.45;
    margin-top: 10px;
    color: #2f3d2a;
}

/* Flecha del popup */
.popup-card::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid white;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.1));
}

.popup-card.popup-above::after {
    bottom: auto;
    top: -8px;
    border-top: none;
    border-bottom: 10px solid white;
}

/* ========== PINS DEL MAPA ========== */
#Capa_1 > path[fill="#e64294"] {
    cursor: pointer;
    stroke: transparent;
    stroke-width: 16px;
    transition: all 0.15s ease;
}

#Capa_1 > path[fill="#e64294"]:hover {
    stroke: #D24F8F;
    stroke-width: 10px;
    filter: drop-shadow(0 0 6px rgba(210, 79, 143, 0.5));
}

#Capa_1 > path[fill="#e64294"].active {
    stroke: #D24F8F;
    stroke-width: 10px;
    filter: drop-shadow(0 0 8px rgba(210, 79, 143, 0.6));
}

.club-pin {
    cursor: pointer;
    transition: r 0.1s ease, stroke-width 0.1s;
}

.club-pin:hover {
    r: 9;
    stroke-width: 2.5;
    filter: drop-shadow(0 0 2px rgba(210, 79, 143, 0.3));
}

/* ========== MODAL PARA MÓVIL ========== */
.mobile-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

.mobile-modal-content {
    background: #fffef7;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.25s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.mobile-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem;
    background: #D24F8F;
    color: white;
    border-radius: 0 0 24px 24px;
}

.mobile-modal-header h2 {
    font-size: 1.3rem;
    font-weight: 600;
}

.close-modal {
    background: none;
    border: none;
    color: white;
    font-size: 2.2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 8px;
}

.close-modal:hover {
    opacity: 0.8;
}

.mobile-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.2rem;
}

.mobile-modal-body .club-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #D24F8F;
    border-left: 4px solid #D24F8F;
    padding-left: 12px;
    margin-bottom: 1rem;
}

.mobile-modal-body .club-detail {
    margin: 12px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.9rem;
    border-left: 2px solid #f0e6ed;
    padding-left: 12px;
}

.mobile-modal-body .detail-label {
    font-weight: 700;
    color: #8a5a74;
    min-width: 105px;
}

.mobile-modal-body .detail-value {
    color: #2a3a24;
    word-break: break-word;
    line-height: 1.4;
    flex: 1;
}

.mobile-modal-body .detail-value a {
    color: #D24F8F;
    text-decoration: none;
}

.mobile-modal-body .detail-value a:hover {
    text-decoration: underline;
}

.mobile-modal-body .reseña {
    background: #fdf6f9;
    padding: 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    line-height: 1.45;
    margin-top: 16px;
    color: #2f3d2a;
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .main-layout {
        padding: 0.8rem;
    }
    .map-header h1 {
        font-size: 1.2rem;
    }
    .map-header {
        border-radius: 0 0 20px 20px;
    }
    .popup-card {
        display: none !important;
    }
}

@media (min-width: 901px) {
    .mobile-modal {
        display: none !important;
    }
}