/* Paleta "bosque y montaña": verdes de bosque, azules de lago y ámbar de flores silvestres.
   Todos los colores de marca del sitio salen de aquí. Las variantes -rgb sirven para
   transparencias: rgba(var(--color-primary-rgb), 0.2) */
:root {
    --color-primary: #2f6f4e;        /* Verde bosque: botones, acentos y destacados */
    --color-primary-rgb: 47, 111, 78;
    --color-primary-soft: #9fcfb2;   /* Verde menta: fondos, halos y placeholders */
    --color-secondary: #3a7a9c;      /* Azul de lago de montaña */
    --color-secondary-rgb: 58, 122, 156;
    --color-secondary-soft: #a9d0e4; /* Azul cielo */
    --color-accent: #c4782a;         /* Ámbar de flores silvestres: solo íconos y detalles */
    --color-accent-rgb: 196, 120, 42;
    --color-accent-soft: #f2cf98;    /* Luz de atardecer */
    --color-deep: #25506a;           /* Azul profundo de montaña */
    --color-surface: #ecf4ef;        /* Fondo suave para chips y paneles */
    --color-cream: #f8f5ee;          /* Fondo crema del sitio web (prediseño Happy Soul) */
    --color-sage: #e4eadb;           /* Paneles salvia del sitio web */
    --gradient-brand: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    --bg-page: linear-gradient(160deg, #eef5ef 0%, #e4efee 50%, #dde9f1 100%); /* Neblina de valle */
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(255, 255, 255, 1);
    --text-dark: #1e3a2f;            /* Verde pino profundo en lugar de negro */
    --text-dark-rgb: 30, 58, 47;
    --text-muted: #4a6559;           /* Verde salvia oscuro para textos secundarios */
    --text-muted-rgb: 74, 101, 89;
    --text-light: #ffffff;
    --font-title: 'Playfair Display', serif;
    --font-body: 'Outfit', sans-serif;
    --font-script: 'Caveat', cursive;   /* Frases manuscritas: lema, citas */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background: var(--bg-page);
    background-attachment: fixed;
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    padding: 2rem 1rem;
}

/* Fondo animado */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: move 20s infinite alternate;
}

/* Bosque arriba a la izquierda, cielo abajo a la derecha y un resplandor de atardecer al centro */
.c1 { width: 800px; height: 800px; background: radial-gradient(circle, var(--color-primary-soft) 0%, transparent 70%); top: -200px; left: -200px; opacity: 0.7; }
.c2 { width: 900px; height: 900px; background: radial-gradient(circle, var(--color-secondary-soft) 0%, transparent 70%); bottom: -300px; right: -300px; animation-delay: -5s; opacity: 0.7; }
.c3 { width: 600px; height: 600px; background: radial-gradient(circle, var(--color-accent-soft) 0%, transparent 70%); top: 20%; left: 40%; animation-delay: -10s; opacity: 0.45; }

/* Destellos de luz */
.background-animation::after {
    content: '✦';
    position: absolute;
    top: 20%; left: 10%;
    color: white;
    font-size: 20px;
    text-shadow: 0 0 10px rgba(255,255,255,0.8);
    animation: sparkle 3s infinite;
}

.background-animation::before {
    content: '✦';
    position: absolute;
    bottom: 30%; right: 15%;
    color: white;
    font-size: 15px;
    text-shadow: 0 0 10px rgba(255,255,255,0.8);
    animation: sparkle 4s infinite reverse;
}

@keyframes sparkle {
    0%, 100% { opacity: 0.2; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

@keyframes move {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(50px, 50px) scale(1.1); }
}

/* Contenedor principal */
.container {
    width: 100%;
    max-width: 450px;
    text-align: center;
    z-index: 1;
}

/* Perfil */
.profile {
    margin-bottom: 2.5rem;
    animation: fadeInDown 1s ease-out;
}

.avatar-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 1.5rem;
}

.avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
    box-shadow: 0 10px 30px rgba(var(--text-dark-rgb), 0.1);
    position: relative;
    z-index: 2;
}

.halo {
    position: absolute;
    top: -15px;
    left: -15px;
    right: -15px;
    bottom: -15px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--color-accent-soft) 0%, var(--color-primary-soft) 50%, transparent 70%);
    animation: pulse 4s infinite ease-in-out;
    z-index: 1;
    opacity: 0.4;
}

.title {
    font-family: var(--font-title);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.bio {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.6;
    padding: 0 1rem;
}

/* Enlaces */
.links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 3rem;
}

.link-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid transparent;
    background-clip: padding-box;
    padding: 1rem 1.5rem;
    border-radius: 30px;
    text-decoration: none;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: var(--transition);
    animation: fadeInUp 0.8s ease-out both;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(var(--text-dark-rgb), 0.05);
}

.link-group {
    width: 100%;
}

.has-submenu {
    width: 100%;
    cursor: pointer;
    border: none;
    font-family: inherit;
    text-align: left;
}

.has-submenu small {
    display: block;
    font-size: 0.8rem;
    font-weight: 400;
    opacity: 0.7;
    color: var(--color-primary);
}

.chevron {
    margin-left: auto;
    transition: var(--transition);
}

.link-group.active .chevron {
    transform: rotate(180deg);
}

.submenu {
    max-height: 0;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0 1rem;
}

.link-group.active .submenu {
    max-height: 500px;
    padding: 1rem;
}

.sub-link {
    background: rgba(255, 255, 255, 0.6);
    padding: 1rem 1.5rem;
    border-radius: 20px;
    text-decoration: none;
    color: var(--text-dark);
    font-size: 0.95rem;
    font-weight: 600;
    transition: var(--transition);
    border: 1px solid rgba(255,255,255,0.5);
}

