/* =========================================================
   LAUNCHPAD CENTRAL — LIENZO INMERSIVO DE APLICACIONES
   Inspirado en Core FAB: nodos flotantes sobre fondo difuminado,
   sin cajas anidadas ni tarjetas sobre tarjetas.
   ========================================================= */

/* Telón de fondo independiente con desenfoque de pantalla completa (evita parpadeos en Blink al desacoplar el shader) */
.launchpad-backdrop {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    background: rgba(var(--color-scrim-rgb), 0.72);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateZ(0);
    will-change: opacity;
}

.launchpad-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

/* Lienzo de pantalla completa para nodos interactivos */
.launchpad-canvas {
    position: fixed;
    inset: 0;
    z-index: calc(var(--z-modal) + 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
    -webkit-user-select: none;
    transform: translateZ(0);
}

.launchpad-canvas.is-open {
    opacity: 1;
    pointer-events: auto;
}

/* Botón flotante de cierre en la esquina superior */
.launchpad-floating-close {
    position: absolute;
    top: var(--space-6);
    right: var(--space-8);
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    color: var(--color-sheen);
    background: rgba(var(--color-surface-rgb), 0.18);
    border: 1px solid rgba(var(--color-sheen-rgb), 0.15);
    border-radius: var(--radius-full);
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(var(--color-scrim-rgb), 0.3);
    transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1),
                background-color 0.15s ease,
                border-color 0.15s ease;
}

.launchpad-floating-close:hover {
    transform: scale(1.12);
    background: rgba(var(--color-surface-rgb), 0.35);
    border-color: rgba(var(--color-sheen-rgb), 0.3);
}

/* Escenario central que alberga los elementos flotantes */
.launchpad-stage {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1100px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-6) var(--space-8);
    overflow-y: auto;
    scrollbar-width: none;
    transform: scale(0.96);
    transition: transform 0.28s cubic-bezier(0.34, 1.35, 0.64, 1);
}

.launchpad-stage::-webkit-scrollbar {
    display: none;
}

.launchpad-canvas.is-open .launchpad-stage {
    transform: scale(1);
}

/* Barra de búsqueda flotante tipo píldora (sin caja de cabecera) */
.launchpad-search-pill {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 480px;
    height: 48px;
    margin-bottom: var(--space-6);
    background: rgba(var(--color-surface-rgb), 0.28);
    border: 1px solid rgba(var(--color-sheen-rgb), 0.2);
    border-radius: var(--radius-full);
    box-shadow: 0 8px 32px rgba(var(--color-scrim-rgb), 0.35);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.launchpad-search-pill:focus-within {
    background: rgba(var(--color-surface-rgb), 0.3);
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 30%, transparent),
                0 12px 36px rgba(var(--color-scrim-rgb), 0.45);
}

.launchpad-search-glyph {
    position: absolute;
    left: var(--space-5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-sheen);
    opacity: 0.75;
    pointer-events: none;
}

.launchpad-search-field {
    width: 100%;
    height: 100%;
    padding: 0 var(--space-16) 0 var(--space-12);
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    color: var(--color-sheen);
    background: transparent;
    border: none;
    outline: none;
}

.launchpad-search-field::placeholder {
    color: color-mix(in srgb, var(--color-sheen) 55%, transparent);
}

.launchpad-esc-badge {
    position: absolute;
    right: var(--space-4);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 22px;
    padding: 0 var(--space-2);
    font-family: var(--font-family-mono);
    font-size: var(--font-size-xs);
    font-weight: 700;
    color: color-mix(in srgb, var(--color-sheen) 75%, transparent);
    background: rgba(var(--color-sheen-rgb), 0.12);
    border: 1px solid rgba(var(--color-sheen-rgb), 0.18);
    border-radius: var(--radius-sm);
    pointer-events: none;
}

/* HUD Hero Central Flotante (estilo Core FAB) */
.launchpad-hud {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: var(--space-8);
    min-height: 56px;
    transition: opacity 0.15s ease;
}

.launchpad-hud-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--color-sheen);
    letter-spacing: 0.02em;
    text-shadow: 0 2px 12px rgba(var(--color-scrim-rgb), 0.8);
    margin: 0 0 var(--space-1) 0;
    transition: color 0.18s ease;
}

.launchpad-hud-desc {
    font-size: var(--font-size-sm);
    font-weight: 400;
    color: color-mix(in srgb, var(--color-sheen) 75%, transparent);
    text-shadow: 0 1px 6px rgba(var(--color-scrim-rgb), 0.8);
    margin: 0;
    max-width: 640px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.18s ease;
}

