/* ======================================== */
/* VARIABLES Y RESET */
/* ======================================== */
:root {
    --bg: #1e1e1e;
    --panel: #2a2a2a;
    --accent: #4aa3ff;
    --text: #e6e6e6;
    --muted: #a0a0a0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 90px;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.55)), url("../img/fondo.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: var(--text);
}

/* ======================================== */
/* HEADER Y NAVEGACIÓN */
/* ======================================== */
header {
    background: #111;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid var(--accent);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    gap: 20px;
    flex-wrap: wrap;
}

    header img {
        height: 45px;
    }

/* Contenedor de acciones (selector + hamburguesa) */
.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: auto;
    flex-shrink: 0;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

    .menu-toggle span {
        width: 100%;
        height: 3px;
        background: var(--text);
        border-radius: 3px;
        transition: all 0.3s ease;
        transform-origin: center;
    }

.nav-links {
    display: flex;
    align-items: center;
}

nav a {
    color: var(--text);
    margin: 0 12px;
    text-decoration: none;
    font-weight: bold;
    position: relative;
    padding-bottom: 4px;
    transition: color 0.3s ease;
    white-space: nowrap;
}

    nav a:hover {
        color: var(--accent);
    }

    nav a.active {
        color: var(--accent);
    }

        nav a.active::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 2px;
            background: var(--accent);
            animation: slideIn 0.3s ease forwards;
        }

@keyframes slideIn {
    from {
        transform: scaleX(0);
    }

    to {
        transform: scaleX(1);
    }
}

/* ======================================== */
/* SELECTOR DE IDIOMA EN HEADER */
/* ======================================== */
.language-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 4px 8px;
}

.lang-btn {
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 12px;
    transition: all 0.2s ease;
    letter-spacing: 0.5px;
    font-family: inherit;
    line-height: 1;
}

    .lang-btn:hover {
        color: var(--text);
        background: rgba(255, 255, 255, 0.08);
    }

    .lang-btn.active {
        background: var(--accent);
        color: white;
        box-shadow: 0 2px 6px rgba(74, 163, 255, 0.3);
    }

.lang-separator {
    color: var(--muted);
    font-size: 12px;
    opacity: 0.5;
    line-height: 1;
}

/* ======================================== */
/* SECCIONES GENERALES */
/* ======================================== */
.hero {
    padding: 80px 20px;
    text-align: center;
    background: radial-gradient(circle at top, #2b2b2b, #111);
}

    .hero h1 {
        font-size: 40px;
        margin-bottom: 10px;
    }

    .hero p {
        color: var(--muted);
        font-size: 18px;
    }

section {
    padding: 60px 15%;
}

.panel {
    background: var(--panel);
    padding: 25px;
    border-radius: 10px;
    margin-top: 20px;
}

h2 {
    font-size: 24px;
    color: var(--accent);
    margin-bottom: 15px;
}

.hashtag {
    color: var(--accent);
}

/* ======================================== */
/* GRID Y CARDS */
/* ======================================== */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
    margin-bottom: 20px;
}

.card {
    background: #222;
    padding: 15px;
    border-radius: 10px;
}

footer {
    text-align: center;
    padding: 30px;
    background: #111;
    color: var(--muted);
    border-top: 1px solid #333;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--accent);
    color: white;
    border-radius: 6px;
    text-decoration: none;
    margin-top: 10px;
}

.card-img {
    display: block;
    margin: 15px auto 0 auto;
    max-width: 100%;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #333;
    opacity: 0.95;
    transition: transform 0.3s ease, opacity 0.3s ease;
    height: auto;
}

    .card-img:hover {
        transform: scale(1.03);
        opacity: 1;
    }

.card-download {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.grid-que-es {
    display: grid;
    grid-template-columns: 4fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* ======================================== */
/* VISOR DE IMÁGENES */
/* ======================================== */
.image-comparison-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    overflow: hidden;
    user-select: none;
    --position: 50%;
}

    .image-comparison-container img {
        width: 100%;
        height: auto;
        display: block;
        pointer-events: none;
    }

.img-background {
    position: relative;
    z-index: 1;
}

.img-foreground {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    clip-path: inset(0 calc(100% - var(--position)) 0 0);
}

.slider-bar {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--position);
    width: 4px;
    background: #ffffff;
    z-index: 3;
    cursor: ew-resize;
    transform: translateX(-50%);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

    .slider-bar::before {
        content: '';
        position: absolute;
        top: 0;
        bottom: 0;
        left: -3px;
        width: 10px;
        background: rgba(255, 255, 255, 0.4);
        filter: blur(4px);
    }

.slider-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    background: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    color: #333;
    font-size: 20px;
    font-weight: bold;
    pointer-events: none;
}

.video {
    width: 100%;
    max-width: 900px;
    border-radius: 10px;
    display: block;
    margin: 20px auto;
}

.logo-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

    .logo-group h1 {
        margin: 0;
    }

.logo-title {
    font-size: 32px;
    font-weight: bold;
    margin: 0;
    color: var(--text);
}

.titulo-verde {
    color: #4caf50;
    font-weight: bold;
}

/* ======================================== */
/* TESTIMONIOS */
/* ======================================== */
.testimonios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.testimonio-card {
    background: #222;
    padding: 25px;
    border-radius: 12px;
    border-left: 4px solid var(--accent);
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

    .testimonio-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 20px rgba(74, 163, 255, 0.15);
    }

    .testimonio-card::before {
        content: '"';
        position: absolute;
        top: -10px;
        left: 15px;
        font-size: 80px;
        color: var(--accent);
        opacity: 0.3;
        font-family: Georgia, serif;
        line-height: 1;
    }

.testimonio-texto {
    font-style: italic;
    color: var(--text);
    margin: 15px 0 20px 0;
    line-height: 1.6;
    flex-grow: 1;
    position: relative;
    z-index: 1;
}

.testimonio-autor {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 15px;
    border-top: 1px solid #333;
}

.testimonio-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #2b7fd4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 20px;
    flex-shrink: 0;
}

.testimonio-info {
    display: flex;
    flex-direction: column;
}

.testimonio-nombre {
    font-weight: bold;
    color: var(--accent);
    font-size: 16px;
}

.testimonio-rol {
    color: var(--muted);
    font-size: 13px;
    margin-top: 2px;
}

.testimonio-estrellas {
    color: #ffc107;
    margin-top: 5px;
    font-size: 14px;
}

