/* ==========================================
   ESTILOS GENERALES - DISEÑO MODERNO
   ========================================== */

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* HEADER LABORATORIO */
.lab-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 40px 20px 32px;
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

.lab-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
}

.lab-container { max-width: 800px; margin: 0 auto; }

.lab-logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
    margin-bottom: 16px;
    background: var(--surface);
    border-radius: 16px;
    padding: 8px;
    border: 1px solid var(--border);
}

.lab-name {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-dark);
    letter-spacing: -0.5px;
    line-height: 1.2;
    margin-bottom: 8px;
}

.lab-desc {
    font-size: 1rem;
    color: var(--text-sub);
    margin-bottom: 20px;
    line-height: 1.6;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.lab-meta {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-sub);
}

.lab-link {
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.2s ease;
}

.lab-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* MAIN */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    flex: 1;
}

/* BUSCADOR */
.search-section {
    margin-bottom: 32px;
    position: relative;
    max-width: 480px;
    margin: 0 auto 32px;
}

.search-input {
    width: 100%;
    padding: 14px 20px 14px 48px;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 0.95rem;
    outline: none;
    background: var(--surface);
    transition: border-color 0.2s ease;
}

.search-input:focus {
    border-color: var(--primary);
}

.search-input::placeholder {
    color: var(--text-sub);
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-sub);
}

/* GRID */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    width: 100%;
}

/* CARDS */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border-color: var(--primary);
}

