/* ============================================
   Parla con Sofia - Homepage
   Child-friendly design: pastels, rounded, fun
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&family=Comic+Neue:wght@400;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --purple: #9B8EC4;
    --pink: #F0A3B3;
    --blue: #87CEEB;
    --mint: #98D4BB;
    --yellow: #FFD93D;
    --orange: #FFB347;
    --bg: #F0E6FF;
    --bg-gradient: linear-gradient(135deg, #E8D5F5 0%, #D4E7F7 50%, #E8F5E9 100%);
    --text: #3D2C5E;
    --text-light: #6B5B8A;
    --white: #FFFFFF;
    --radius: 20px;
    --shadow: 0 8px 32px rgba(155, 142, 196, 0.2);
}

body {
    font-family: 'Nunito', 'Comic Neue', sans-serif;
    background: var(--bg-gradient);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

/* --- Magic Background --- */
.magic-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}
.star {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: 8px;
    height: 8px;
    background: var(--yellow);
    border-radius: 50%;
    animation: twinkle 3s ease-in-out infinite var(--delay);
    box-shadow: 0 0 10px var(--yellow), 0 0 20px rgba(255, 217, 61, 0.3);
}
@keyframes twinkle {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

.cloud {
    position: absolute;
    background: rgba(255,255,255,0.4);
    border-radius: 100px;
    animation: cloud-float linear infinite;
}
.cloud::before, .cloud::after {
    content: '';
    position: absolute;
    background: inherit;
    border-radius: 50%;
}
.cloud-1 {
    width: 120px; height: 40px; top: 10%; left: -150px;
    animation-duration: 35s;
}
.cloud-1::before { width: 50px; height: 50px; top: -25px; left: 20px; }
.cloud-1::after { width: 35px; height: 35px; top: -15px; left: 60px; }
.cloud-2 {
    width: 160px; height: 50px; top: 25%; left: -200px;
    animation-duration: 45s; animation-delay: 10s;
}
.cloud-2::before { width: 65px; height: 65px; top: -30px; left: 30px; }
.cloud-2::after { width: 45px; height: 45px; top: -20px; left: 85px; }
.cloud-3 {
    width: 100px; height: 35px; top: 60%; left: -130px;
    animation-duration: 40s; animation-delay: 20s;
}
.cloud-3::before { width: 40px; height: 40px; top: -20px; left: 15px; }
.cloud-3::after { width: 30px; height: 30px; top: -12px; left: 50px; }
@keyframes cloud-float {
    from { transform: translateX(0); }
    to { transform: translateX(calc(100vw + 250px)); }
}

/* --- Header --- */
.home-header {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(20px);
    border-bottom: 2px solid rgba(155, 142, 196, 0.15);
}
.home-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}
.logo-icon { font-size: 28px; }
.logo-text {
    font-weight: 800;
    font-size: 18px;
    color: var(--purple);
}
.home-user {
    display: flex;
    align-items: center;
    gap: 14px;
}
.user-greeting { font-size: 15px; color: var(--text-light); }
.btn-logout {
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    color: var(--pink);
    background: rgba(240, 163, 179, 0.1);
    border: 2px solid var(--pink);
    padding: 6px 16px;
    border-radius: 30px;
    text-decoration: none;
    transition: all 0.3s;
}
.btn-logout:hover { background: var(--pink); color: white; }

.btn-login-header {
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    color: white;
    background: var(--purple);
    padding: 10px 24px;
    border-radius: 30px;
    text-decoration: none;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(155, 142, 196, 0.3);
}
.btn-login-header:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(155, 142, 196, 0.4); }

/* --- Main --- */
.home-main {
    position: relative;
    z-index: 5;
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px 60px;
}