/* ======================================== */
/* IFRAME RESPONSIVO */
/* ======================================== */
.iframe-container {
    position: relative;
    width: 100%;
    margin: 20px auto;
    padding-bottom: 62.25%;
    height: 0;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

    .iframe-container iframe {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border: 0;
    }

/* ======================================== */
/* PREDICCIÓN ASTROFOTOGRÁFICA - SECCIÓN */
/* ======================================== */
.prediccion-section {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.prediccion-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 24px;
    backdrop-filter: blur(10px);
}

/* Cabecera */
.prediccion-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.prediccion-header-icon {
    font-size: 42px;
    line-height: 1;
    filter: drop-shadow(0 2px 8px rgba(74, 163, 255, 0.3));
}

.prediccion-title {
    margin: 0 0 4px 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.5px;
}

.prediccion-subtitle {
    margin: 0;
    font-size: 14px;
    color: var(--muted);
    line-height: 1.4;
}

/* Grid de controles */
.prediccion-controls-v2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 16px;
}

/* Grupos de control */
.control-group {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

    .control-group:hover {
        border-color: rgba(74, 163, 255, 0.3);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }

.control-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.control-group-icon {
    font-size: 18px;
}

.control-group-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.control-group-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Campos de control */
.control-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.control-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.control-input {
    width: 100%;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

    .control-input:hover {
        border-color: rgba(255, 255, 255, 0.2);
        background: rgba(255, 255, 255, 0.06);
    }

    .control-input:focus {
        outline: none;
        border-color: var(--accent);
        background: rgba(255, 255, 255, 0.06);
        box-shadow: 0 0 0 3px rgba(74, 163, 255, 0.15);
    }

/* Selectores con flecha personalizada */
select.control-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a0a0a0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    padding-right: 36px;
}

/* ======================================== */
/* SELECTS CON TEMA OSCURO */
/* ======================================== */
select.control-input {
    color-scheme: dark;
}

    select.control-input option {
        background: #2a2a2a;
        color: var(--text);
        padding: 10px 12px;
        font-size: 14px;
    }

        select.control-input option:checked {
            background: linear-gradient(0deg, var(--accent) 0%, var(--accent) 100%);
            color: white;
            font-weight: 500;
        }

        select.control-input option:hover {
            background: rgba(74, 163, 255, 0.3);
            color: var(--text);
        }

        select.control-input option:disabled {
            color: #666;
            font-style: italic;
        }

@supports not (color-scheme: dark) {
    select.control-input {
        background-color: #2a2a2a;
        color: var(--text);
    }

        select.control-input option {
            background-color: #2a2a2a;
            color: var(--text);
        }
}

/* Botones */
.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: stretch;
}

/* ======================================== */
/* BOTONES DE PREDICCIÓN */
/* ======================================== */
.prediccion-btn {
    flex: 1;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    line-height: 1.3;
    min-height: 44px;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

    .prediccion-btn .btn-icon {
        font-size: 14px;
        flex-shrink: 0;
        line-height: 1;
    }

    .prediccion-btn .btn-text {
        display: inline;
        line-height: 1.3;
        word-break: break-word;
    }

    .prediccion-btn.btn-primary {
        background: linear-gradient(135deg, var(--accent) 0%, #2b7fd4 100%);
        color: white;
        box-shadow: 0 2px 6px rgba(74, 163, 255, 0.25);
    }

        .prediccion-btn.btn-primary:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(74, 163, 255, 0.4);
        }

        .prediccion-btn.btn-primary:active {
            transform: translateY(0);
        }

    .prediccion-btn.btn-secondary {
        background: rgba(74, 163, 255, 0.15);
        color: var(--accent);
        border-color: rgba(74, 163, 255, 0.4);
    }

        .prediccion-btn.btn-secondary:hover {
            background: rgba(74, 163, 255, 0.25);
            border-color: var(--accent);
        }

    .prediccion-btn:disabled {
        background: #555;
        color: #888;
        cursor: not-allowed;
        transform: none;
        box-shadow: none;
    }

.btn-icon {
    font-size: 14px;
}

/* Estado */
.prediccion-estado {
    padding: 10px 0px;
    border-radius: 6px;
    font-size: 13px;
    text-align: center;
    min-height: 0;
    transition: all 0.3s ease;
}

    .prediccion-estado:empty {
        display: none;
    }

    .prediccion-estado.success {
        background: rgba(76, 175, 80, 0.12);
        color: #4caf50;
        border-left: 3px solid #4caf50;
    }

    .prediccion-estado.error {
        background: rgba(244, 67, 54, 0.12);
        color: #f44336;
        border-left: 3px solid #f44336;
    }

    .prediccion-estado.warning {
        background: rgba(255, 193, 7, 0.12);
        color: #ffc107;
        border-left: 3px solid #ffc107;
    }

/* ======================================== */
/* PREDICCIÓN - RESULTADOS */
/* ======================================== */
.prediccion-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.prediccion-info-card {
    background: #2a2a2a;
    padding: 10px 12px;
    border-radius: 8px;
    border-left: 3px solid var(--accent);
}

    .prediccion-info-card h4 {
        margin: 0 0 10px 0;
        color: var(--accent);
        font-size: 16px;
    }

.prediccion-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #333;
}

    .prediccion-stat:last-child {
        border-bottom: none;
    }

.prediccion-stat-label {
    color: var(--muted);
    font-size: 14px;
}

.prediccion-stat-value {
    font-weight: bold;
    font-size: 18px;
}

.prediccion-tabla-container {
    overflow-x: auto;
    margin-top: 20px;
}

