/**
 * SeaStar Export Map - Frontend Styles
 * Premium dark/navy design with electric blue accents
 */

/* Variables CSS */
:root {
    --seastar-bg-primary: #0a0f1e;
    --seastar-bg-secondary: #0d1526;
    --seastar-bg-card: rgba(13, 21, 38, 0.8);
    --seastar-accent: #00d4ff;
    --seastar-accent-glow: rgba(0, 212, 255, 0.3);
    --seastar-text-primary: #ffffff;
    --seastar-text-secondary: rgba(255, 255, 255, 0.7);
    --seastar-text-muted: rgba(255, 255, 255, 0.5);
    --seastar-border: rgba(255, 255, 255, 0.1);
    --seastar-glass-bg: rgba(255, 255, 255, 0.05);
    --seastar-glass-border: rgba(255, 255, 255, 0.1);
}

/* Container principal */
.seastar-export-map-container {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(180deg, var(--seastar-bg-primary) 0%, var(--seastar-bg-secondary) 100%);
    padding: 40px 20px;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
}

/* Fondo con patrón sutil */
.seastar-export-map-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, var(--seastar-accent-glow) 0%, transparent 50%);
    opacity: 0.1;
    pointer-events: none;
}

/* Wrapper del mapa */
.seastar-map-wrapper {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto 40px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
}

/* SVG del mapa */
.seastar-world-map {
    width: 100%;
    height: auto;
    display: block;
}

/* Continentes */
.seastar-world-map .continents path {
    transition: fill 0.3s ease;
}

.seastar-world-map .continents path.south-america {
    fill: #2a4060;
}

/* === ANIMACIONES DE RUTAS === */
.export-route {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawRoute 2s ease-out forwards;
    opacity: 0;
}

.export-route.animate {
    opacity: 1;
}