.card-clickable {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.card-main-link {
    padding: 20px;
    flex: 1;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.card-top {
    display: flex;
    gap: 14px;
    margin-bottom: 12px;
    align-items: center;
}

.project-icon, .project-icon-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    flex-shrink: 0;
    object-fit: contain;
    background: var(--bg);
    padding: 4px;
    border: 1px solid var(--border);
}

.project-icon-placeholder {
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    padding: 0;
}

.item-title {
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 4px;
    color: var(--text-main);
}

.project-card:hover .item-title {
    color: var(--primary-dark);
}

.item-desc {
    font-size: 0.875rem;
    color: var(--text-sub);
    margin-bottom: 16px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* BADGES */
.card-badges {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: auto;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-subsite { background: #FCE4EC; color: var(--primary); }
.badge-experiment { background: #E8F5E9; color: #2E7D32; }
.badge-tool { background: #ECEFF1; color: #455A64; }
.badge-game { background: #FFF3E0; color: #E65100; }
.badge-ai { background: #F3E5F5; color: #7B1FA2; }
.badge-database { background: #E0F2F1; color: #00796B; }
.badge-knowledge { background: #FCE4EC; color: var(--primary-dark); }

/* Status Badges */
.badge-status { font-size: 0.65rem; }
.badge-status-idea { background: #F3E5F5; color: #7B1FA2; }
.badge-status-development { background: #FFF8E1; color: #F57F17; }
.badge-status-beta { background: #E3F2FD; color: #1565C0; }
.badge-status-stable { background: #E8F5E9; color: #2E7D32; }
.badge-status-maintenance { background: #ECEFF1; color: #455A64; }
.badge-status-deprecated { background: #FFEBEE; color: #C62828; }

/* Progress Bar */
.progress-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: var(--bg);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.progress-fill-idea { background: linear-gradient(90deg, #CE93D8, #7B1FA2); }
.progress-fill-development { background: linear-gradient(90deg, #FFD54F, #F57F17); }
.progress-fill-beta { background: linear-gradient(90deg, #64B5F6, #1565C0); }
.progress-fill-stable { background: linear-gradient(90deg, #81C784, #2E7D32); }
.progress-fill-maintenance { background: linear-gradient(90deg, #90A4AE, #455A64); }
.progress-fill-deprecated { background: linear-gradient(90deg, #EF9A9A, #C62828); }

.progress-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-sub);
    min-width: 32px;
    text-align: right;
}

/* FOOTER TARJETA */
.card-footer {
    border-top: 1px solid var(--border);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-sub);
}

.author-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    font-size: 0.75rem;
}

.github-link {
    color: var(--text-sub);
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    padding: 4px;
}

.github-link:hover {
    color: var(--primary);
}

/* CARPETAS */
.folder-card {
    grid-column: 1 / -1;
    border: none;
    background: transparent;
    padding: 0;
}

.folder-header {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 14px 20px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    border-left: 3px solid var(--primary);
    transition: background 0.2s ease;
}

.folder-header:hover {
    background: var(--bg);
}

.folder-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.folder-icon {
    font-size: 1.3rem;
}

.folder-content {
    padding-left: 20px;
    border-left: 2px solid var(--border);
    margin-left: 20px;
}

/* Botón README */
.readme-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 10px;
}

.readme-btn:hover {
    background: var(--primary-dark);
}

/* TEAM SECTION */
.team-section {
    margin-top: 60px;
    padding: 48px 20px;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

.section-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 36px;
    color: var(--text-main);
}

/* Team Tags */
.team-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-bottom: 12px;
}

.team-tag {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.team-tag-director { background: #FEE2E2; color: #991B1B; }
.team-tag-principal { background: #DBEAFE; color: #1E40AF; }
.team-tag-asociado { background: #E0E7FF; color: #3730A3; }
.team-tag-postdoc { background: #F3E8FF; color: #6B21A8; }
.team-tag-tesista_doctorado { background: #FCE7F3; color: #9D174D; }
.team-tag-tesista_magister { background: #FEF3C7; color: #92400E; }
.team-tag-tesista_pregrado { background: #D1FAE5; color: #065F46; }
.team-tag-invitado { background: #E0F2FE; color: #0369A1; }
.team-tag-interno { background: #FFEDD5; color: #C2410C; }
.team-tag-ayudante { background: #CCFBF1; color: #0F766E; }
.team-tag-colaborador { background: #F1F5F9; color: #475569; }

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    max-width: 1100px;
    margin: 0 auto;
}

.team-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 28px 20px;
    text-align: center;
    transition: box-shadow 0.2s ease;
}

.team-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.team-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 16px;
    border: 3px solid var(--surface);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background-color: var(--bg);
}

.team-initials {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0 auto 16px;
}

.team-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 4px;
}

.team-role {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.team-bio {
    font-size: 0.875rem;
    color: var(--text-sub);
    line-height: 1.6;
    margin-bottom: 16px;
}

.team-socials {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.social-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-sub);
    text-decoration: none;
    transition: all 0.2s ease;
}

.social-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ORCID Color */
.social-btn.orcid:hover {
    background: #A6CE39;
    border-color: #A6CE39;
    color: white;
}

/* ALUMNI SECTION */
.alumni-section {
    padding: 48px 20px;
    background: var(--surface);
    border-top: 1px solid var(--border);
}

.alumni-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    max-width: 1100px;
    margin: 0 auto;
}

.alumni-card {
    display: flex;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    align-items: center;
    gap: 16px;
    transition: all 0.2s ease;
}

.alumni-card:hover {
    border-color: var(--primary);
    transform: translateX(4px);
}

.alumni-photo {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    filter: grayscale(100%);
    opacity: 0.8;
    transition: all 0.2s;
    border: 2px solid var(--border);
    flex-shrink: 0;
}

.alumni-card:hover .alumni-photo {
    filter: grayscale(0%);
    opacity: 1;
}

.alumni-initials {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--border);
    color: var(--text-sub);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.alumni-info {
    flex: 1;
    min-width: 0; /* Para que el truncate funcione */
}

.alumni-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 4px;
}

.alumni-meta {
    font-size: 0.8rem;
    color: var(--text-sub);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.alumni-period {
    font-weight: 500;
    color: var(--primary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.alumni-assoc {
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.75rem;
}

.alumni-thesis-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    background: rgba(59, 130, 246, 0.08);
    padding: 2px 8px;
    border-radius: 4px;
    width: fit-content;
    transition: all 0.2s;
}

.alumni-thesis-link:hover {
    background: var(--primary);
    color: white;
}

/* RESPONSIVE DESIGN - MOBILE FIRST */

/* Tablets y pantallas medianas */
@media (max-width: 968px) {
    .main-container {
        padding: 0 16px;
    }

    .grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 20px;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .stats-widget {
        grid-template-columns: repeat(2, 1fr);
    }

    .noticias-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }

    .investigaciones-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

/* Móviles grandes */
@media (max-width: 768px) {
    .lab-header {
        padding: 30px 16px;
    }

    .lab-name {
        font-size: 1.8rem;
        line-height: 1.3;
    }

    .lab-desc {
        font-size: 1rem;
    }

    .lab-logo {
        width: 60px;
        height: 60px;
    }

    .lab-meta {
        gap: 12px;
        font-size: 0.85rem;
    }

    .main-container {
        padding: 0 12px;
    }

    .grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .search-section {
        margin-bottom: 30px;
    }

    .hero-widget {
        padding: 40px 24px;
        min-height: 300px;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-btn {
        font-size: 1rem;
        padding: 12px 24px;
    }

    .stats-widget {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .stat-number {
        font-size: 2rem;
    }

    .noticias-grid,
    .investigaciones-grid,
    .galeria-grid,
    .proyectos-fondos-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .team-grid {
        grid-template-columns: 1fr;
        max-width: 350px;
    }

    .team-section {
        margin-top: 60px;
        padding: 40px 16px;
    }

    .team-tags {
        gap: 4px;
    }

    .team-tag {
        font-size: 0.6rem;
        padding: 2px 6px;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .card {
        border-radius: 16px;
    }

    .card-top {
        gap: 12px;
    }

    .project-icon,
    .project-icon-placeholder {
        width: 48px;
        height: 48px;
    }

    .item-title {
        font-size: 1.1rem;
    }

    .item-desc {
        font-size: 0.9rem;
    }

    .folder-header {
        padding: 12px 16px;
    }

    .folder-content {
        padding-left: 16px;
        margin-left: 16px;
    }

    .fondo-tipo-titulo {
        font-size: 1.5rem;
    }

    footer {
        padding: 30px 16px;
        font-size: 0.85rem;
    }
}

/* Móviles pequeños */
@media (max-width: 480px) {
    .lab-header {
        padding: 24px 12px;
    }

    .lab-name {
        font-size: 1.5rem;
    }

    .lab-desc {
        font-size: 0.95rem;
    }

    .lab-logo {
        width: 50px;
        height: 50px;
    }

    .lab-meta {
        flex-direction: column;
        gap: 8px;
    }

    .main-container {
        padding: 0 8px;
    }

    .search-input {
        font-size: 0.9rem;
        padding: 14px 16px 14px 45px;
    }

    .hero-widget {
        padding: 30px 16px;
        min-height: 250px;
        border-radius: 16px;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
        margin-bottom: 24px;
    }

    .hero-btn {
        font-size: 0.95rem;
        padding: 10px 20px;
    }

    .stat-item {
        padding: 20px;
    }

    .stat-number {
        font-size: 1.8rem;
    }

    .stat-label {
        font-size: 0.9rem;
    }

    .card {
        border-radius: 12px;
    }

    .card-clickable,
    .card-main-link {
        padding: 16px;
    }

    .card-footer {
        padding: 12px 16px;
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .card-badges {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
        align-items: flex-start;
    }

    .card-badges .card-actions {
        width: 100%;
        margin-top: 4px;
        margin-left: 0;
    }

    .progress-container {
        margin-top: 10px;
        padding-top: 10px;
    }

    .progress-text {
        font-size: 0.7rem;
    }

    .project-icon,
    .project-icon-placeholder {
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }

    .item-title {
        font-size: 1rem;
    }

    .item-desc {
        font-size: 0.85rem;
        -webkit-line-clamp: 2;
    }

    .badge {
        font-size: 0.7rem;
        padding: 4px 10px;
    }

    .folder-header {
        padding: 10px 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .folder-title-group {
        gap: 10px;
    }

    .folder-icon {
        font-size: 1.3rem;
    }

    .readme-btn {
        padding: 6px 12px;
        font-size: 1rem;
        margin-left: 0;
        margin-top: 8px;
    }

    .folder-content {
        padding-left: 12px;
        margin-left: 12px;
    }

    .noticia-imagen {
        height: 160px;
    }

    .noticia-content {
        padding: 16px;
    }

    .noticia-titulo {
        font-size: 1.2rem;
    }

    .investigacion-item {
        padding: 16px;
    }

    .investigacion-titulo {
        font-size: 1.15rem;
    }

    .galeria-imagen-wrapper {
        height: 180px;
    }

    .proyecto-fondo-item {
        padding: 16px;
    }

    .fondo-tipo-titulo {
        font-size: 1.3rem;
    }

    .cta-widget {
        padding: 30px 20px;
        border-radius: 16px;
    }

    .cta-title {
        font-size: 1.5rem;
    }

    .cta-text {
        font-size: 1rem;
    }

    .team-card {
        padding: 24px 16px;
    }

    .team-photo,
    .team-initials {
        width: 80px;
        height: 80px;
    }

    .team-initials {
        font-size: 2rem;
    }

    .team-name {
        font-size: 1.1rem;
    }

    .section-title {
        font-size: 1.3rem;
    }

    /* Modal adjustments */
    .modal-overlay {
        padding: 10px;
    }

    .modal-content {
        border-radius: 16px;
    }

    .modal-header {
        padding: 16px;
    }

    .modal-header h3 {
        font-size: 1.1rem;
    }

    .modal-body {
        padding: 16px;
    }

    .project-options-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .option-card {
        padding: 20px 16px;
    }

    .versions-grid {
        grid-template-columns: 1fr;
    }

    footer {
        padding: 24px 12px;
    }

    footer > div {
        flex-direction: column;
        gap: 10px;
    }
}

/* Móviles muy pequeños (320px) */
@media (max-width: 360px) {
    .lab-name {
        font-size: 1.3rem;
    }

    .lab-desc {
        font-size: 0.9rem;
    }

    .hero-title {
        font-size: 1.3rem;
    }

    .hero-subtitle {
        font-size: 0.9rem;
    }

    .card-clickable,
    .card-main-link {
        padding: 12px;
    }

    .card-footer {
        padding: 10px 12px;
    }

    .item-title {
        font-size: 0.95rem;
    }

    .item-desc {
        font-size: 0.8rem;
    }

    .search-input {
        min-width: auto;
    }
}

/* ==========================================
   ANIMACIONES Y MEJORAS VISUALES
   ========================================== */

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Aplicar animaciones a las tarjetas */
.card {
    animation: fadeIn 0.4s ease-out;
    animation-fill-mode: both;
}

.card:nth-child(1) { animation-delay: 0s; }
.card:nth-child(2) { animation-delay: 0.05s; }
.card:nth-child(3) { animation-delay: 0.1s; }
.card:nth-child(4) { animation-delay: 0.15s; }
.card:nth-child(5) { animation-delay: 0.2s; }
.card:nth-child(6) { animation-delay: 0.25s; }
.card:nth-child(n+7) { animation-delay: 0.3s; }

.folder-card {
    animation: slideIn 0.5s ease-out;
}

/* Hover effects mejorados */
.project-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
                0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.project-card:active {
    transform: translateY(-2px) scale(1.01);
}

/* Mejorar transiciones de folder */
.folder-card details {
    transition: all 0.3s ease;
}

.folder-header:hover {
    background: var(--bg);
    transform: translateX(4px);
}

/* Toggle icon animation */
.toggle-icon {
    transition: transform 0.3s ease;
}

details[open] .toggle-icon {
    transform: rotate(180deg);
}

/* Ripple effect en botones */
.readme-btn {
    position: relative;
    overflow: hidden;
}

.readme-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.readme-btn:active::after {
    width: 200px;
    height: 200px;
}

/* Toast notifications */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 14px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.2s ease-out;
    z-index: 9999;
    max-width: 360px;
    color: var(--text-main);
}

.toast.success {
    border-left: 3px solid #2E7D32;
}

.toast.error {
    border-left: 3px solid var(--primary);
}

.toast.warning {
    border-left: 3px solid #F9A825;
}

/* Loading states */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Focus styles mejorados */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 3px solid var(--primary-light);
    outline-offset: 3px;
}

/* Badges con animación */
.badge {
    transition: transform 0.2s, box-shadow 0.2s;
}


/* Mejoras de accesibilidad */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Smooth transitions en todos los elementos interactivos */
a,
button,
.card,
.badge,
.social-btn,
.nav-item,
input,
textarea,
select {
    transition: all 0.2s ease;
}


/* ==========================================
   MODALES Y NUEVAS ACCIONES
   ========================================== */

.card-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
}

.action-icon {
    font-size: 1.1rem;
    opacity: 0.6;
    transition: opacity 0.2s, transform 0.2s;
}

.card-actions:hover .action-icon {
    opacity: 0.4;
}

.card-actions .action-icon:hover {
    opacity: 1;
    transform: scale(1.2);
}

.versions-icon {
    cursor: pointer;
    color: var(--primary);
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

/* Modal Content */
.modal-content {
    background: var(--surface);
    width: 100%;
    max-width: 500px;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: scaleIn 0.2s ease-out;
    overflow: hidden;
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--text-sub);
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-main);
}

.modal-body {
    padding: 20px;
}

/* Options Grid */
.project-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.option-card {
    text-decoration: none;
    color: inherit;
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 20px 14px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: border-color 0.2s ease;
}

.option-card:hover {
    border-color: var(--primary);
}

.option-card.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.option-card.disabled:hover {
    border-color: var(--border);
}

.option-icon {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.option-label {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 4px;
    color: var(--text-main);
}

.option-desc {
    font-size: 0.8rem;
    color: var(--text-sub);
}

/* Versions Grid */
.versions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.version-item {
    text-decoration: none;
    color: inherit;
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 12px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
    font-weight: 600;
}

.version-item:hover {
    border-color: var(--primary);
    background: var(--surface);
    transform: translateX(4px);
}

/* ==========================================
   WIDGETS (CMS)
   ========================================== */

/* Hero Widget */
.hero-widget {
    background: var(--surface);
    border-radius: 12px;
    padding: 48px 32px;
    margin-bottom: 32px;
    text-align: center;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 320px;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    object-fit: cover;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.1;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 600px;
}

.hero-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--primary-dark);
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-sub);
    margin-bottom: 24px;
    line-height: 1.6;
}

.hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    font-weight: 600;
    border-radius: 8px;
    transition: background 0.2s ease;
    font-size: 1rem;
}

.hero-btn:hover {
    background: var(--primary-dark);
}

/* Stats Widget */
.stats-widget {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-item {
    background: var(--surface);
    padding: 24px;
    border-radius: 10px;
    border: 1px solid var(--border);
    text-align: center;
    transition: box-shadow 0.2s ease;
}

.stat-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 6px;
    line-height: 1;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-sub);
    font-weight: 500;
}

/* Text Widget */
.text-widget {
    margin-bottom: 40px;
    color: var(--text-main);
    line-height: 1.8;
}

.text-widget h2 { margin-bottom: 20px; font-size: 2rem; }
.text-widget p { margin-bottom: 16px; }

/* Call to Action Widget */
.cta-widget {
    background: var(--primary);
    border-radius: 12px;
    padding: 40px 32px;
    margin-bottom: 32px;
    text-align: center;
    color: white;
}

.cta-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.cta-text {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 20px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.cta-btn {
    background: white;
    color: var(--primary-dark);
    padding: 10px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    transition: opacity 0.2s ease;
}

.cta-btn:hover {
    opacity: 0.9;
}

/* Spacer */
.spacer-widget { width: 100%; }

/* Investigaciones Widget */
.investigaciones-widget {
    margin-bottom: 40px;
}

.investigaciones-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.investigacion-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.3s ease;
    position: relative;
}

.investigacion-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

.investigacion-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}

.investigacion-fecha {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
    padding: 4px 12px;
    border-radius: 12px;
}

.investigacion-titulo {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 12px;
    line-height: 1.4;
}

.investigacion-descripcion {
    color: var(--text-sub);
    line-height: 1.6;
    margin-bottom: 16px;
}

.investigacion-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.investigacion-link:hover {
    color: var(--primary-dark);
    gap: 8px;
}

/* Proyectos por Fondos Widget */
.proyectos-fondos-widget {
    margin-bottom: 40px;
}

.fondo-tipo-section {
    margin-bottom: 48px;
}

.fondo-tipo-titulo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--primary);
    display: inline-block;
}

.proyectos-fondos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.proyecto-fondo-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}

.proyecto-fondo-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    border-color: var(--primary);
}

.proyecto-fondo-titulo {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 10px;
    line-height: 1.3;
}

.proyecto-fondo-descripcion {
    color: var(--text-sub);
    line-height: 1.5;
    margin-bottom: 14px;
    font-size: 0.95rem;
}

.proyecto-fondo-monto {
    background: rgba(59, 130, 246, 0.08);
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    display: inline-block;
}

.monto-label {
    font-size: 0.85rem;
    color: var(--text-sub);
    font-weight: 500;
}

.monto-value {
    font-size: 0.95rem;
    color: var(--primary);
    font-weight: 700;
}

.proyecto-fondo-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.proyecto-fondo-link:hover {
    color: var(--primary-dark);
    gap: 8px;
}

.no-proyectos {
    color: var(--text-sub);
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* Noticias Widget */
.noticias-widget {
    margin-bottom: 40px;
}

.noticias-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
}

.noticia-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.noticia-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
    border-color: var(--primary);
}

.noticia-imagen {
    width: 100%;
    height: 200px;
    background-size: cover;
    background-position: center;
    background-color: var(--bg);
}

.noticia-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.noticia-fecha {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
    padding: 4px 12px;
    border-radius: 12px;
    display: inline-block;
    width: fit-content;
    margin-bottom: 12px;
}

.noticia-titulo {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 12px;
    line-height: 1.3;
}

.noticia-contenido {
    color: var(--text-sub);
    line-height: 1.6;
    margin-bottom: 16px;
    flex: 1;
}

.noticia-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    align-self: flex-start;
}

.noticia-link:hover {
    color: var(--primary-dark);
    gap: 8px;
}

/* Galería Widget */
.galeria-widget {
    margin-bottom: 40px;
}

.galeria-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.galeria-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.galeria-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

.galeria-imagen-wrapper {
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: var(--bg);
}

.galeria-imagen {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.galeria-item:hover .galeria-imagen {
    transform: scale(1.05);
}

.galeria-info {
    padding: 16px;
}

.galeria-titulo {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
}

.galeria-descripcion {
    font-size: 0.9rem;
    color: var(--text-sub);
    line-height: 1.5;
}

/* Navigation Menu */
.lab-nav {
    display: flex;
    gap: 8px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
    justify-content: center;
}

.lab-nav-link {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 8px 14px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.lab-nav-link .nav-icon {
    font-size: 1rem;
}

.lab-nav-link:hover {
    background: var(--primary);
    color: white;
}

@media (max-width: 768px) {
    .lab-nav {
        gap: 6px;
    }

    .lab-nav-link {
        font-size: 0.85rem;
        padding: 6px 12px;
    }
}

/* Floating Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
    z-index: 100;
    border: none;
    cursor: pointer;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--primary-dark);
}

/* ==========================================
   FOOTER
   ========================================== */

.site-footer {
    text-align: center;
    padding: 32px 20px;
    color: var(--text-sub);
    font-size: 0.875rem;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.site-footer p {
    margin-bottom: 12px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.footer-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.footer-link:hover {
    text-decoration: underline;
}

/* PROJECT PILL (Team Association) */
.project-count-pill {
    background: #f0f9ff;
    color: #0369a1;
    font-size: 0.75rem;
    padding: 4px 12px;
    border-radius: 20px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    border: 1px solid #bae6fd;
    transition: all 0.2s ease;
    margin-top: 4px;
}

.project-count-pill:hover {
    background: #e0f2fe;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.project-count-pill svg {
    width: 14px;
    height: 14px;
}

/* MODAL LIST STYLES (Frontend) */
.modal-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.modal-list-item {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-main);
}

.modal-list-item:last-child {
    border-bottom: none;
}

.modal-list-item::before {
    content: '🚀';
    font-size: 1rem;
}

/* Archivo Widget */
.archivo-widget {
    margin-bottom: 40px;
}

.archivo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.archivo-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: all 0.3s ease;
}

.archivo-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

.archivo-icon {
    font-size: 2rem;
    background: var(--bg);
    padding: 10px;
    border-radius: 12px;
    flex-shrink: 0;
}

.archivo-content {
    flex: 1;
    min-width: 0;
}

.archivo-titulo {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 6px;
    line-height: 1.3;
}

.archivo-descripcion {
    font-size: 0.9rem;
    color: var(--text-sub);
    line-height: 1.5;
    margin-bottom: 12px;
}

.archivo-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    background: rgba(59, 130, 246, 0.08);
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s;
}

.archivo-link:hover {
    background: var(--primary);
    color: white;
}