.prediccion-tabla {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

    .prediccion-tabla thead {
        background: #2a2a2a;
        position: sticky;
        top: 0;
    }

    .prediccion-tabla th {
        padding: 12px 8px;
        text-align: center;
        color: var(--accent);
        font-weight: bold;
        border-bottom: 2px solid var(--accent);
    }

    .prediccion-tabla td {
        padding: 10px 8px;
        text-align: center;
        border-bottom: 1px solid #333;
    }

    .prediccion-tabla tbody tr {
        transition: background 0.2s ease;
    }

        .prediccion-tabla tbody tr:hover {
            background: rgba(74, 163, 255, 0.1);
        }

        .prediccion-tabla tbody tr.noche {
            background: rgba(74, 163, 255, 0.05);
        }

.nube-bar {
    display: inline-block;
    width: 60px;
    height: 10px;
    background: #333;
    border-radius: 5px;
    overflow: hidden;
    position: relative;
    vertical-align: middle;
}

.nube-bar-fill {
    height: 100%;
    transition: width 0.3s ease;
}

.fase-lunar {
    text-align: center;
    padding: 15px;
}

.fase-lunar-icono {
    font-size: 48px;
    margin: 10px 0;
}

/* Autocomplete */
.autocomplete-container {
    position: relative;
}

.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #333;
    border: 1px solid #555;
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.autocomplete-item {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #444;
    transition: background 0.2s ease;
}

    .autocomplete-item:hover {
        background: rgba(74, 163, 255, 0.2);
    }

    .autocomplete-item:last-child {
        border-bottom: none;
    }

.btn-luz {
    display: inline-block;
    padding: 8px 16px;
    background: #2b7fd4;
    color: white;
    border-radius: 6px;
    text-decoration: none;
    margin-top: 10px;
    font-size: 13px;
    font-weight: bold;
    transition: background 0.3s ease;
    border: none;
    cursor: pointer;
}

    .btn-luz:hover {
        background: #1e6bb8;
    }

/* ======================================== */
/* DIAGRAMA TEMPORAL */
/* ======================================== */
.timeline-container {
    position: relative;
    width: 100%;
    padding: 20px 20px 30px 20px;
    background: linear-gradient(90deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border-radius: 8px;
    overflow: hidden;
    box-sizing: border-box;
}

.timeline-period {
    position: absolute;
    border-radius: 3px;
    opacity: 0.9;
    cursor: pointer;
    transition: opacity 0.2s ease;
    border: 1px solid rgba(255,255,255,0.2);
}

    .timeline-period:hover {
        opacity: 1;
    }

.period-day {
    background: #ffd93d;
}

.period-golden-hour {
    background: #ff8c42;
}

.period-civil-twilight {
    background: #6b5b95;
}

.period-astronomical-night {
    background: #003b5c;
}

.period-galaxy-visible {
    background: #8a2be2;
}

.period-moon-up {
    background: #e0e0e0;
    border: 1px solid #a0a0a0;
}

/* ======================================== */
/* TARJETAS COLAPSABLES */
/* ======================================== */
.collapsible-card {
    transition: all 0.3s ease;
}

.collapse-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    padding: 4px 0;
    transition: color 0.2s ease;
}

    .collapse-header:hover {
        color: var(--accent);
    }

        .collapse-header:hover .collapse-icon {
            color: var(--accent);
            transform: scale(1.2);
        }

.collapse-icon {
    font-size: 12px;
    color: var(--muted);
    transition: transform 0.3s ease, color 0.2s ease;
    display: inline-block;
    line-height: 1;
}

.collapsible-card.collapsed .collapse-icon {
    transform: rotate(-90deg);
}

.collapsible-card.collapsed .collapse-content {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    margin-top: 0;
    padding-top: 0;
    padding-bottom: 0;
    transition: max-height 0.3s ease, opacity 0.2s ease, margin 0.3s ease, padding 0.3s ease;
}

.collapsible-card .collapse-content {
    max-height: 2000px;
    opacity: 1;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease 0.1s, margin 0.3s ease, padding 0.3s ease;
}

.btn-collapse-all {
    background: rgba(74, 163, 255, 0.15);
    color: var(--accent);
    border: 1px solid rgba(74, 163, 255, 0.4);
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

    .btn-collapse-all:hover {
        background: rgba(74, 163, 255, 0.25);
        border-color: var(--accent);
        transform: translateY(-1px);
    }

    .btn-collapse-all:active {
        transform: translateY(0);
    }

    .btn-collapse-all .btn-icon {
        transition: transform 0.3s ease;
        display: inline-block;
    }

    .btn-collapse-all.all-collapsed .btn-icon {
        transform: rotate(180deg);
    }

/* ======================================== */
/* BANNER DE INSTALACIÓN PWA */
/* ======================================== */
.install-banner {
    background: linear-gradient(135deg, var(--accent) 0%, #2b7fd4 100%);
    padding: 12px 16px;
    text-align: center;
    border-radius: 0;
    margin: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

    .install-banner p {
        margin: 0 0 8px 0;
        font-size: 14px;
        color: white;
    }

.install-btn {
    background: white;
    color: var(--accent);
    padding: 8px 20px;
    border: none;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.install-btn-text {
    white-space: wrap;
}

    .install-btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }

    .install-btn:active {
        transform: translateY(0);
    }

/* ======================================== */
/* MODAL DE MAPA - LAYOUT OPTIMIZADO */
/* ======================================== */
.mapa-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(5px);
    box-sizing: border-box;
}

.mapa-modal-content {
    background: var(--panel);
    border-radius: 12px;
    width: 100%;
    max-width: 900px;
    height: 90vh;
    max-height: 700px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease;
    box-sizing: border-box;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mapa-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(74, 163, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
    box-sizing: border-box;
}

    .mapa-modal-header h3 {
        margin: 0;
        font-size: 16px;
        color: var(--text);
    }

.btn-cerrar-mapa {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 28px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

    .btn-cerrar-mapa:hover {
        background: rgba(255, 255, 255, 0.1);
        color: var(--text);
    }

/* 🆕 BODY: Flex vertical, mapa ocupa todo el espacio */
.mapa-modal-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 12px;
    box-sizing: border-box;
    min-height: 0;
}

/* 🗺️ MAPA: Ocupa TODO el espacio disponible */
#google-map {
    flex: 1;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    box-sizing: border-box;
    min-height: 200px;
}

.leaflet-container {
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* 🆕 COORDENADAS: Todo en una sola fila */
.mapa-coordenadas {
    flex-shrink: 0;
    padding-top: 12px;
    box-sizing: border-box;
}

.coordenadas-fila {
    display: flex;
    gap: 12px;
    width: 100%;
    align-items: flex-end;
}

.coordenadas-display {
    flex: 1;
    min-width: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

    .coordenadas-display label {
        font-size: 11px;
        color: var(--muted);
        font-weight: 500;
    }

    .coordenadas-display input {
        width: 100%;
        padding: 6px 8px;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 6px;
        color: var(--text);
        font-size: 13px;
        font-family: monospace;
        box-sizing: border-box;
    }

/* 🆕 BOTÓN: Tamaño fijo, no se comprime */
.btn-usar-coordenadas {
    padding: 6px 16px;
    background: linear-gradient(135deg, var(--accent) 0%, #2b7fd4 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-sizing: border-box;
    white-space: nowrap;
    height: 32px;
    flex-shrink: 0;
}

    .btn-usar-coordenadas:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(74, 163, 255, 0.4);
    }

    .btn-usar-coordenadas:active {
        transform: translateY(0);
    }

/* 📱 RESPONSIVE: En móviles, mantener todo en una fila */
@media (max-width: 768px) {
    .mapa-modal {
        padding: 10px;
    }

    .mapa-modal-content {
        height: 95vh;
        max-height: none;
    }

    .mapa-modal-body {
        padding: 8px;
    }

    .coordenadas-fila {
        gap: 8px;
    }

    .coordenadas-display input {
        font-size: 12px;
        padding: 5px 6px;
    }

    .btn-usar-coordenadas {
        padding: 5px 12px;
        font-size: 12px;
        height: 30px;
    }
}

/* ======================================== */
/* CONDICIONES ACTUALES - CLASES */
/* ======================================== */
.condiciones-header-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.condiciones-header-item {
    color: var(--muted);
    font-size: 11px;
    margin-bottom: 13px;
    font-weight: bold;
}

.condiciones-label-sm {
    color: var(--muted);
    font-size: 11px;
}

.condiciones-value-md {
    font-size: 11px;
    font-weight: 600;
    color: var(--text);
}

.condiciones-metricas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 15px;
    padding-top: 15px;
}

.condicion-metrica {
    text-align: center;
}

.metrica-label {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 4px;
}

.metrica-valor {
    font-size: 24px;
    font-weight: 600;
}

/* ======================================== */
/* MARCADORES DE UBICACIONES FOTOGRAFIADAS */
/* ======================================== */
.icono-foto-marker {
    background: linear-gradient(135deg, #8a2be2 0%, #b84dff 100%);
    border: 2px solid white;
    border-radius: 50% 50% 50% 0;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: rotate(-45deg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s ease;
}

    .icono-foto-marker:hover {
        transform: rotate(-45deg) scale(1.15);
    }

    .icono-foto-marker .emoji {
        transform: rotate(45deg);
        font-size: 14px;
    }

.popup-foto {
    min-width: 240px;
    max-width: 280px;
}

.popup-foto-contenido {
    font-family: inherit;
    color: var(--text);
}

.popup-foto-imagen {
    width: 100%;
    height: auto;
    max-height: 320px;
    object-fit: contain;
    border-radius: 6px;
    margin-bottom: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
    display: block;
}

.popup-foto-titulo {
    font-size: 14px;
    font-weight: bold;
    color: var(--text);
    margin: 0 0 4px 0;
}

.popup-foto-descripcion {
    font-size: 12px;
    color: var(--muted);
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.popup-foto-etiqueta {
    display: inline-block;
    background: rgba(138, 43, 226, 0.2);
    color: #b84dff;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    margin-bottom: 8px;
}

.popup-foto-fecha {
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 10px;
}

.popup-foto-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #833ab4 0%, #fd1d1d 50%, #fcb045 100%);
    color: white;
    padding: 8px 14px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
    justify-content: center;
}

    .popup-foto-link:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(131, 58, 180, 0.4);
    }

.popup-foto-coords {
    font-size: 10px;
    color: var(--muted);
    margin-top: 8px;
    text-align: center;
    font-family: monospace;
}

.leaflet-popup-content-wrapper {
    background: var(--panel);
    color: var(--text);
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.leaflet-popup-tip {
    background: var(--panel);
}

.leaflet-popup-close-button {
    color: var(--muted) !important;
}

    .leaflet-popup-close-button:hover {
        color: var(--text) !important;
    }

.popup-foto-coords-link {
    display: block;
    text-decoration: none;
    color: var(--accent);
    transition: all 0.2s ease;
    padding: 4px 8px;
    border-radius: 4px;
    margin-top: 8px;
}

    .popup-foto-coords-link:hover {
        background: rgba(74, 163, 255, 0.1);
        color: #6bb6ff;
        text-decoration: underline;
    }

    .popup-foto-coords-link:active {
        transform: translateY(0);
    }

.popup-foto-btn-usar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    background: linear-gradient(135deg, var(--accent) 0%, #2b7fd4 100%);
    color: white;
    padding: 9px 14px;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 8px;
}

    .popup-foto-btn-usar:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(74, 163, 255, 0.4);
    }

    .popup-foto-btn-usar:active {
        transform: translateY(0);
    }

/* ======================================== */
/* FOOTER CON BOTÓN DE INSTALACIÓN */
/* ======================================== */
footer {
    text-align: center;
    padding: 20px 25px;
    background: #111;
    color: var(--muted);
    border-top: 1px solid #333;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
    flex-wrap: nowrap;
}

.footer-copyright {
    font-size: 14px;
    color: var(--muted);
}

.install-btn {
    background: linear-gradient(135deg, var(--accent) 0%, #2b7fd4 100%);
    color: white;
    padding: 8px 18px;
    border: none;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

    .install-btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(74, 163, 255, 0.4);
    }

    .install-btn:active {
        transform: translateY(0);
    }

    .install-btn.installed {
        background: rgba(76, 175, 80, 0.2);
        color: #4caf50;
        cursor: default;
        pointer-events: none;
    }

    .install-btn.hidden {
        display: none;
    }

/* ======================================== */
/* MODAL DE INSTRUCCIONES iOS */
/* ======================================== */
.modal-instalar-ios {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(5px);
    box-sizing: border-box;
}

.modal-instalar-ios-content {
    background: var(--panel);
    border-radius: 16px;
    width: 100%;
    max-width: 420px;
    padding: 30px 25px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease;
    box-sizing: border-box;
    position: relative;
    text-align: center;
}

.modal-instalar-ios-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--muted);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

    .modal-instalar-ios-close:hover {
        background: rgba(255, 255, 255, 0.2);
        color: var(--text);
    }

.modal-instalar-ios-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.modal-instalar-ios-title {
    margin: 0 0 20px 0;
    font-size: 20px;
    color: var(--text);
    font-weight: 700;
}

.modal-instalar-ios-steps {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 24px;
    text-align: left;
}

.modal-instalar-ios-step {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.04);
    padding: 12px 14px;
    border-radius: 10px;
    border-left: 3px solid var(--accent);
    font-size: 14px;
    color: var(--text);
    line-height: 1.4;
}

    .modal-instalar-ios-step .step-number {
        background: var(--accent);
        color: white;
        width: 24px;
        height: 24px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 13px;
        font-weight: 700;
        flex-shrink: 0;
    }

    .modal-instalar-ios-step .step-icon {
        font-size: 20px;
        margin-left: auto;
        flex-shrink: 0;
    }

    .modal-instalar-ios-step strong {
        color: var(--accent);
    }

.modal-instalar-ios-button {
    background: linear-gradient(135deg, var(--accent) 0%, #2b7fd4 100%);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    width: 100%;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

    .modal-instalar-ios-button:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(74, 163, 255, 0.4);
    }

/* ======================================== */
/* RESPONSIVE - TABLET */
/* ======================================== */
@media (max-width: 1024px) {
    .grid-2,
    .grid-que-es {
        grid-template-columns: 1fr;
    }

    html {
        scroll-padding-top: 90px;
    }

    section#que-es,
    section#prediccion {
        padding-top: 90px !important;
    }

    header {
        position: absolute;
        width: 100%;
        left: 0;
        box-sizing: border-box;
        padding: 15px;
    }

        header p {
            font-size: 1px;
            display: none;
        }

        header img {
            height: 35px;
        }

    .logo-title {
        font-size: 24px;
    }

    /* Selector de idioma compacto en tablet */
    .header-actions {
        gap: 10px;
    }

    .language-selector {
        gap: 6px;
        padding: 3px 6px;
        border-radius: 16px;
    }

    .lang-btn {
        font-size: 12px;
        padding: 4px 8px;
    }

    .lang-separator {
        font-size: 11px;
    }

    section {
        padding: 40px 15px;
    }

    .panel, .card {
        padding: 15px;
    }

    .menu-toggle {
        display: flex;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 100%;
        left: 0;
        background: #111;
        padding: 20px 0;
        box-shadow: 0 10px 20px rgba(0,0,0,0.5);
        border-top: 2px solid var(--accent);
        box-sizing: border-box;
    }

        .nav-links.active {
            display: flex;
        }

        .nav-links a {
            padding: 12px 20px;
            margin: 0;
            text-align: center;
            border-bottom: 1px solid #333;
            font-size: 14px;
        }

            .nav-links a:last-child {
                border-bottom: none;
            }

    .menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }

    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }
}

/* ======================================== */
/* RESPONSIVE - PREDICCIÓN TABLET */
/* ======================================== */
@media (max-width: 900px) {
    .prediccion-section {
        padding: 16px;
    }

    .prediccion-card {
        padding: 20px;
    }

    .prediccion-header-icon {
        font-size: 36px;
    }

    .prediccion-title {
        font-size: 20px;
    }
}


/* ======================================== */
/* RESPONSIVE - MÓVIL */
/* ======================================== */
@media (max-width: 768px) {
    .prediccion-info-grid {
        grid-template-columns: 1fr;
    }

    .mapa-modal {
        padding: 10px;
    }

    .mapa-modal-content {
        max-height: 95vh;
    }

    #google-map {
        height: 350px;
    }

    .mapa-coordenadas {
        flex-direction: column;
        gap: 10px;
    }

    .coordenadas-display,
    .btn-usar-coordenadas {
        width: 100%;
    }

    .mapa-modal-header h3 {
        font-size: 15px;
    }

    .mapa-modal-body {
        padding: 15px;
    }
}

/* ======================================== */
/* RESPONSIVE - MÓVIL PREDICCIÓN */
/* ======================================== */
@media (max-width: 600px) {
    .prediccion-section {
        padding: 12px;
    }

    .prediccion-card {
        padding: 16px;
        border-radius: 10px;
    }

    .prediccion-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 16px;
        padding-bottom: 12px;
    }

    .prediccion-header-icon {
        font-size: 30px;
    }

    .prediccion-title {
        font-size: 17px;
    }

    .prediccion-subtitle {
        font-size: 12px;
    }

    .prediccion-controls-v2 {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .control-group {
        padding: 12px;
    }

    .control-group-header {
        margin-bottom: 10px;
        padding-bottom: 8px;
    }

    .control-group-content {
        gap: 10px;
    }

    .control-field {
        gap: 4px;
    }

    .control-label {
        font-size: 11px;
    }

    .control-input {
        padding: 9px 10px;
        font-size: 13px;
    }

    .button-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .prediccion-btn {
        width: 100%;
        padding: 8px 8px;
        min-height: 22px;
        font-size: 12px;
    }

    .btn-collapse-all {
        width: 100%;
        padding: 8px 8px;
        min-height: 22px;
        font-size: 12px;
    }

    .prediccion-info-card {
        padding: 6px 8px;
        border-radius: 8px;
    }

        .prediccion-info-card h4 {
            margin: 0 0 6px 0;
            font-size: 14px;
        }

    .prediccion-stat {
        padding: 5px 0;
        gap: 8px;
    }

    .prediccion-stat-label {
        font-size: 12px;
        line-height: 1.3;
    }

    .prediccion-stat-value {
        font-size: 14px;
        line-height: 1.3;
    }

    .collapse-header {
        padding: 2px 0;
    }

    .collapse-icon {
        font-size: 10px;
    }

    .prediccion-info-card div[style*="margin-top"] {
        margin-top: 8px !important;
    }

    .prediccion-info-card div[style*="padding"] {
        padding: 6px !important;
    }

    .prediccion-tabla {
        font-size: 11px;
    }

        .prediccion-tabla th {
            padding: 8px 4px;
            font-size: 11px;
        }

        .prediccion-tabla td {
            padding: 6px 4px;
        }

    .nube-bar {
        width: 40px;
        height: 8px;
    }

    #prediccion-resultados {
        padding: 0;
    }

    #diagrama-temporal {
        margin-top: 16px !important;
        padding: 12px !important;
    }

    #card-condiciones-actuales,
    #card-prediccion-tabla {
        margin-top: 12px !important;
        padding: 12px !important;
    }

        #card-condiciones-actuales h4,
        #card-prediccion-tabla h4 {
            margin: 0 0 10px 0 !important;
            font-size: 14px !important;
        }

    .prediccion-info-grid {
        gap: 10px;
        margin-top: 12px;
    }

    .prediccion-info-card div[style*="font-size: 12px"],
    .prediccion-info-card div[style*="font-size: 13px"] {
        font-size: 11px !important;
    }

    /* Selector de idioma COMPACTO en móvil */
    .header-actions {
        gap: 6px;
    }

    .language-selector {
        gap: 2px;
        padding: 1px 3px;
        border-radius: 12px;
    }

    .lang-btn {
        font-size: 10px;
        padding: 2px 5px;
        border-radius: 8px;
    }

    .lang-separator {
        font-size: 9px;
    }

    /* Hamburguesa más pequeña */
    .menu-toggle {
        padding: 4px;
        gap: 3px;
    }

        .menu-toggle span {
            width: 18px;
            height: 2px;
        }

    /* Footer */
    .footer-content {
        flex-direction: column;
        gap: 12px;
    }

    .modal-instalar-ios-content {
        padding: 25px 20px;
    }

    .modal-instalar-ios-title {
        font-size: 18px;
    }

    .modal-instalar-ios-step {
        font-size: 13px;
        padding: 10px 12px;
    }

    /* Condiciones actuales */
    .condiciones-header-grid {
        gap: 8px;
    }

    .condiciones-header-item {
        margin-bottom: 6px;
    }

    .condiciones-label-sm {
        font-size: 8px;
    }

    .condiciones-value-md {
        font-size: 8px;
    }

    .condiciones-metricas-grid {
        gap: 8px;
        margin-top: 10px;
        padding-top: 10px;
        grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    }

    .metrica-label {
        font-size: 11px;
    }

    .metrica-valor {
        font-size: 18px;
    }

    .btn-collapse-all {
        width: 100%;
        justify-content: center;
    }
}