@keyframes drawRoute {
    0% {
        stroke-dashoffset: 1000;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

/* Efecto de flujo continuo */
.export-route.flowing {
    animation: drawRoute 2s ease-out forwards, flowingLine 3s linear infinite 2s;
}

@keyframes flowingLine {
    0% {
        stroke-dasharray: 20, 10;
        stroke-dashoffset: 0;
    }
    100% {
        stroke-dasharray: 20, 10;
        stroke-dashoffset: -30;
    }
}

/* === PUNTO DE ORIGEN - COQUIMBO === */
.origin-marker {
    cursor: pointer;
}

/* Pulso animado */
.pulse-ring {
    transform-origin: center;
    animation: pulseRing 2s ease-out infinite;
    opacity: 0;
}

.pulse-ring.pulse-1 {
    animation-delay: 0s;
}

.pulse-ring.pulse-2 {
    animation-delay: 0.6s;
}

.pulse-ring.pulse-3 {
    animation-delay: 1.2s;
}

@keyframes pulseRing {
    0% {
        r: 10;
        opacity: 0.8;
    }
    100% {
        r: 40;
        opacity: 0;
    }
}

/* Etiqueta del origen */
.origin-label {
    opacity: 0;
    animation: fadeInLabel 0.5s ease-out 1s forwards;
}

@keyframes fadeInLabel {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === PUNTOS DE DESTINO === */
.destination-marker {
    cursor: pointer;
    transition: transform 0.3s ease;
}

.destination-marker:hover {
    transform: scale(1.2);
}

.dest-point {
    transition: r 0.3s ease, fill 0.3s ease;
}

.destination-marker:hover .dest-point {
    r: 7;
}

.dest-outer-ring {
    transform-origin: center;
    animation: rotateRing 10s linear infinite;
}

@keyframes rotateRing {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* === TOOLTIP === */
.seastar-tooltip {
    position: absolute;
    background: rgba(10, 15, 30, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--seastar-accent);
    border-radius: 12px;
    padding: 16px 20px;
    min-width: 200px;
    max-width: 280px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    box-shadow: 0 10px 40px rgba(0, 212, 255, 0.2);
}

.seastar-tooltip.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.tooltip-header {
    font-size: 16px;
    font-weight: 600;
    color: var(--seastar-text-primary);
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--seastar-border);
}

.tooltip-content {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tooltip-cert {
    background: var(--seastar-accent-glow);
    color: var(--seastar-accent);
    font-size: 11px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* === CARDS DE DESTINOS === */
.seastar-destination-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.seastar-card {
    position: relative;
    background: var(--seastar-glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--seastar-glass-border);
    border-radius: 16px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.seastar-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--seastar-accent), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.seastar-card:hover {
    transform: translateY(-5px);
    border-color: var(--seastar-accent);
    box-shadow: 0 20px 60px rgba(0, 212, 255, 0.15);
}

.seastar-card:hover::before {
    opacity: 1;
}

.seastar-card.active {
    border-color: var(--seastar-accent);
    background: rgba(0, 212, 255, 0.05);
}

/* Contenido del card - centrado para diseño minimalista sin íconos */
.card-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: #fff !important;
    margin: 0 0 12px;
    letter-spacing: -0.5px;
}

/* Certificaciones */
.card-certifications {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.cert-tag {
    background: rgba(0, 212, 255, 0.1);
    color: #fff!important;
    font-size: 11px;
    font-weight: 500;
    padding: 5px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border: 1px solid rgba(0, 212, 255, 0.2);
    transition: all 0.3s ease;
    
    /* AJUSTES PARA CENTRAR EL BLOQUE */
    display: inline-block;       /* Solo ocupa el ancho del texto */
    text-align: center !important;
    margin: 10px auto;           /* Centra el elemento horizontalmente (arriba/abajo 10px, lados auto) */
    align-self: center;          /* Centra si el contenedor padre es Flex */
}

.seastar-card:hover .cert-tag {
    background: rgba(0, 212, 255, 0.2);
    border-color: rgba(0, 212, 255, 0.4);
}

/* Efecto de glow del card */
.card-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150%;
    height: 150%;
    background: radial-gradient(circle, var(--seastar-accent-glow) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.seastar-card:hover .card-glow {
    opacity: 0.3;
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .seastar-destination-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .seastar-export-map-container {
        padding: 20px 10px;
    }
    
    .seastar-map-wrapper {
        margin-bottom: 30px;
        border-radius: 12px;
    }
    
    .seastar-destination-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 0 10px;
    }
    
    .seastar-card {
        padding: 16px;
    }
    
    .card-title {
        font-size: 15px;
        margin-bottom: 8px;
                color: #fff!important;

    }
    
    .cert-tag {
        font-size: 9px;
        padding: 4px 8px;
           text-align: left!important;
    }
    
    .origin-label {
        font-size: 9px !important;
    }
}

@media (max-width: 480px) {
    .seastar-destination-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .seastar-card {
        padding: 14px;
    }
    
    .card-title {
        font-size: 14px;
        color: #fff!important;
    }
    
    .cert-tag {
        font-size: 8px;
        padding: 3px 6px;
    }
}

/* === ANIMACIONES DE ENTRADA === */
.seastar-card {
    opacity: 0;
    transform: translateY(30px);
    animation: cardFadeIn 0.6s ease-out forwards;
}

.seastar-card:nth-child(1) { animation-delay: 0.1s; }
.seastar-card:nth-child(2) { animation-delay: 0.2s; }
.seastar-card:nth-child(3) { animation-delay: 0.3s; }
.seastar-card:nth-child(4) { animation-delay: 0.4s; }

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === EFECTO DE PARTÍCULAS DE FONDO (opcional) === */
.seastar-export-map-container .particles {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--seastar-accent);
    border-radius: 50%;
    opacity: 0.3;
    animation: floatParticle 15s infinite linear;
}

@keyframes floatParticle {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.3;
    }
    90% {
        opacity: 0.3;
    }
    100% {
        transform: translateY(-100vh) rotate(720deg);
        opacity: 0;
    }
}