.sub-link:hover {
    background: white;
    transform: translateX(5px);
    border-color: var(--color-primary);
}

/* Borde de gradiente */
.link-card::after {
    content: '';
    position: absolute;
    top: -2px; left: -2px; right: -2px; bottom: -2px;
    background: linear-gradient(45deg, var(--color-primary-soft), var(--color-secondary-soft), var(--color-accent-soft));
    border-radius: 32px;
    z-index: -1;
    opacity: 0.5;
    transition: var(--transition);
}


/* Lucide reemplaza cada <i data-lucide> por un <svg>: los estilos de íconos deben cubrir ambos */
.link-card i,
.link-card svg {
    width: 32px;
    height: 32px;
    padding: 6px;
    background: var(--color-surface);
    border-radius: 12px;
    color: var(--color-primary);
    transition: var(--transition);
    flex-shrink: 0;
}

.link-card:nth-child(2n) i, .link-card:nth-child(2n) svg { color: var(--color-secondary); }
.link-card:nth-child(3n) i, .link-card:nth-child(3n) svg { color: var(--color-accent); }
.link-card:nth-child(4n) i, .link-card:nth-child(4n) svg { color: var(--color-deep); }

.link-card span {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-dark);
    letter-spacing: -0.2px;
}

.link-card:hover {
    transform: translateY(-4px);
    background: white;
    box-shadow: 0 10px 25px rgba(var(--text-dark-rgb), 0.1);
}

.link-card:hover::after {
    opacity: 0.9;
}

.link-card:hover i,
.link-card:hover svg {
    transform: scale(1.1);
}

/* Tarjeta de Eventos: aparece solo cuando hay un evento vigente, así que resalta
   sobre las demás en vez de confundirse con ellas. */
.link-card-event {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    box-shadow: 0 8px 24px rgba(var(--color-primary-rgb), 0.35);
}

.link-card-event::after {
    display: none;
}

.link-card-event span,
.link-card-event:hover span {
    color: white;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.3;
    min-width: 0;
}

/* El nombre del próximo evento va en su propio renglón y se recorta si es muy largo */
.link-card-event small {
    font-size: 0.78rem;
    font-weight: 500;
    opacity: 0.92;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.link-card-event i,
.link-card-event svg,
.link-card:nth-child(n).link-card-event svg {
    background: rgba(255, 255, 255, 0.18);
    color: white;
}

.link-card-event:hover {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    box-shadow: 0 12px 30px rgba(var(--color-primary-rgb), 0.45);
}

/* Un brillo que recorre la tarjeta para atraer la mirada sin ser estridente */
.link-card-event::before {
    content: '';
    position: absolute;
    top: 0;
    left: -60%;
    width: 45%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: skewX(-20deg);
    animation: eventShine 3.5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes eventShine {
    0% { left: -60%; }
    45% { left: 115%; }
    100% { left: 115%; }
}

@media (prefers-reduced-motion: reduce) {
    .link-card-event::before {
        display: none;
    }
}

/* Redes Sociales */
.socials {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease-out 0.5s both;
}

.socials a {
    color: var(--text-dark);
    opacity: 0.7;
    transition: var(--transition);
}

.socials a:hover {
    opacity: 1;
    transform: scale(1.2);
    color: var(--color-accent);
}

.footer-note {
    font-size: 0.85rem;
    opacity: 0.6;
    margin-top: 1rem;
}

/* Animaciones */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.4; }
    50% { transform: scale(1.1); opacity: 0.7; }
}

/* Settings & Modal */
.settings-trigger {
    background: none;
    border: none;
    color: var(--text-dark);
    opacity: 0.5;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
}

.settings-trigger:hover {
    opacity: 1;
    transform: rotate(90deg);
    color: var(--color-primary);
}

.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(var(--text-dark-rgb), 0.6);
    backdrop-filter: blur(5px);
    z-index: 100;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
    padding: 2rem 1rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 2.5rem;
    border-radius: 30px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 25px 50px rgba(var(--text-dark-rgb), 0.2);
    animation: fadeInUp 0.4s ease-out;
    margin: auto;
}

.file-input {
    margin: 1.5rem 0;
    padding: 0.8rem;
    border: 2px dashed rgba(var(--text-muted-rgb), 0.3);
    border-radius: 15px;
    width: 100%;
    cursor: pointer;
}

.close-btn {
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.close-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(var(--color-primary-rgb), 0.3);
}

/* Staggered delay for links */
.links .link-card:nth-child(1) { animation-delay: 0.1s; }
.links .link-card:nth-child(2) { animation-delay: 0.2s; }
.links .link-card:nth-child(3) { animation-delay: 0.3s; }
.links .link-card:nth-child(4) { animation-delay: 0.4s; }
.links .link-card:nth-child(5) { animation-delay: 0.5s; }

/* Mobile Optimizations */
@media (max-width: 480px) {
    .title { font-size: 2rem; }
    .bio { font-size: 1rem; }
    .link-card { padding: 1rem; }
}

/* Selector de idioma ES / EN (compartido por todas las páginas públicas) */
.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(var(--color-primary-rgb), 0.18);
    box-shadow: 0 2px 10px rgba(var(--text-dark-rgb), 0.06);
}

.lang-switch button {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    cursor: pointer;
    transition: var(--transition);
}

.lang-switch button:hover {
    color: var(--color-primary);
}

.lang-switch button.active {
    background: var(--color-primary);
    color: white;
}

/* Posición fija para páginas sin barra de navegación propia (linktree) */
.lang-switch.floating {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 50;
}