/* ======================================== */
/* RESPONSIVE - MÓVIL MUY PEQUEÑO */
/* ======================================== */
@media (max-width: 400px) {
    .mapa-modal {
        padding: 5px;
    }

    .mapa-modal-header {
        padding: 4px 14px;
    }

        .mapa-modal-header h3 {
            font-size: 14px;
        }

    .btn-cerrar-mapa {
        width: 32px;
        height: 32px;
        min-width: 32px;
        font-size: 24px;
    }

    #google-map {
        height: 280px;
    }

    .mapa-modal-body {
        padding: 12px;
    }

    .button-row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }

}

@media (max-width: 380px) {
    .prediccion-title {
        font-size: 15px;
    }

    .control-group-title {
        font-size: 11px;
    }

    .control-input {
        font-size: 12px;
        padding: 8px 9px;
    }

    .prediccion-info-card {
        padding: 2px 4px;
    }

        .prediccion-info-card h4 {
            font-size: 13px;
            margin: 0 0 4px 0;
        }

    .prediccion-stat {
        padding: 4px 0;
    }

    .prediccion-stat-label {
        font-size: 11px;
    }

    .prediccion-stat-value {
        font-size: 13px;
    }

    .prediccion-tabla {
        font-size: 10px;
    }

        .prediccion-tabla th,
        .prediccion-tabla td {
            padding: 5px 3px;
        }

    .nube-bar {
        width: 32px;
    }

    /* Selector de idioma ULTRA COMPACTO */
    .header-actions {
        gap: 4px;
    }

    .language-selector {
        gap: 1px;
        padding: 1px 2px;
    }

    .lang-btn {
        font-size: 9px;
        padding: 2px 4px;
    }

    .lang-separator {
        font-size: 8px;
    }

    .menu-toggle span {
        width: 16px;
    }

    .condiciones-metricas-grid {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        gap: 6px;
    }

    .metrica-label {
        font-size: 10px;
    }

    .metrica-valor {
        font-size: 16px;
    }
}

