@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800;900&display=swap');

:root {
    --primary-blue: #0b1953;
    --logo-purple: #9234eb;  
    --logo-blue: #0055ff;    
    --logo-cyan: #00bfff;
    --logo-magenta: #ff00ff;
    --text-main: #1e293b;
    --font-family: 'Poppins', sans-serif;
}

body {
    margin: 0; font-family: var(--font-family); color: var(--text-main);
    background-color: #ffffff; 
    background-image: 
        radial-gradient(circle at 10% 10%, rgba(0, 191, 255, 0.25) 0%, transparent 50%),
        radial-gradient(circle at 90% 10%, rgba(146, 52, 235, 0.35) 0%, transparent 50%),
        radial-gradient(circle at 10% 90%, rgba(146, 52, 235, 0.35) 0%, transparent 50%),
        radial-gradient(circle at 90% 90%, rgba(0, 191, 255, 0.25) 0%, transparent 50%);
    background-attachment: fixed; -webkit-tap-highlight-color: transparent; user-select: none;
    padding-bottom: env(safe-area-inset-bottom);
}

.search-container input, .funfact-text, .profile-name, .input-readonly, #myFunFact, #myLinkedin, #myPreguntaDetonadora { user-select: text; }
.main-container { max-width: 1000px; margin: 0 auto; padding: 1rem 1.5rem 6rem 1.5rem; }

/* HEADER GLOBAL */
.main-header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.5rem 0 1.5rem; }
.logo-bolivar-left { height: 40px; object-fit: contain; }

