/* === COMPÁS / WIND PREDICTOR === */

/* Nuevo Compás Interactivo */
#compass-selector-container {
    width: 200px;
    height: 200px;
    position: relative;
    margin: 20px auto;
    cursor: crosshair;
}

.compass-image {
    width: 100%;
    height: 100%;
    pointer-events: none;
    position: relative;
    z-index: 1;
}

.wind-compass-pair {
    display: flex;
    gap: 28px;
    align-items: center;
    justify-content: space-between;
    background: rgba(21, 32, 43, 0.55);
    border: 1px solid rgba(88, 166, 255, 0.25);
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.compass-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    flex: 1 1 50%;
}

.compass-block-prediction {
    padding-top: 26px;
}

.compass-block label {
    font-weight: 600;
    color: #9fb7ff;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}


#wind-result-compass,
#compass-selector-container {
    width: 240px;
    height: 240px;
    position: relative;
    margin: 0 auto;
}

#wind-result-arrow {
    position: absolute;
    width: 30px;
    height: 120px;
    left: 50%;
    top: 50%;
    margin: -60px 0 0 -15px;
    transform-origin: 15px 60px;
    transition: transform 0.5s ease-out;
    z-index: 2;
    pointer-events: none;
}

#wind-result-arrow::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 25px solid #2ecc71;
    bottom: 10px;
    left: 0;
}

#wind-result-arrow::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 100px;
    background-color: #2ecc71;
    left: 12px;
    top: 10px;
}

#wind-result-arrow span {
    position: absolute;
    display: block;
    width: 30px;
    height: 10px;
    background-color: #2ecc71;
    left: 0;
    top: 0;
    border-radius: 2px;
}

#wind-result-display {
    font-weight: 600;
    color: #2ecc71;
    text-align: center;
    min-height: 20px;
    font-size: 15px;
    letter-spacing: 0.4px;
    margin-top: -6px;
}

.wind-result-body {
    display: flex;
    align-items: center;
    gap: 36px;
    justify-content: center;
    padding: 26px;
    border: 1px solid rgba(88, 166, 255, 0.2);
    border-radius: 16px;
    background: rgba(18, 26, 38, 0.55);
}

.wind-result-body .compass-container {
    width: 240px;
    height: 240px;
    position: relative;
}

.wind-result-metadata {
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: center;
    text-align: center;
}

.wind-main {
    font-size: 22px;
    font-weight: 600;
    color: #58a6ff;
    margin: 0;
}

.wind-secondary {
    font-size: 18px;
    color: #a5b4d8;
    margin: 0;
}

.wind-label {
    font-size: 13px;
    letter-spacing: 1px;
    color: #9fb7ff;
    margin: 0;
}

.wind-label-inverse {
    color: #cfd9ff;
}

/* Contenedor del compás */
#compass-selector-container {
    cursor: crosshair;
}

/* Imagen del compás */
.compass-image {
    width: 100%;
    height: 100%;
    pointer-events: none;
    position: relative;
    z-index: 1;
}

/* Contenedor de la flecha */
#compass-arrow {
    position: absolute;
    width: 30px;
    height: 120px; /* Altura fija para la flecha */
    left: 50%;
    top: 50%;
    margin: -60px 0 0 -15px; /* Centrado vertical y horizontal */
    transform-origin: 15px 60px; /* Punto de pivote en el centro de la flecha */
    transition: transform 0.5s ease-out;
    z-index: 2;
    pointer-events: none;
}

/* Triángulo inferior (cola) */
#compass-arrow::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 25px solid #e74c3c;
    bottom: 10px; /* Ajuste para posicionar la cola */
    left: 0;
}

/* Cuerpo de la flecha */
#compass-arrow::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 100px;
    background-color: #e74c3c;
    left: 12px;
    top: 10px; /* Ajuste para posicionar el cuerpo */
}

/* Punta de la flecha */
#compass-arrow span {
    position: absolute;
    display: block;
    width: 30px;
    height: 10px;
    background-color: #e74c3c;
    left: 0;
    top: 0;
    border-radius: 2px;
}

#current-wind-display {
    text-align: center;
    margin-top: -6px;
    font-weight: 600;
    color: #58a6ff;
    font-size: 15px;
    letter-spacing: 0.4px;
}

.wind-predictor-content {
    flex-direction: column; 
}

.time-inputs {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 18px;
}

.time-inputs .input-group {
    width: 100%;
}

.time-inputs label {
    font-weight: 600;
    color: #cfd9ff;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.wind-compass-pair {
    display: flex;
    gap: 28px;
    align-items: center;
    justify-content: space-between;
    background: rgba(21, 32, 43, 0.55);
    border: 1px solid rgba(88, 166, 255, 0.25);
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.wind-result-body {
    flex-direction: column;
    padding: 18px;
    gap: 20px;
}

.wind-result-body .compass-container {
    width: 180px;
    height: 180px;
}

#calculate-wind-button {
    padding: 10px;
    font-size: 1em;
}