/* ======================================== */
/* PICKER DE OBJETOS CELESTES */
/* ======================================== */
.btn-picker-objeto {
    background: rgba(138, 43, 226, 0.15);
    border: 1px solid rgba(138, 43, 226, 0.4);
    color: #b84dff;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
}

    .btn-picker-objeto:hover {
        background: rgba(138, 43, 226, 0.3);
        border-color: #b84dff;
        transform: scale(1.05);
    }

    .btn-picker-objeto:active {
        transform: scale(0.95);
    }

.picker-objeto-dropdown {
    background: var(--panel);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    z-index: 10002 !important;
    min-width: 260px;
    max-width: 320px;
    max-height: 400px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: pickerFadeIn 0.15s ease;
}

@keyframes pickerFadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.picker-objeto-header {
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(74, 163, 255, 0.05);
}

.picker-objeto-lista {
    overflow-y: auto;
    flex: 1;
}

.picker-objeto-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.15s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

    .picker-objeto-item:last-child {
        border-bottom: none;
    }

    .picker-objeto-item:hover {
        background: rgba(138, 43, 226, 0.15);
    }

    .picker-objeto-item.activo {
        background: rgba(138, 43, 226, 0.2);
    }

.picker-objeto-icono {
    font-size: 20px;
    flex-shrink: 0;
    width: 28px;
    text-align: center;
}

