/* CINCO Hub - App Launcher | Minimal Elevated */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --cinco-primary: #6366f1;
    --cinco-primary-soft: #eef2ff;
    --cinco-accent: #818cf8;
    --cinco-bg-start: #f8fafc;
    --cinco-bg-end: #eef2ff;
    --cinco-card-bg: rgba(255, 255, 255, 0.7);
    --cinco-card-bg-hover: rgba(255, 255, 255, 0.95);
    --cinco-text: #0f172a;
    --cinco-text-muted: #94a3b8;
    --cinco-border: rgba(99, 102, 241, 0.06);
    --cinco-border-hover: rgba(99, 102, 241, 0.15);
    --cinco-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    --cinco-shadow-hover: 0 4px 12px rgba(99, 102, 241, 0.1);
    --cinco-radius: 16px;
    --cinco-transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
    height: 100%;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--cinco-text);
}

body {
    background: linear-gradient(145deg, var(--cinco-bg-start) 0%, var(--cinco-bg-end) 50%, var(--cinco-bg-start) 100%);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Ambient background blobs */
body::before,
body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
    pointer-events: none;
    z-index: 0;
}

body::before {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #c7d2fe 0%, transparent 70%);
    top: -120px;
    right: -100px;
}

body::after {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #e0e7ff 0%, transparent 70%);
    bottom: -80px;
    left: -80px;
}

/* Layout principal */
.cinco-hub {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 36px 20px 30px;
    position: relative;
    z-index: 1;
}

/* Header / Hero Card */
.cinco-header {
    position: relative;
    width: 100%;
    max-width: 720px;
    margin-bottom: 36px;
    padding: 32px 40px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(99, 102, 241, 0.08);
    border-radius: 20px;
    overflow: hidden;
    animation: headerReveal 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Gradient accent line at top */
.cinco-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, #818cf8, #a78bfa, #818cf8, #6366f1);
    background-size: 200% 100%;
    animation: gradientShift 6s ease infinite;
}

/* Subtle glow behind header */
.cinco-header::after {
    content: '';
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 80px;
    background: radial-gradient(ellipse, rgba(99, 102, 241, 0.12) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes headerReveal {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cinco-header-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
}

/* Boton Admin */
.cinco-admin-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: var(--cinco-text-muted);
    transition: all var(--cinco-transition);
    text-decoration: none;
}

.cinco-admin-btn:hover {
    color: var(--cinco-primary);
    background: rgba(99, 102, 241, 0.08);
}

.cinco-logo {
    width: 72px;
    height: auto;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 8px rgba(99, 102, 241, 0.15));
}

.cinco-header-text {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cinco-brand {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 0.08em;
    background: linear-gradient(135deg, #4f46e5, #6366f1, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
}

.cinco-divider {
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, var(--cinco-primary), transparent);
    border-radius: 1px;
}

.cinco-title {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: var(--cinco-text-muted);
    line-height: 1.4;
}

/* Tabs de categorias */
.cinco-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--cinco-border);
    border-radius: 12px;
    margin-bottom: 32px;
    flex-wrap: wrap;
    justify-content: center;
}

.cinco-tab {
    padding: 10px 22px;
    border: none;
    background: transparent;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--cinco-text-muted);
    cursor: pointer;
    border-radius: 8px;
    transition: all var(--cinco-transition);
    white-space: nowrap;
}

.cinco-tab:hover {
    color: var(--cinco-primary);
    background: rgba(99, 102, 241, 0.05);
}

.cinco-tab.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--cinco-primary);
    font-weight: 600;
}

/* Grid de cards */
.cinco-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    justify-content: center;
    max-width: 720px;
    width: 100%;
}

/* Panel de categoria (show/hide) */
.cinco-panel {
    display: none;
    width: 100%;
    max-width: 720px;
}

.cinco-panel.active {
    display: block;
    animation: panelFadeIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes panelFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Card de modulo */
.cinco-card {
    background: var(--cinco-card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--cinco-radius);
    padding: 28px 16px 22px;
    text-align: center;
    box-shadow: var(--cinco-shadow);
    cursor: pointer;
    transition: all var(--cinco-transition);
    text-decoration: none;
    color: var(--cinco-text);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--cinco-border);
    position: relative;
    overflow: hidden;
}

.cinco-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--cinco-shadow-hover);
    background: var(--cinco-card-bg-hover);
    border-color: var(--cinco-border-hover);
    color: var(--cinco-text);
    text-decoration: none;
}

.cinco-card:active {
    transform: scale(0.95);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    transition-duration: 0.1s;
}

/* Click flash — brief glow on the entire card */
.cinco-card.cinco-card--clicked {
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.15), 0 4px 12px rgba(99, 102, 241, 0.1);
    background: rgba(238, 242, 255, 0.9);
}

/* Ripple effect */
.cinco-card .cinco-ripple {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.4) 0%, rgba(99, 102, 241, 0.15) 40%, transparent 70%);
    transform: scale(0);
    animation: rippleExpand 0.65s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
    pointer-events: none;
    z-index: 1;
}

@keyframes rippleExpand {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
    100% {
        transform: scale(3);
        opacity: 0;
    }
}

.cinco-card-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    flex-shrink: 0;
}

.cinco-card-name {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--cinco-text);
}

/* Stagger animation for cards */
.cinco-panel.active .cinco-card {
    animation: cardStagger 0.4s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

.cinco-panel.active .cinco-card:nth-child(1) { animation-delay: 0.03s; }
.cinco-panel.active .cinco-card:nth-child(2) { animation-delay: 0.06s; }
.cinco-panel.active .cinco-card:nth-child(3) { animation-delay: 0.09s; }
.cinco-panel.active .cinco-card:nth-child(4) { animation-delay: 0.12s; }
.cinco-panel.active .cinco-card:nth-child(5) { animation-delay: 0.15s; }
.cinco-panel.active .cinco-card:nth-child(6) { animation-delay: 0.18s; }

@keyframes cardStagger {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Footer */
.cinco-footer {
    margin-top: auto;
    padding-top: 48px;
    font-size: 12px;
    color: var(--cinco-text-muted);
    letter-spacing: 0.03em;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .cinco-panel.active,
    .cinco-panel.active .cinco-card {
        animation: none;
    }

    .cinco-card:hover,
    .cinco-card:active {
        transform: none;
    }

    .cinco-card .cinco-ripple {
        animation: none;
    }

    .cinco-header {
        animation: none;
    }

    .cinco-header::before {
        animation: none;
    }
}

/* Responsive */
@media screen and (max-width: 700px) {
    .cinco-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 420px;
    }

    .cinco-header {
        padding: 24px 20px;
    }

    .cinco-header-inner {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .cinco-header-text {
        align-items: center;
    }

    .cinco-brand {
        font-size: 24px;
    }

    .cinco-admin-btn {
        top: 12px;
        right: 12px;
    }
}

@media screen and (max-width: 440px) {
    .cinco-hub {
        padding: 24px 16px 20px;
    }

    .cinco-tabs {
        width: 100%;
    }

    .cinco-tab {
        padding: 8px 16px;
        font-size: 13px;
    }

    .cinco-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .cinco-header {
        padding: 20px 16px;
        border-radius: 16px;
    }

    .cinco-logo {
        width: 56px;
    }

    .cinco-brand {
        font-size: 20px;
    }

    .cinco-card {
        padding: 22px 12px 18px;
    }

    .cinco-card-logo {
        width: 52px;
        height: 52px;
    }

    body::before,
    body::after {
        opacity: 0.2;
    }
}