/* --- Hero --- */
.home-hero {
    text-align: center;
    margin-bottom: 50px;
}
.hero-title {
    font-size: 42px;
    font-weight: 900;
    color: var(--text);
    margin-bottom: 12px;
    line-height: 1.2;
}
.wave-emoji {
    display: inline-block;
    animation: wave 1.5s ease-in-out infinite;
    transform-origin: 70% 70%;
}
@keyframes wave {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(20deg); }
    75% { transform: rotate(-10deg); }
}
.hero-subtitle {
    font-size: 19px;
    color: var(--text-light);
    font-weight: 600;
}

/* --- Bot Cards Grid --- */
.bots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 28px;
    margin-bottom: 40px;
}

.bot-card {
    position: relative;
    background: var(--white);
    border-radius: var(--radius);
    padding: 32px 24px 24px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 3px solid transparent;
    overflow: hidden;
}
.bot-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--accent);
    box-shadow: 0 16px 48px rgba(155, 142, 196, 0.25);
}
.bot-card-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;
}
.bot-card:hover .bot-card-glow { opacity: 0.04; }

/* Avatar */
.bot-avatar-wrap {
    position: relative;
    display: inline-block;
    margin-bottom: 16px;
}
.bot-avatar {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}
.avatar-svg { width: 100%; height: 100%; }
.bot-emoji { font-size: 52px; line-height: 1; }
.bot-status-dot {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: #4CD964;
    border: 3px solid white;
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 0 0 rgba(76, 217, 100, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(76, 217, 100, 0); }
}

.bot-name {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text);
}
.bot-desc {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 14px;
    line-height: 1.5;
}
.bot-age-badge {
    display: inline-block;
    background: rgba(155, 142, 196, 0.1);
    color: var(--purple);
    font-size: 12px;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 20px;
    margin-bottom: 18px;
}

/* Chat button */
.btn-chat {
    display: block;
    font-family: inherit;
    font-size: 16px;
    font-weight: 800;
    color: white;
    padding: 14px 24px;
    border-radius: 16px;
    text-decoration: none;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}
.btn-chat:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    filter: brightness(1.1);
}
.btn-chat-icon { margin-right: 6px; }
.btn-chat-login {
    background: #ccc !important;
    color: #666 !important;
}

/* Admin link */
.admin-link-wrap { text-align: center; margin-top: 10px; }
.btn-admin {
    display: inline-block;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-light);
    background: rgba(255,255,255,0.6);
    backdrop-filter: blur(10px);
    padding: 12px 28px;
    border-radius: 30px;
    text-decoration: none;
    border: 2px solid rgba(155, 142, 196, 0.2);
    transition: all 0.3s;
}
.btn-admin:hover {
    background: white;
    border-color: var(--purple);
    color: var(--purple);
}

/* Footer */
.home-footer {
    position: relative;
    z-index: 5;
    text-align: center;
    padding: 20px;
    font-size: 14px;
    color: var(--text-light);
}
.home-footer a { color: var(--purple); font-weight: 700; text-decoration: none; }

/* Responsive */
@media (max-width: 600px) {
    .hero-title { font-size: 28px; }
    .hero-subtitle { font-size: 16px; }
    .bots-grid { grid-template-columns: 1fr; gap: 20px; }
    .home-header { flex-wrap: wrap; gap: 10px; }
}

/* --- Global Navigation Bar --- */
.global-nav {
    background: #1F313F;
    padding: 0;
    position: relative;
    z-index: 10500;
}
.gnav-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}
.gnav-brand {
    font-family: "Nunito", sans-serif;
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    text-decoration: none;
    padding: 8px 0;
    white-space: nowrap;
    opacity: 0.9;
}
.gnav-brand:hover { opacity: 1; }
.gnav-links {
    display: flex;
    gap: 2px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.gnav-links::-webkit-scrollbar { display: none; }
.gnav-link {
    font-family: "Nunito", sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    padding: 8px 12px;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}
.gnav-link:hover { color: #fff; background: rgba(255,255,255,0.05); }
.gnav-active { color: #fff; border-bottom-color: #25ADDA; }
@media (max-width: 600px) {
    .gnav-brand { display: none; }
    .gnav-inner { justify-content: center; }
    .gnav-link { font-size: 11px; padding: 8px 8px; }
}