.picker-objeto-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.picker-objeto-nombre {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.picker-objeto-tipo {
    font-size: 10px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.picker-objeto-check {
    color: #4caf50;
    font-weight: bold;
    font-size: 14px;
    flex-shrink: 0;
}

/* Responsive */
@media (max-width: 480px) {
    .picker-objeto-dropdown {
        min-width: 220px;
        max-width: 280px;
    }

    .picker-objeto-item {
        padding: 8px 12px;
    }

    .picker-objeto-nombre {
        font-size: 12px;
    }
}


/* ======================================== */
/* PICKER DE MODELO METEOROLÓGICO */
/* ======================================== */
.btn-picker-modelo {
    background: rgba(74, 163, 255, 0.15);
    border: 1px solid rgba(74, 163, 255, 0.4);
    color: var(--accent);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
}

    .btn-picker-modelo:hover {
        background: rgba(74, 163, 255, 0.3);
        border-color: var(--accent);
        transform: scale(1.05);
    }

    .btn-picker-modelo:active {
        transform: scale(0.95);
    }

/* Select oculto para sincronización */
.control-input-hidden {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

/* Dropdown del picker (ya existente) */
.picker-modelo-dropdown {
    background: var(--panel);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    z-index: 10002 !important;
    min-width: 280px;
    max-width: 340px;
    max-height: 400px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: pickerFadeIn 0.15s ease;
}

@keyframes pickerFadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.picker-modelo-header {
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(74, 163, 255, 0.05);
}

.picker-modelo-lista {
    overflow-y: auto;
    flex: 1;
}

.picker-modelo-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.15s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

    .picker-modelo-item:last-child {
        border-bottom: none;
    }

    .picker-modelo-item:hover {
        background: rgba(74, 163, 255, 0.15);
    }

    .picker-modelo-item.activo {
        background: rgba(74, 163, 255, 0.2);
    }

.picker-modelo-icono {
    font-size: 16px;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

.picker-modelo-info {
    flex: 1;
    min-width: 0;
}

.picker-modelo-nombre {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.picker-modelo-check {
    color: #4caf50;
    font-weight: bold;
    font-size: 14px;
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .picker-modelo-dropdown {
        min-width: 240px;
        max-width: 300px;
    }

    .picker-modelo-item {
        padding: 8px 12px;
    }

    .picker-modelo-nombre {
        font-size: 11px;
    }
}

/* ======================================== */
/* SLIDER FOV - ALINEACIÓN CORRECTA */
/* ======================================== */
.fov-slider-wrapper {
    position: relative;
    /* El padding compensa la mitad del ancho del thumb del slider (16px / 2 = 8px) */
    padding: 0 8px;
}

    .fov-slider-wrapper input[type="range"] {
        display: block;
        width: 100%;
        margin: 0;
    }

.fov-etiquetas-container {
    position: relative;
    height: 16px;
    margin-top: 2px;
    user-select: none;
    pointer-events: none;
}

.fov-etiqueta {
    position: absolute;
    transform: translateX(-50%);
    font-size: 9px;
    white-space: nowrap;
    transition: opacity 0.2s ease, color 0.2s ease;
}

/* En pantallas medianas, ocultar etiquetas intermedias */
@media (max-width: 480px) {
    .fov-etiqueta {
        font-size: 7px !important;
    }

        .fov-etiqueta[data-min-ancho="280"] {
            display: none !important;
        }
}

/* En pantallas muy pequeñas, mostrar solo las principales */
@media (max-width: 360px) {
    .fov-etiqueta[data-min-ancho="280"] {
        display: none !important;
    }
}

/* =============================================
   🖐️ GESTOS TÁCTILES - CONTENEDOR BASE
   ============================================= */
#diagrama-horizonte-container {
    touch-action: none !important;
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    user-select: none !important;
    -webkit-tap-highlight-color: transparent !important;
    overflow: hidden;
    position: relative;
}

    /* 🆕 Asegurar que el SVG también bloquee gestos nativos */
    #diagrama-horizonte-container svg {
        touch-action: none !important;
        -webkit-touch-callout: none !important;
        -webkit-user-select: none !important;
        user-select: none !important;
        display: block;
        pointer-events: none;
    }

    /* ========================================
   📱 MODO PANTALLA COMPLETA ADAPTATIVO
   ======================================== */

    /* Contenedor principal en pantalla completa */
    #diagrama-horizonte-container.pantalla-completa {
        display: flex;
        width: 100vw;
        height: 100vh;
        overflow: hidden;
        background: #000;
    }

        /* ========================================
   MODO HORIZONTAL (landscape)
   ======================================== */
        #diagrama-horizonte-container.pantalla-completa.modo-horizontal {
            flex-direction: row;
        }

            #diagrama-horizonte-container.pantalla-completa.modo-horizontal #diagrama-horizonte-svg {
                flex: 1;
                height: 100%;
                width: 70%;
            }

            #diagrama-horizonte-container.pantalla-completa.modo-horizontal #panel-info-lateral {
                width: 30%;
                height: 100%;
                overflow-y: auto;
                background: rgba(10, 10, 20, 0.95);
                border-left: 1px solid rgba(255, 255, 255, 0.1);
            }

        /* ========================================
   MODO VERTICAL (portrait)
   ======================================== */
        #diagrama-horizonte-container.pantalla-completa.modo-vertical {
            flex-direction: column;
        }

            #diagrama-horizonte-container.pantalla-completa.modo-vertical #diagrama-horizonte-svg {
                flex: 1;
                width: 100%;
                height: 70%;
            }

            #diagrama-horizonte-container.pantalla-completa.modo-vertical #panel-info-lateral {
                width: 100%;
                height: 30%;
                overflow-y: auto;
                background: rgba(10, 10, 20, 0.95);
                border-top: 1px solid rgba(255, 255, 255, 0.1);
            }

