/* Estilos Globales */
:root {
    --verde-hierba: #2d5a27;
    --tierra: #5d4037;
    --crema: #f8f5f0;
    --verde-suave: #f8faf8;
    --tierra-oscura: #3d3d3d;
}
body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--crema);
    color: #333;
}

/* Navbar Styles */
.navbar {
    background-color: white !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.navbar-brand {
    font-family: 'Playfair Display', serif;
    font-weight: bold;
    color: var(--verde-hierba) !important;
    font-size: 1.5rem;
}
.nav-link {
    color: var(--tierra) !important;
    font-weight: 500;
}
/* Evita que los enlaces del menú se partan en dos líneas */
.navbar-nav .nav-link {
    white-space: nowrap; 
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
}

/* Ajuste fino para pantallas medianas (laptops) para que quepa todo */
@media (min-width: 992px) and (max-width: 1200px) {
    .navbar-nav .nav-link {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
        font-size: 0.9rem; /* Achicamos un pelín la letra solo si el espacio es crítico */
    }
}

/* =========================================
   Efecto Hover Navbar (Estilo "Raíz Orgánica")
   ========================================= */
/* Posicionamiento relativo para anclar el pseudo-elemento */
.navbar-nav .nav-item .nav-link:not(.btn) {
    position: relative;
    transition: color 0.3s ease-in-out;
}
/* Creamos la línea invisible justo debajo del texto */
.navbar-nav .nav-item .nav-link:not(.btn)::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 5px; /* Ajusta si lo quieres más pegado o separado del texto */
    left: 50%;
    background-color: var(--verde-hierba, #2d5a27);
    transition: width 0.3s ease-in-out, left 0.3s ease-in-out;
    border-radius: 2px;
}
/* Al pasar el ratón, la línea crece desde el centro */
.navbar-nav .nav-item .nav-link:not(.btn):hover::after {
    width: 80%; /* No ocupa el 100% para que quede más elegante */
    left: 10%;
}
/* El texto se tiñe ligeramente del color corporativo */
.navbar-nav .nav-item .nav-link:not(.btn):hover {
    color: var(--verde-hierba, #2d5a27) !important;
}

/* =========================================
   Estilos Dropdown de Idiomas
   ========================================= */
/* Damos un poco de margen interno para que el hover no toque los bordes del menú */
.navbar-nav .dropdown-menu .dropdown-item {
    padding: 0.5rem 1rem;
    margin: 0.2rem 0.4rem;
    width: calc(100% - 0.8rem);
    border-radius: 8px;
    transition: all 0.2s ease-in-out;
    color: var(--tierra-oscura, #333);
}
/* 1. Efecto Hover: Fondo verde suave, texto corporativo y ligero movimiento */
.navbar-nav .dropdown-menu .dropdown-item:hover,
.navbar-nav .dropdown-menu .dropdown-item:focus {
    background-color: #e9f5e8; /* Un verde súper clarito (el mismo de tus tip-box) */
    color: var(--verde-hierba, #2d5a27);
    transform: translateX(4px); /* Pequeño salto hacia la derecha */
}
/* 2. Estado Activo (Idioma actual): Fondo verde corporativo y texto blanco */
.navbar-nav .dropdown-menu .dropdown-item.active,
.navbar-nav .dropdown-menu .dropdown-item:active {
    background-color: var(--verde-hierba, #2d5a27);
    color: white;
    transform: none; /* Quitamos el salto si ya está seleccionado */
}
/* Adaptamos el color de la "píldora" (ES/EUS) cuando el idioma está activo para que se lea bien */
.navbar-nav .dropdown-menu .dropdown-item.active .badge {
    background-color: rgba(255, 255, 255, 0.2) !important;
    color: white !important;
}

/* --- Ajustes de Idioma para Mobile --- */
@media (max-width: 991.98px) {
    /* Quitamos la flechita y el estilo de menú desplegable en móvil */
    .dropdown-toggle::after {
        display: none !important;
    }
    .nav-item.dropdown {
        border: 0 !important;
    }
    /* Convertimos la lista de idiomas en una fila horizontal */
    .nav-item.dropdown .dropdown-menu {
        display: flex !important;
        flex-direction: row;
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 0;
        margin-top: 10px;
        justify-content: center;
        gap: 10px;
    }
    /* Estilo de los botones de idioma en la fila móvil */
    .nav-item.dropdown .dropdown-item {
        border-radius: 50px !important;
        background: #f8faf8;
        border: 1px solid rgba(0,0,0,0.05);
        padding: 8px 20px !important;
        width: auto;
    }
    .nav-item.dropdown .dropdown-item.active {
        background-color: #2d5a27 !important;
        color: white !important;
    }
    /* Ocultamos el texto "Castellano/Euskara" largo y dejamos solo el código para que quepa */
    .nav-item.dropdown .dropdown-item span:first-child {
        display: none;
    }
    .nav-item.dropdown .dropdown-item .badge {
        margin: 0 !important;
        background: transparent !important;
        color: inherit !important;
        font-size: 0.9rem;
        font-weight: bold;
    }
}

/* --- ICONO HAMBURGUESA ANIMADO --- */
/* Contenedor del botón personalizado */
.navbar-toggler {
    width: 45px;
    height: 45px;
    position: relative;
    transition: .5s ease-in-out;
    cursor: pointer;
    border: none !important;
    box-shadow: none !important;
    padding: 0;
}
/* Las 3 líneas del icono */
.navbar-toggler .toggler-icon {
    display: block;
    position: absolute;
    height: 3px;
    width: 30px;
    background: #2d5a27; /* Verde Baratze */
    border-radius: 9px;
    opacity: 1;
    left: 7px;
    transform: rotate(0deg);
    transition: .25s ease-in-out;
}
/* Posición inicial de las líneas */
.navbar-toggler .toggler-icon:nth-child(1) { top: 12px; }
.navbar-toggler .toggler-icon:nth-child(2) { top: 21px; }
.navbar-toggler .toggler-icon:nth-child(3) { top: 30px; }
/* ANIMACIÓN: Cuando el menú está abierto (clase .collapsed NO presente) */
.navbar-toggler:not(.collapsed) .toggler-icon:nth-child(1) {
    top: 21px;
    transform: rotate(135deg);
}
.navbar-toggler:not(.collapsed) .toggler-icon:nth-child(2) {
    opacity: 0;
    left: -40px;
}
.navbar-toggler:not(.collapsed) .toggler-icon:nth-child(3) {
    top: 21px;
    transform: rotate(-135deg);
}
/* Efecto hover sutil */
.navbar-toggler:hover .toggler-icon {
    background: #198754;
}

/* Hero Styles */
.hero-section {
    background: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.3)), url('https://images.unsplash.com/photo-1523348837708-15d4a09cfac2?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80');
    background-size: cover;
    background-position: center;
    color: white;
    padding: 120px 0;
    border-bottom: 5px solid var(--verde-hierba);
}
.hero-title {
    font-family: 'Playfair Display', serif;
    color: white;
    text-shadow: 2px 4px 8px rgba(0, 0, 0, 0.6);
}
.headerDecoration {
    background: linear-gradient(rgba(45, 90, 39, 0.8), rgba(0, 0, 0, 0.7)), url('../img/cabecera.jpg'); 
    background-size: cover; 
    background-position: center; 
    min-height: 40vh; 
    display: flex; 
    align-items: center;
}

/* Elements */
.btn-search {
    background-color: var(--verde-hierba);
    color: white;
    border: none;
    padding: 12px 30px;
    font-weight: bold;
}
.btn-search:hover { background-color: #1e3d1a; color: white; }
/* =========================================
   Botones Baratze Unificados
   ========================================= */

/* Base compartida para la animación */
.btn-baratze, 
.btn-outline-baratze {
    transition: all 0.3s ease-in-out;
    border: 2px solid var(--verde-hierba, #2d5a27);
}

/* Efecto Hover compartido (suben a la vez y con la misma sombra) */
.btn-baratze:hover, 
.btn-outline-baratze:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(45, 90, 39, 0.2) !important;
}
.btn-baratze {
    background-color: var(--verde-hierba, #2d5a27);
    color: white;
}
.btn-baratze:hover {
    background-color: #1e3d1a;
    border-color: #1e3d1a;
    color: white;
}
.btn-outline-baratze {
    background-color: white;
    color: var(--verde-hierba, #2d5a27);
}
.btn-outline-baratze:hover {
    background-color: var(--verde-hierba, #2d5a27);
    color: white;
}
.info-card {
    background: white;
    border-left: 5px solid var(--verde-hierba);
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

/* Tarjetas de Resultados */
.header-result { background-color: #2d5a27; color: white; padding: 50px 0; margin-bottom: 40px; }
.card-planta { 
    border: none; 
    border-radius: 15px; 
    overflow: hidden; 
    transition: transform 0.3s; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.card-planta:hover { transform: translateY(-5px); }
.img-planta { height: 200px; object-fit: cover; width: 100%; }
.cientifico { font-style: italic; color: #6c757d; font-size: 0.9rem; }
.badge-accion { position: absolute; top: 15px; right: 15px; background-color: rgba(45, 90, 39, 0.9); }
.tip-box { background-color: #e9f5e8; border-left: 4px solid #2d5a27; padding: 15px; border-radius: 5px; }

footer {
    background-color: var(--tierra);
    color: white;
    padding: 40px 0;
    margin-top: 50px;
}

/* Capa de carga que bloquea la pantalla */
#loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: none; /* Oculto por defecto */
    justify-content: center;
    align-items: center;
    z-index: 9999;
    flex-direction: column;
}

/* Efecto de enfoque en los campos */
.form-control:focus { border-color: #2d5a27; box-shadow: 0 0 0 0.25rem rgba(45, 90, 39, 0.15); }
.form-check-input:checked { background-color: #2d5a27; border-color: #2d5a27; }
.transition-hover:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important; }

/* Resultados */
.card-planta { transition: transform 0.2s, box-shadow 0.2s; }
.card-planta:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.1) !important; }
.pagination .page-link { color: #198754; border-radius: 5px; margin: 0 2px; }
.pagination .active .page-link { background-color: #198754; border-color: #198754; color: white; }

/* Detalles */
.detalle-titulo {
    font-family: 'Playfair Display', serif;
    color: var(--verde-hierba);
    font-weight: 800;
    letter-spacing: -1px;
}
.detalle-cientifico {
    font-family: 'Montserrat', sans-serif;
    color: #888;
    font-size: 0.85rem;
}
/* Info Boxes con Micro-interacciones */
.info-box {
    background: var(--verde-suave);
    border-radius: 16px;
    border: 1px solid transparent;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    height: 100%;
}
.info-box:hover {
    background: white;
    border-color: var(--verde-hierba);
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}
/* Tarjeta Luna con gradiente nocturno */
.card-luna {
    background: linear-gradient(135deg, #2c3e50 0%, #000000 100%) !important;
    border: none;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
}
.card-luna::after {
    content: '';
    position: absolute;
    top: -20px; right: -20px;
    width: 100px; height: 100px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
}
/* Blockquote de sabiduría tradicional */
.tip-mayores {
    background-color: #fdfcf9;
    border-radius: 20px;
    border: 1px dashed #d1d1d1;
    position: relative;
}
.quote-icon {
    position: absolute;
    top: -15px;
    left: 30px;
    background: var(--verde-hierba);
    color: white;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* Guia */
.info-card {
    border-radius: 1.5rem;
    border: 1px solid rgba(0,0,0,0.05);
}
.text-light-50 {
    color: rgba(255, 255, 255, 0.7) !important;
}
/* Ajuste para que la imagen ocupe todo el alto en escritorio */
@media (min-width: 768px) {
    .col-md-4 div {
        /*height: 100% !important;*/
    }
}

/* Loading */
.spinner-baratze {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #2d5a27;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.loading-text {
    margin-top: 15px;
    color: #2d5a27;
    font-weight: bold;
    font-family: 'Lora', serif;
}

/* Control seguro de los formularios para que no se rompan en Desktop */
.form-capsula {
    border-radius: 50px;
}
.btn-capsula {
    border-radius: 50px;
    width: auto; /* En ordenador el botón ocupa solo lo necesario */
}

@media (max-width: 767.98px) {
    .form-capsula {
        border-radius: 20px; /* En móvil pierde la forma de píldora */
    }
    .btn-capsula {
        width: 100%; /* En móvil el botón ocupa todo el ancho para ser fácil de tocar */
    }
}

/* --- SKELETON LOADERS --- */
/* Clima y calendario */
/* Animación del brillo */
@keyframes shimmer {
    0% { background-position: -468px 0; }
    100% { background-position: 468px 0; }
}
.skeleton {
    background: #f6f7f8;
    background-image: linear-gradient(to right, #f6f7f8 0%, #edeef1 20%, #f6f7f8 40%, #f6f7f8 100%);
    background-repeat: no-repeat;
    background-size: 800px 104px; 
    display: inline-block;
    position: relative;
    animation: shimmer 1.5s infinite linear;
    border-radius: 4px;
}
/* Formas para el esqueleto */
.skeleton-text { height: 12px; width: 100%; margin-bottom: 8px; }
.skeleton-title { height: 20px; width: 60%; margin-bottom: 12px; }
.skeleton-circle { height: 50px; width: 50px; border-radius: 50%; }
/* Formas específicas para la tabla */
.sk-avatar { height: 30px; width: 30px; border-radius: 50%; }
.sk-text-main { height: 14px; width: 80px; margin-bottom: 4px; }
.sk-text-sub { height: 10px; width: 50px; }
.sk-action { height: 18px; width: 100%; border-radius: 10px; opacity: 0.5; }

/* La base del esqueleto: color gris claro y el degradado animado */
.skeleton {
    background: #eee;
    background: linear-gradient(110deg, #ececec 8%, #f5f5f5 18%, #ececec 33%);
    border-radius: 8px;
    background-size: 200% 100%;
    animation: 1.5s shine linear infinite;
}
/* Animación del brillo */
@keyframes shine {
    to {
        background-position-x: -200%;
    }
}
/* Formas específicas para tu diseño */
.sk-title {
    width: 60%;
    height: 2rem;
    margin-bottom: 1rem;
}
.sk-text {
    width: 100%;
    height: 1rem;
    margin-bottom: 0.5rem;
}
.sk-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%; /* Icono circular */
    margin: 0 auto;
}
/* Variaciones de tamaño para que parezca contenido real */
.sk-w-70 { width: 70%; }
.sk-w-40 { width: 40%; }