/* HERO SECTION */
.desktop-hero { text-align: center; margin-bottom: 2rem; margin-top: 1rem; }
.hero-logo img { max-width: 250px; width: 80%; margin-bottom: 1rem; filter: drop-shadow(0 10px 20px rgba(0,0,0,0.1)); cursor: pointer;}
.hero-text h2 { font-size: 1.5rem; font-weight: 900; color: #0f172a; margin: 0 0 0.5rem 0; }
.hero-text p { font-size: 0.9rem; color: #1e293b; font-weight: 600; padding: 0 1rem; opacity: 0.8; }
.logo-bolivar-right { display: none; } 

.search-container { position: relative; margin-bottom: 2rem; }
.search-container input {
    width: 100%; padding: 1.2rem 1rem 1.2rem 3.5rem; font-size: 0.95rem; font-weight: 500; border: none; border-radius: 30px; 
    box-sizing: border-box; outline: none; background: rgba(255,255,255,0.7); backdrop-filter: blur(10px);
    color: var(--primary-blue); box-shadow: 0 8px 32px rgba(0,0,0,0.08); transition: all 0.3s; font-family: inherit;
}
.search-container input::placeholder { color: rgba(11,25,83,0.5); transition: opacity 0.3s; font-family: inherit;}
.search-icon { position: absolute; left: 1.2rem; top: 50%; transform: translateY(-50%); stroke: #64748b; width: 22px; height: 22px;}

.section-title { font-size: 2.2rem; font-weight: 900; color: #000; line-height: 1; margin-bottom: 0;}

/* ==========================================
   TARJETAS DEL HOME (Ajustes de padding, logo y 3 renglones)
   ========================================== */
.profiles-grid.layout-board { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; padding-bottom: 3rem; margin-top: 1rem;}

.profile-card { 
    display: flex; flex-direction: column; align-items: center; border-radius: 20px; position: relative;
    padding-top: 1.8rem; /* 1. MÁS PADDING ARRIBA */
    box-shadow: 0 10px 20px rgba(0,0,0,0.15); transition: transform 0.2s; cursor: pointer;
}
.profile-card:nth-child(even) { transform: translateY(-4.5rem); }
.profile-card:nth-child(even):active { transform: translateY(-4.5rem) scale(0.97); }
.profile-card:active { transform: scale(0.97); }

/* PALETAS DE COLORES */
.bg-color-1 { --card-bg: #014CFC; --card-circle: #4285F4; --funfact-bg: #81B1FF; background-color: var(--card-bg); color: white; }
.bg-color-2 { --card-bg: #7105F8; --card-circle: #BD89FF; --funfact-bg: #D7B8FF; background-color: var(--card-bg); color: white; }
.bg-color-3 { --card-bg: #00B0FF; --card-circle: #69D1FF; --funfact-bg: #B8E9FF; background-color: var(--card-bg); color: white; }
.bg-color-4 { --card-bg: #EA0EF7; --card-circle: #F774FF; --funfact-bg: #F8BCFC; background-color: var(--card-bg); color: white; }

.card-avatar-container { position: relative; width: 100%; height: 120px; display: flex; align-items: flex-end; justify-content: center; z-index: 3; margin-top: -10px; margin-bottom: 0px; }
.card-circle-bg { position: absolute; bottom: 5px; width: 100px; height: 100px; background: var(--card-circle); border: 3px solid rgba(255, 255, 255, 0.3); border-radius: 50%; z-index: 1; box-sizing: border-box; }
.card-popout-img { position: relative; width: 95px; height: 130px; object-fit: cover; object-position: top center; border-radius: 0 0 47.5px 47.5px; z-index: 2; margin-bottom: 8px; filter: drop-shadow(0 5px 10px rgba(0,0,0,0.25)); }
.circular-flag { position: absolute; top: 12px; right: 12px; width: 26px; height: 26px; border-radius: 50%; object-fit: cover; box-shadow: 0 2px 6px rgba(0,0,0,0.3); z-index: 4; }

.profile-main { 
    padding: 0.2rem 0.5rem 1.8rem 0.5rem; /* 2. MÁS PADDING ABAJO */
    text-align: center; width: 100%; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 4px; box-sizing: border-box; 
}

/* 3. TAMAÑO DEL LOGO MANUALMENTE AQUÍ: */
.card-company-logo { width: 100%; height: 65px; display: flex; align-items: center; justify-content: center; margin-top: -5px; margin-bottom: 2px;}
.card-company-logo img { 
    width: 100%; height: 100%; 
    max-height: 65px; /* A) Modifica esta altura máxima... */
    object-fit: contain; object-position: center; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.25)); display: block; 
    transform: scale(1.15); /* B) ... O cambia el número de esta "lupa". Ej: 1.30 para más grande, o 0.90 para más chico */
}

.profile-name { font-size: 1.15rem; margin: 0; font-weight: 800; line-height: 1.1; text-align: center; width: 100%; z-index: 3;}

/* 4. CARGO DE 3 RENGLONES: */
.card-job-title { 
    font-size: 0.8rem; line-height: 1.15; margin: 0; font-weight: 500; color: rgba(255,255,255,0.95); 
    display: -webkit-box; 
    -webkit-line-clamp: 3; /* ¡Cambiado de 2 a 3! */
    -webkit-box-orient: vertical; overflow: hidden; text-align: center; width: 100%; z-index: 3;
}

/* ==========================================
   MODAL Y COREOGRAFÍA 3D
   ========================================== */
#participant-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 100000; overflow-y: auto; overflow-x: hidden; perspective: 2500px; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; display: none; flex-direction: column; }
#participant-modal.flex-active { display: flex; }
#participant-modal.active { opacity: 1; pointer-events: auto; }

.modal-header-3d { position: relative; width: 100%; height: 380px; display: flex; justify-content: center; align-items: flex-end; transform-style: preserve-3d; transform: rotateY(0deg) scale(0.9); transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);}
#participant-modal.active .modal-header-3d { transform: rotateY(0deg) scale(1); }
#participant-modal.do-flip .modal-header-3d { transform: rotateY(360deg) scale(1); transition: transform 1.5s ease-in-out; }

.modal-avatar-container { position: relative; width: 240px; height: 320px; display: flex; align-items: flex-end; justify-content: center; transform: translateZ(50px); z-index: 3; margin-bottom: -20px;}
.modal-circle-bg { position: absolute; bottom: 10px; width: 220px; height: 220px; background: var(--card-circle); border: 5px solid rgba(255, 255, 255, 0.4); border-radius: 50%; box-shadow: inset 0 0 20px rgba(0,0,0,0.1); z-index: 1; box-sizing: border-box; }
.modal-popout-img { position: relative; width: 210px; height: 300px; object-fit: cover; object-position: top center; border-radius: 0 0 105px 105px; z-index: 2; margin-bottom: 15px; filter: drop-shadow(0 15px 25px rgba(0,0,0,0.4)); }

.parallax-icon { position: absolute; font-size: 5rem; z-index: 4; filter: drop-shadow(0 10px 15px rgba(0,0,0,0.3)); opacity: 0; transform: translateZ(120px) scale(0); transition: opacity 0.3s, transform 0.3s; }
#participant-modal.do-flip .parallax-icon { opacity: 1; transform: translateZ(120px) scale(1); transition: opacity 0.4s ease-out 0.75s, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.75s; }
#participant-modal.do-flip #iconRight { transition: opacity 0.4s ease-out 0.85s, transform: 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.85s; }
@keyframes float { 0% {margin-top: 0px;} 50% {margin-top: -15px;} 100% {margin-top: 0px;} }

/* BURBUJA SOLUCIONADA: Subida "un toque" y con salto de línea natural */
.floating-fun-fact {
    position: absolute; 
    bottom: 5px; 
    left: 50%; 
    transform: translateX(-50%) translateZ(150px) scale(0); 
    transform-origin: center bottom; 
    background: var(--funfact-bg); backdrop-filter: blur(8px); padding: 10px 15px; border-radius: 20px; 
    font-size: 0.85rem; font-weight: 500; color: #000000; line-height: 1.4;
    width: max-content; 
    max-width: 250px; 
    white-space: normal; word-wrap: break-word; overflow-wrap: break-word; text-align: center; 
    box-sizing: border-box; box-shadow: 0 10px 20px rgba(0,0,0,0.25); z-index: 6; pointer-events: none; opacity: 0; 
    transition: opacity 0.4s ease-out 0.85s, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.85s; 
}
#participant-modal.do-flip .floating-fun-fact.show { opacity: 1; transform: translateX(-50%) translateZ(150px) scale(1); animation: float-bubble-center 4s ease-in-out infinite 1.45s; }
@keyframes float-bubble-center { 0% { transform: translateX(-50%) translateZ(150px) scale(1) translateY(0px); } 50% { transform: translateX(-50%) translateZ(150px) scale(1) translateY(-8px); } 100% { transform: translateX(-50%) translateZ(150px) scale(1) translateY(0px); } }

.modal-bg-text { position: absolute; top: 20px; left: 50%; text-align: center; font-size: clamp(4rem, 16vw, 7.5rem); font-weight: 900; color: #ffffff; line-height: 0.8; z-index: 1; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: clip; transform: translate(-50%, 0) translateZ(-50px) scale(0.8); opacity: 0; transition: all 0.5s ease;}
#participant-modal.do-flip .modal-bg-text { opacity: 1; transform: translate(-50%, 0) translateZ(-50px) scale(1); transition-delay: 1.1s; }

.modal-content-transparent { background: transparent; border-radius: 40px 40px 0 0; padding: 1.5rem 1.5rem 6rem 1.5rem; flex: 1; z-index: 5; transform: translateY(100px); opacity: 0; transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); }
#participant-modal.active .modal-content-transparent { transform: translateY(0); opacity: 1; transition-delay: 0.1s;}

/* SOLUCIÓN AL NOMBRE: Simetría absoluta, sin caja flexible y con protección de 90px para respirar */
.modal-name-container { 
    text-align: center; 
    width: 100%; 
    padding: 0 90px; 
    box-sizing: border-box; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: flex-end; 
    min-height: 55px;
}
#modalName { text-align: center; font-size: 1.5rem; font-weight: 900; color: white; margin: 0; line-height: 1.1; overflow-wrap: break-word; word-break: normal; }

/* LOGO LIBRE: Absoluto, jamás estorbará al nombre, y tiene hasta 75px de alto para lucirse */
#modalCompanyLogoContainer { display: none; position: absolute; left: 0; bottom: -7px; height: 83px; width: 90px; align-items: flex-end; justify-content: flex-start; z-index: 5; pointer-events: none;}
#modalCompanyLogoContainer img { width: 100%; height: 100%; object-fit: contain; object-position: left bottom; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3)); display: block; }

#modalTags { display: flex; gap: 0.5rem; flex-wrap: nowrap !important; justify-content: center; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; padding-bottom: 5px; max-width: 100%; }
#modalTags::-webkit-scrollbar { display: none; }

.interest-pill { display: inline-block; padding: 0.6rem 1rem; border-radius: 20px; background: rgba(255,255,255,0.4); color: var(--primary-blue); border: 1px solid rgba(255,255,255,0.6); font-size: 0.85rem; font-weight: 800; margin: 0.2rem 0.2rem 0.4rem 0; cursor: pointer; transition: all 0.2s; white-space: nowrap; flex-shrink: 0; }
.interest-pill.selected { background: var(--logo-blue); color: white; border: none; box-shadow: 0 4px 15px rgba(0,85,255,0.4); }
#modalTags .interest-pill { background: rgba(255,255,255,0.2); color: #ffffff; border: 1px solid rgba(255,255,255,0.3); font-weight: 400; cursor: default; margin: 0;}

.btn-transparent-glass { background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.3); color: white; width: 100%; padding: 0.8rem; border-radius: 16px; font-size: 0.95rem; font-weight: 400; font-family: 'Poppins', sans-serif; margin-bottom: 0.8rem; display: flex; align-items: center; justify-content: center; gap: 10px; box-sizing: border-box; cursor: pointer; backdrop-filter: blur(10px); transition: all 0.2s; box-shadow: 0 10px 20px rgba(0,0,0,0.25), 0 4px 6px rgba(0,0,0,0.15); }
.btn-transparent-glass:active { background: rgba(255,255,255,0.3); box-shadow: 0 4px 10px rgba(0,0,0,0.2); transform: translateY(2px);}

/* BOTTOM NAV */
.bottom-nav { position: fixed; bottom: 0; left: 0; width: 100%; background: transparent; display: flex; justify-content: center; padding-bottom: calc(0.8rem + env(safe-area-inset-bottom)); z-index: 999; }
.fab-btn { background: rgba(255,255,255,0.3); backdrop-filter: blur(15px); border: 1px solid rgba(255,255,255,0.5); padding: 0.3rem; border-radius: 30px; display: flex; gap: 0.3rem; box-shadow: 0 10px 30px rgba(0,0,0,0.15); }
.fab-item { background: transparent; color: #ffffff; border: none; padding: 0.6rem 1.5rem; border-radius: 25px; font-weight: 800; cursor: pointer; transition: all 0.2s; font-family: 'Poppins', sans-serif;}
.fab-item.active { background: white; color: var(--logo-purple); box-shadow: 0 4px 15px rgba(0,0,0,0.1); }

.app-view { display: none; animation: fadeIn 0.3s ease-out forwards; }
.app-view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.btn-close-modal { position: absolute; top: 20px; right: 20px; background: rgba(255,255,255,0.2); backdrop-filter: blur(5px); border: 1px solid rgba(255,255,255,0.4); border-radius: 50%; width: 40px; height: 40px; color: white; font-size: 1.2rem; cursor: pointer; z-index: 10; display: flex; align-items: center; justify-content: center;}

/* ==========================================
   MI PERFIL
   ========================================== */
#view-profile .modal-info-icon { font-size: 1.2rem; opacity: 0.9; color: var(--primary-blue); }
#view-profile input, #view-profile select, #view-profile textarea { font-family: inherit; font-size: 0.95rem;}

.profile-data-box { display: flex; flex-direction: column; gap: 1rem; width: 100%; }
.profile-top-row, .profile-bottom-row { display: flex; flex-direction: column; gap: 1rem; }
.profile-info-item { display: flex; align-items: center; gap: 12px; color: #0f172a; font-weight: 600; padding: 0.5rem 0;}
.profile-info-item input, .profile-info-item select { background: transparent; border: none; color: #0f172a; font-weight: 700; width: 100%; padding: 0; outline: none; }
.profile-divider-line { width: 100%; height: 1px; background: rgba(0,0,0,0.15); margin: 0.5rem 0; }

.btn-save-profile {
    width: auto !important; display: block; margin: 0 auto; padding: 1rem 3rem !important;
    background: linear-gradient(135deg, #00bfff 0%, #0055ff 100%) !important;
    color: #ffffff !important; border: 1px solid rgba(255,255,255,0.3) !important;
    box-shadow: 0 10px 20px rgba(0,85,255,0.4), inset 0 2px 5px rgba(255,255,255,0.5) !important;
    border-radius: 30px !important; font-size: 1.1rem !important; cursor: pointer; transition: all 0.2s; font-family: 'Poppins', sans-serif;
}
.btn-save-profile:active { transform: scale(0.95); }

/* ==========================================
   DESKTOP SPLIT LAYOUT (INTOCABLE)
   ========================================== */
@media (min-width: 1024px) {
    .main-container { max-width: 1300px; }
    .main-header { display: none; } 
    
    .desktop-hero { margin-top: 2rem; margin-bottom: 2rem;}
    .hero-top-row { display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 4rem; margin-bottom: 2rem;}
    .hero-logo img { max-width: 320px; width: 100%; filter: drop-shadow(0 10px 20px rgba(0,0,0,0.1)); cursor: pointer; margin-bottom: 0;}
    .hero-text { text-align: center; }
    .hero-text h2 { font-size: 1.8rem; margin-bottom: 0.5rem; white-space: nowrap; } 
    .hero-text p { padding: 0; font-size: 1rem; max-width: 450px;}
    .search-container { width: 100%; max-width: 100%; margin: 0; } 
    
    .profiles-grid.layout-board { grid-template-columns: repeat(5, 1fr); gap: 1.5rem; margin-top: 2rem;}
    .profile-card:nth-child(even) { transform: none; }
    .profile-card:nth-child(even):active { transform: scale(0.97); }
    .profile-card:nth-child(5n+2), .profile-card:nth-child(5n+4) { transform: translateY(-4.5rem); }
    .profile-card:nth-child(5n+2):active, .profile-card:nth-child(5n+4):active { transform: translateY(-4.5rem) scale(0.97); }

    #participant-modal { position: relative; top: 0; left: 0; width: 100%; height: auto; border-radius: 40px; overflow: visible; }
    .btn-close-modal { display: none; } 

    body.modal-is-open .hero-top-row { display: flex; align-items: center; gap: 0;}
    body.modal-is-open .desktop-hero {
        position: sticky; top: 0; z-index: 1000;
        display: flex; flex-direction: row; align-items: center; justify-content: space-between;
        background: rgba(255,255,255,0.5); backdrop-filter: blur(20px);
        border-bottom: 1px solid rgba(255,255,255,0.4); margin-bottom: 2rem;
        width: 100vw; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw);
        border-radius: 0; padding: 15px max(2rem, calc(50vw - 650px)); box-sizing: border-box; margin-top: 0;
    }
    body.modal-is-open .hero-logo img { width: 140px; margin: 0; cursor: pointer; }
    body.modal-is-open .hero-text { display: none; } 
    body.modal-is-open .search-container { flex: 1; max-width: 600px; margin: 0 2rem; }
    body.modal-is-open .logo-bolivar-right { display: block; width: 80px; object-fit: contain; } 

    body.modal-is-open .content-split-area { display: flex; gap: 4rem; align-items: flex-start; }
    body.modal-is-open #participant-modal { display: flex; position: sticky; top: 100px; width: 420px; flex-shrink: 0; max-height: calc(100vh - 100px); overflow-y: auto; scrollbar-width: none; }
    body.modal-is-open #participant-modal::-webkit-scrollbar { display: none; }
    body.modal-is-open .desktop-main { flex: 1; }
    body.modal-is-open .modal-bg-text { font-size: 5.5rem; top: 20px;} 
    
    body.modal-is-open .profiles-grid.layout-board { grid-template-columns: repeat(3, 1fr); }
    body.modal-is-open .profile-card:nth-child(5n+2), body.modal-is-open .profile-card:nth-child(5n+4) { transform: none; }
    body.modal-is-open .profile-card:nth-child(5n+2):active, body.modal-is-open .profile-card:nth-child(5n+4):active { transform: scale(0.97); }
    body.modal-is-open .profile-card:nth-child(3n+2) { transform: translateY(-4.5rem); }
    body.modal-is-open .profile-card:nth-child(3n+2):active { transform: translateY(-4.5rem) scale(0.97); }

    .profile-top-row, .profile-bottom-row { flex-direction: row; justify-content: space-between; gap: 2rem; }
    .profile-info-item { width: 33.33%; margin-bottom: 0; }
    
    #modalCompanyLogoContainer { height: 95px !important; width: 140px !important; bottom: -15px !important; }
    .modal-name-container { padding: 0 140px !important; }
}