/* Rejilla de nodos flotantes (SIN tarjetas, SIN marcos, SIN cajas) */
.launchpad-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: var(--space-8) var(--space-6);
    justify-items: center;
    width: 100%;
    padding: var(--space-2) 0;
}

/* Nodo individual de aplicación */
.launchpad-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    background: transparent;
    border: none;
    outline: none;
    cursor: pointer;
    width: 110px;
    padding: var(--space-2) 0;
    transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Disco esférico flotante (estilo Core FAB .corner-item-shape) */
.launchpad-disc {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 68px;
    height: 68px;
    border-radius: var(--radius-full);
    background: color-mix(in srgb, var(--color-surface) 65%, transparent);
    border: 1px solid rgba(var(--color-sheen-rgb), 0.18);
    box-shadow: 0 8px 24px rgba(var(--color-scrim-rgb), 0.4);
    color: var(--color-sheen);
    transition: transform 0.24s cubic-bezier(0.34, 1.56, 0.64, 1),
                background-color 0.2s ease,
                box-shadow 0.22s ease,
                border-color 0.2s ease;
}

.launchpad-disc-svg {
    display: block;
    width: 30px;
    height: 30px;
    stroke: currentColor;
    filter: drop-shadow(0 2px 4px rgba(var(--color-scrim-rgb), 0.5));
    transition: transform 0.2s ease;
}

.launchpad-disc-emoji {
    font-size: var(--font-size-2xl);
    line-height: 1;
}

/* Etiqueta de texto flotante debajo del icono */
.launchpad-label {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-sheen);
    text-shadow: 0 2px 8px rgba(var(--color-scrim-rgb), 0.9);
    margin-top: var(--space-3);
    text-align: center;
    max-width: 110px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.01em;
    transition: color 0.18s ease, transform 0.18s ease;
}

/* Micro-interacción: Hover / Focus (Aura de luz e inflación estilo Core FAB) */
.launchpad-item:hover .launchpad-disc,
.launchpad-item:focus-visible .launchpad-disc,
.launchpad-item.is-active .launchpad-disc {
    transform: scale(1.18);
    background: var(--color-primary);
    border-color: rgba(var(--color-sheen-rgb), 0.4);
    box-shadow: 0 0 36px var(--color-primary), 0 14px 32px rgba(var(--color-scrim-rgb), 0.6);
    color: var(--color-sheen);
}

.launchpad-item:hover .launchpad-disc-svg,
.launchpad-item:focus-visible .launchpad-disc-svg,
.launchpad-item.is-active .launchpad-disc-svg {
    transform: scale(1.1);
}

.launchpad-item:hover .launchpad-label,
.launchpad-item:focus-visible .launchpad-label,
.launchpad-item.is-active .launchpad-label {
    color: var(--color-sheen);
    font-weight: 600;
    transform: translateY(2px);
}

/* Estado de búsqueda vacía flotante */
.launchpad-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-12) var(--space-4);
    text-align: center;
}

.launchpad-empty-disc {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: var(--radius-full);
    background: rgba(var(--color-sheen-rgb), 0.1);
    color: color-mix(in srgb, var(--color-sheen) 75%, transparent);
    border: 1px solid rgba(var(--color-sheen-rgb), 0.15);
    margin-bottom: var(--space-4);
    box-shadow: 0 8px 24px rgba(var(--color-scrim-rgb), 0.35);
}

.launchpad-empty-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--color-sheen);
    margin: 0 0 var(--space-2) 0;
}

.launchpad-empty-desc {
    font-size: var(--font-size-base);
    color: color-mix(in srgb, var(--color-sheen) 70%, transparent);
    margin: 0 0 var(--space-6) 0;
    max-width: 440px;
}

.launchpad-empty-clear-btn {
    padding: var(--space-2) var(--space-5);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-sheen);
    background: rgba(var(--color-sheen-rgb), 0.14);
    border: 1px solid rgba(var(--color-sheen-rgb), 0.25);
    border-radius: var(--radius-full);
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(var(--color-scrim-rgb), 0.3);
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.launchpad-empty-clear-btn:hover {
    background: var(--color-primary);
    transform: scale(1.05);
}

/* Responsividad según tokens de breakpoint */
@media (max-width: 768px) {
    .launchpad-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--space-6) var(--space-4);
    }

    .launchpad-floating-close {
        top: var(--space-4);
        right: var(--space-4);
    }

    .launchpad-stage {
        padding: var(--space-4);
    }
}

@media (max-width: 640px) {
    .launchpad-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-5) var(--space-3);
    }

    .launchpad-disc {
        width: 58px;
        height: 58px;
    }

    .launchpad-disc-svg {
        width: 26px;
        height: 26px;
    }

    .launchpad-esc-badge {
        display: none;
    }
}