/* =============================================
   📊 PANEL LATERAL IZQUIERDO (CONDENSADO)
   ============================================= */
#panel-info-lateral {
    width: 320px;
    min-width: 280px;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-right: 2px solid rgba(74, 163, 255, 0.3);
    padding: 0;
    box-sizing: border-box;
    flex-shrink: 0;
    overflow: hidden;
    color: white;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
}

.panel-scroll-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 0;
}

/* =============================================
   📋 FILAS DE INFORMACIÓN
   ============================================= */
.panel-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    border-left: 3px solid #4aa3ff;
    gap: 6px;
    min-width: 0;
}

    .panel-info-row .panel-info-label {
        font-size: 11px;
        color: rgba(255, 255, 255, 0.7);
        letter-spacing: 0.2px;
        flex-shrink: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .panel-info-row .panel-info-value {
        font-size: 11px;
        font-weight: bold;
        color: white;
        text-align: right;
        flex-shrink: 0;
        white-space: nowrap;
    }

    /* Variante destacada (objeto celeste) */
    .panel-info-row.destacado {
        border-left-color: #b84dff;
        background: rgba(138, 43, 226, 0.1);
    }

        .panel-info-row.destacado .panel-info-value {
            color: #b84dff;
        }

    /* Variante luna */
    .panel-info-row.luna {
        border-left-color: #ffc107;
        background: rgba(255, 193, 7, 0.08);
    }

        .panel-info-row.luna .panel-info-value {
            color: #ffc107;
        }

/* =============================================
   🎚️ CONTROLES (sliders condensados)
   ============================================= */
.panel-control-row {
    margin-bottom: 0px;
}

.panel-control-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0px;
}

.panel-slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 2px;
    font-size: 9px;
    color: rgba(255, 255, 255, 0.5);
}

/* =============================================
   📸 FOOTER DEL PANEL (LOGO)
   ============================================= */
.panel-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 6px 8px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(74, 163, 255, 0.2);
    flex-shrink: 0;
}

.panel-logo {
    display: flex;
    align-items: center;
    gap: 6px;
}

.panel-logo-img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    flex-shrink: 0;
}

.panel-logo-text {
    font-size: 10px;
    font-weight: bold;
    color: #4aa3ff;
    letter-spacing: 0.5px;
    white-space: nowrap;
}


/* =============================================
   📐 DIAGRAMA SVG EN PANTALLA COMPLETA
   ============================================= */
#diagrama-horizonte-container.pantalla-completa svg {
    flex: 1;
    width: auto;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