/* ========================================================================= */
/* --- FILTRO DE NACIONES / CLANES --- */
/* ========================================================================= */
#nation-filter-modal { max-width: 600px; width: 90%; min-width: 340px; }
.nation-filter-body { padding: 14px 0; }
.filter-section h5 { margin: 0 0 8px; color: #58a6ff; font-size: 14px; }
#nation-checkboxes { display: flex; flex-wrap: wrap; gap: 6px; }
#nation-checkboxes label { display: flex; align-items: center; gap: 5px; padding: 4px 8px; background: rgba(255,255,255,0.05); border: 1px solid #333; border-radius: 6px; cursor: pointer; font-size: 13px; transition: background 0.2s; }
#nation-checkboxes label:hover { background: rgba(88,166,255,0.15); }
#nation-checkboxes label img { width: 18px; height: 14px; }
.clan-selectors { display: flex; flex-direction: column; gap: 6px; }
.clan-selector-row { display: flex; align-items: center; gap: 8px; }
.clan-color-dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; border: 2px solid rgba(255,255,255,0.3); }
.clan-dropdown { flex: 1; padding: 6px 10px; background: #121722; color: #e6e6e6; border: 1px solid #253045; border-radius: 6px; font-size: 13px; cursor: pointer; }
.filter-btn { padding: 6px 14px; background: #17202e; color: #e6e6e6; border: 1px solid #253045; border-radius: 6px; cursor: pointer; font-size: 13px; }
.filter-btn:hover { background: #253045; }
.filter-btn.primary { background: #1a5fb4; border-color: #58a6ff; }
.filter-btn.primary:hover { background: #2a7fff; }

/* ========================================================================= */
/* --- BUSCADOR DE PRODUCTOS: CANTIDAD MÍNIMA + VER EN MAPA --- */
/* ========================================================================= */
.modal-field-row { display: flex; gap: 10px; align-items: flex-end; }
.modal-field-half { flex: 1; }
.modal-field-half-btn { display: flex; align-items: flex-end; }
.btn-show-on-map {
    padding: 8px 16px; background: #1a5fb4; color: #fff; border: 1px solid #58a6ff;
    border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 600;
    white-space: nowrap; transition: all 0.2s;
}
.btn-show-on-map:hover:not(:disabled) { background: #2a7fff; }
.btn-show-on-map:disabled { opacity: 0.4; cursor: not-allowed; }

#product-min-quantity {
    width: 100%; padding: 8px 10px; background: #121722; color: #e6e6e6;
    border: 1px solid #253045; border-radius: 6px; font-size: 14px;
}
#product-min-quantity::placeholder { color: #556; }

/* Marcadores de producto en el mapa */
.product-map-marker {
    position: absolute; pointer-events: none; z-index: 500;
    background: rgba(26, 95, 180, 0.92); color: #fff;
    padding: 3px 8px; border-radius: 4px; font-size: 11px; font-weight: 600;
    white-space: nowrap; border: 1px solid #58a6ff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    transform: translate(-50%, -100%);
    line-height: 1.3;
}
.product-map-marker::after {
    content: ''; position: absolute; bottom: -5px; left: 50%; transform: translateX(-50%);
    border-left: 5px solid transparent; border-right: 5px solid transparent;
    border-top: 5px solid #58a6ff;
}
.product-map-marker .marker-qty { color: #7dffb3; }

/* Botón flotante para limpiar marcadores */
#clear-product-markers {
    position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
    z-index: 1000; padding: 10px 24px;
    background: rgba(26, 95, 180, 0.95); color: #fff;
    border: 1px solid #58a6ff; border-radius: 8px;
    font-size: 14px; font-weight: 600; cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
    transition: all 0.2s; display: none;
}
#clear-product-markers:hover { background: #2a7fff; }

/* Botón flotante para borrar ruta marítima */
#clear-sea-route-btn {
    position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
    z-index: 1000; padding: 10px 24px;
    background: rgba(231, 76, 60, 0.95); color: #fff;
    border: 1px solid #e74c3c; border-radius: 8px;
    font-size: 14px; font-weight: 600; cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
    transition: all 0.2s; display: none;
}
#clear-sea-route-btn:hover { background: #c0392b; }

/* ========================================================================= */
/* --- PANEL DE ESTADÍSTICAS CON GRÁFICOS --- */
/* ========================================================================= */
#charts-modal { max-width: 700px; width: 90%; }
.charts-tabs { display: flex; gap: 4px; margin-bottom: 12px; flex-wrap: wrap; }
.chart-tab { padding: 6px 14px; background: #17202e; color: #a0aec0; border: 1px solid #253045; border-radius: 6px; cursor: pointer; font-size: 13px; transition: all 0.2s; }
.chart-tab:hover { background: #253045; color: #e6e6e6; }
.chart-tab.active { background: #1a5fb4; color: #fff; border-color: #58a6ff; }
.charts-body { position: relative; width: 100%; min-height: 350px; max-height: 500px; }
.charts-body canvas { width: 100% !important; height: 100% !important; }