#diagrama-horizonte-container.pantalla-completa .horizonte-controles {
    display: none !important;
}

/* =============================================
   🖱️ CURSORES
   ============================================= */
#diagrama-horizonte-container {
    cursor: grab;
}

    #diagrama-horizonte-container:active {
        cursor: grabbing;
    }

    #diagrama-horizonte-container.pantalla-completa {
        cursor: default;
    }


/* =============================================
   📍 MARCADOR DE CACHÉ (azul)
   ============================================= */
.custom-cache-marker {
    background: transparent !important;
    border: none !important;
}

.icono-cache-marker {
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, #4aa3ff 0%, #2b7fd4 100%);
    border: 2px solid white;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

    .icono-cache-marker .emoji {
        transform: rotate(45deg);
        font-size: 11px;
    }

    /* =============================================
   🔴 ICONO ROJO (POIs con altura y diámetro)
   ============================================= */
    .icono-cache-marker.icono-rojo {
        background: linear-gradient(135deg, #ff6b6b 0%, #d42b2b 100%);
        border-color: #ffd4d4;
        box-shadow: 0 2px 6px rgba(220, 53, 69, 0.5);
    }

/* =============================================
   📍 MARCADOR DE FOTOS (naranja) - ya existe, pero aseguramos
   ============================================= */
.custom-foto-marker {
    background: transparent !important;
    border: none !important;
}

.icono-foto-marker {
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    border: 2px solid white;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

    .icono-foto-marker .emoji {
        transform: rotate(45deg);
        font-size: 11px;
    }

/* =============================================
   📋 POPUP DE CACHÉ (con mejor contraste)
   ============================================= */
.popup-cache-contenido {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 12px;
    color: #1a1a1a;
    min-width: 280px;
    padding: 2px;
}

.popup-cache-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 2px solid #4aa3ff;
}

.popup-cache-icono {
    font-size: 22px;
    flex-shrink: 0;
    line-height: 1;
}

.popup-cache-header-texto {
    flex: 1;
    min-width: 0;
}

/* 🆕 Nombre destacado */
.popup-cache-nombre {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.popup-cache-subtitulo {
    font-size: 10px;
    color: #888;
    font-style: italic;
    margin-top: 2px;
}

.popup-cache-fila {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    gap: 10px;
}

/* 🆕 Etiquetas más oscuras y legibles */
.popup-cache-label {
    font-weight: 600;
    color: #333;
    flex-shrink: 0;
    font-size: 12px;
}

/* 🆕 Valores más oscuros para mejor contraste */
.popup-cache-valor {
    text-align: right;
    color: #1a1a1a;
    /*font-family: 'Courier New', monospace;*/
    font-size: 11px;
    font-weight: 500;
    word-break: break-word;
}

.popup-cache-separador {
    border: none;
    border-top: 1px dashed #ccc;
    margin: 10px 0;
}

.popup-cache .leaflet-popup-content-wrapper {
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    background: #ffffff;
}

.popup-cache .leaflet-popup-tip {
    background: #ffffff;
}

.popup-cache .leaflet-popup-content {
    margin: 12px 14px;
}

/* 🆕 Mejorar el botón "Usar coordenadas" */
.popup-cache .popup-foto-btn-usar {
    width: 100%;
    margin-top: 12px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #4aa3ff 0%, #2b7fd4 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(74, 163, 255, 0.3);
}

    .popup-cache .popup-foto-btn-usar:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 10px rgba(74, 163, 255, 0.4);
        filter: brightness(1.1);
    }

/* =============================================
   🎛️ BOTONES DE ACCIÓN EN POPUP DE CACHÉ
   ============================================= */
.popup-cache-nombre-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.popup-cache-action-btn {
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .popup-cache-action-btn:hover {
        background: rgba(0, 0, 0, 0.08);
        border-color: rgba(0, 0, 0, 0.1);
        transform: scale(1.1);
    }

.btn-editar:hover {
    color: #4aa3ff;
}

.btn-favorito:hover {
    color: #ffc107;
}

.btn-borrar:hover {
    color: #f44336;
    background: rgba(244, 67, 54, 0.1);
}

/* =============================================
   📤 BOTÓN COMPARTIR (SVG)
   ============================================= */
.btn-compartir {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
}

    .btn-compartir svg {
        width: 14px;
        height: 14px;
        stroke: currentColor;
        transition: all 0.2s ease;
    }

    .btn-compartir:hover {
        color: #2196f3;
        background: rgba(33, 150, 243, 0.1);
    }

        .btn-compartir:hover svg {
            transform: scale(1.1);
        }

/* =============================================
   📱 FOOTER RESPONSIVE - Botones en pantallas pequeñas
   ============================================= */
@media (max-width: 600px) {
    .footer-content {
        flex-direction: column;
        gap: 6px;
        padding: 8px 10px;
    }

    .install-btn {
        font-size: 11px;
        padding: 6px 10px;
        min-height: auto;
    }

    .install-btn-text {
        font-size: 11px;
    }

    .footer-copyright {
        font-size: 10px;
    }
}

/* Para pantallas muy pequeñas (móviles en vertical) */
@media (max-width: 400px) {
    .install-btn {
        font-size: 10px;
        padding: 5px 8px;
    }

    .install-btn-text {
        font-size: 10px;
    }
}

.btn-editar-medidas:hover {
    color: #4aa3ff;
    background: rgba(74, 163, 255, 0.1);
}

/* =============================================
   🎯 MARCADOR DE PRECISIÓN (CROSSHAIR)
   ============================================= */
.custom-precision-marker {
    background: transparent !important;
    border: none !important;
}

.crosshair-marker {
    position: relative;
    width: 40px;
    height: 40px;
}

/* Círculo exterior */
.crosshair-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    transform: translate(-50%, -50%);
    border: 2px solid #ff4444;
    border-radius: 50%;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
}

/* Punto central */
.crosshair-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 4px;
    transform: translate(-50%, -50%);
    background: #ff4444;
    border-radius: 50%;
    box-shadow: 0 0 3px rgba(255, 68, 68, 0.8);
}

/* Línea horizontal */
.crosshair-line.crosshair-h {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background: rgba(255, 68, 68, 0.6);
    transform: translateY(-50%);
}

/* Línea vertical */
.crosshair-line.crosshair-v {
    position: absolute;
    top: 0;
    left: 50%;
    width: 1px;
    height: 100%;
    background: rgba(255, 68, 68, 0.6);
    transform: translateX(-50%);
}