/* 🛸 Alien SaaS Empresarial Brand: Premium Design System (v10.0) */

:root {
    /* Core HSL Colors - Precise Control */
    --hue-primary: 184;
    --hue-secondary: 282;
    --hue-accent: 152;
    
    --clr-primary: hsl(var(--hue-primary), 100%, 50%);         /* #00f2ff */
    --clr-secondary: hsl(var(--hue-secondary), 98%, 54%);     /* #bc13fe */
    --clr-accent: hsl(var(--hue-accent), 100%, 50%);          /* #00ff88 */
    
    /* Surfaces & Elevations */
    --bg-obsidian: hsl(240, 10%, 2%);
    --bg-surface-1: hsla(240, 10%, 5%, 0.8);
    --bg-surface-2: hsla(240, 10%, 10%, 0.9);
    --bg-glass: hsla(0, 0%, 100%, 0.03);
    
    /* Borders & Glows */
    --border-glass: hsla(0, 0%, 100%, 0.08);
    --border-glow: hsla(var(--hue-primary), 100%, 50%, 0.3);
    
    /* Dynamic Shadows */
    --shadow-sm: 0 2px 8px hsla(0, 0%, 0%, 0.4);
    --shadow-md: 0 8px 24px hsla(0, 0%, 0%, 0.6);
    --shadow-neon: 0 0 20px hsla(var(--hue-primary), 100%, 50%, 0.2);
    --shadow-neon-deep: 0 0 40px hsla(var(--hue-primary), 100%, 50%, 0.15);

    /* Typography Scale (Fluid) */
    --font-main: 'Outfit', sans-serif;
    --font-display: 'Outfit', sans-serif;
    --text-xs: clamp(0.7rem, 0.65rem + 0.25vw, 0.8rem);
    --text-sm: clamp(0.8rem, 0.75rem + 0.25vw, 0.9rem);
    --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.1rem);
    --text-lg: clamp(1.2rem, 1.1rem + 0.5vw, 1.5rem);
    --text-xl: clamp(1.8rem, 1.6rem + 1vw, 2.5rem);
    
    /* Z-INDEX */
    --z-nav: 1000;
    --z-modal: 2000;
    
    /* SPACING */
    --section-pady: 120px;
    
    --transition-smooth: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    
    /* Portal Specific */
    --bg-dark: #050505;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-obsidian);
    background-image: 
        radial-gradient(circle at 0% 0%, hsla(var(--hue-primary), 30%, 10%, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, hsla(var(--hue-secondary), 30%, 10%, 0.1) 0%, transparent 50%);
    color: hsl(0, 0%, 95%);
    font-family: var(--font-main);
    margin: 0;
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

/* --- Premium Components --- */

/* Glass Cards Legacy & New */
.card, .glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: 24px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 100%;
    background: linear-gradient(135deg, hsla(0, 0%, 100%, 0.05) 0%, transparent 100%);
    pointer-events: none;
}

.card:hover {
    transform: translateY(-4px);
    border-color: hsla(var(--hue-primary), 100%, 50%, 0.4);
    box-shadow: var(--shadow-neon-deep);
}

/* Typography Enhancements */
.alien-font {
    font-family: var(--font-main);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    background: linear-gradient(to right, #fff, var(--clr-primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px hsla(var(--hue-primary), 100%, 50%, 0.3));
}

/* Buttons Level 10 */
.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    border-radius: 100px;
    background: linear-gradient(135deg, var(--clr-primary), var(--clr-accent));
    color: #000;
    font-weight: 700;
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    cursor: pointer;
    overflow: hidden;
    transition: var(--transition-smooth);
    z-index: 1;
}

.btn::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, #fff, transparent);
    opacity: 0;
    transition: var(--transition-smooth);
    z-index: -1;
}

.btn:hover {
    transform: scale(1.02);
    box-shadow: 0 0 30px hsla(var(--hue-primary), 100%, 50%, 0.4);
}

.btn:hover::after {
    opacity: 0.2;
}

.btn-secondary {
    background: linear-gradient(135deg, var(--clr-secondary), #7e22ce);
    color: #fff;
}

/* Input Styles Premium */
input, select {
    width: 100%;
    background: hsla(0, 0%, 100%, 0.05);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 14px 20px;
    color: #fff;
    font-family: var(--font-main);
    font-size: var(--text-base);
    transition: var(--transition-smooth);
}

input:focus {
    outline: none;
    border-color: var(--clr-primary);
    background: hsla(0, 0%, 100%, 0.08);
    box-shadow: 0 0 15px hsla(var(--hue-primary), 100%, 50%, 0.1);
}

/* Progress Bars */
.progress-container {
    background: hsla(0, 0%, 100%, 0.05);
    border-radius: 100px;
    height: 8px;
    width: 100%;
    overflow: hidden;
    margin: 12px 0;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--clr-primary), var(--clr-accent));
    border-radius: 100px;
    box-shadow: 0 0 12px hsla(var(--hue-primary), 100%, 50%, 0.5);
    transition: width 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Utilities */
.text-gradient {
    background: linear-gradient(135deg, var(--clr-primary), var(--clr-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.container-mobile {
    max-width: 480px;
    margin: 0 auto;
    padding: 24px;
}

/* LANDING PAGE SPECIFICS */
.section {
    padding: var(--section-pady) 0;
}

.text-gradient {
    background: linear-gradient(135deg, #fff 0%, var(--clr-primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.benefit-card {
    background: var(--bg-surface-1);
    padding: 40px;
    border-radius: 32px;
    border: 1px solid var(--border-glass);
    transition: var(--transition-smooth);
}

.benefit-card:hover {
    transform: translateY(-10px);
    border-color: var(--clr-primary);
    box-shadow: var(--shadow-neon);
}

.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 48px;
}

.comp-item {
    padding: 32px;
    border-radius: 24px;
    background: hsla(0, 0%, 100%, 0.02);
    border: 1px solid var(--border-glass);
}

.comp-item.positive {
    border-color: hsla(var(--hue-primary), 100%, 50%, 0.3);
    background: hsla(var(--hue-primary), 100%, 50%, 0.03);
}

.comp-item h4 {
    margin-bottom: 12px;
    color: var(--clr-primary);
}

.cta-banner {
    background: linear-gradient(135deg, hsla(var(--hue-primary), 100%, 50%, 0.1), hsla(var(--hue-secondary), 100%, 50%, 0.1));
    padding: 80px;
    border-radius: 48px;
    text-align: center;
    border: 1px solid var(--border-glass);
    position: relative;
    overflow: hidden;
}

.cta-banner::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle, hsla(var(--hue-primary), 100%, 50%, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

/* Staggered Entrance Animations */
@keyframes slideUpFade {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-in {
    animation: slideUpFade 0.6s cubic-bezier(0.23, 1, 0.32, 1) forwards;
    opacity: 0;
}

/* Badge Premium */
.badge {
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    background: hsla(var(--hue-secondary), 98%, 54%, 0.2);
    color: var(--clr-secondary);
    border: 1px solid hsla(var(--hue-secondary), 98%, 54%, 0.2);
}



/* UTILITIES: DASHBOARD LAYOUT (3 COLUMNS) */
.dashboard-layout {
    display: grid;
    grid-template-columns: 300px 1fr 300px;
    gap: 20px;
    padding: 20px;
    min-height: calc(100vh - 80px);
}

.dash-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.dash-main {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.dash-utils {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Sidebar Nav Items */
.nav-group {
    margin-bottom: 32px;
}

.nav-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 16px;
    padding-left: 12px;
}

.nav-item {
    padding: 12px 16px;
    border-radius: 12px;
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
}

.nav-item:hover, .nav-item.active {
    background: hsla(var(--hue-primary), 100%, 50%, 0.1);
    border-color: hsla(var(--hue-primary), 100%, 50%, 0.2);
    color: var(--clr-primary);
}

/* Utility Components */
.mini-calendar {
    aspect-ratio: 1;
    background: hsla(0, 0%, 100%, 0.02);
    border-radius: 20px;
    padding: 16px;
    font-size: 0.8rem;
}

.network-graph-container {
    height: 300px;
    background: hsla(0, 0%, 100%, 0.02);
    border-radius: 24px;
    position: relative;
    overflow: hidden;
}

/* Responsive Overrides */
@media (max-width: 1150px) {
    .dashboard-layout {
        grid-template-columns: 280px 1fr;
    }
    .dash-utils {
        grid-column: span 2;
        flex-direction: row;
        flex-wrap: wrap;
    }
    .dash-utils > * {
        flex: 1;
        min-width: 300px;
    }
}

@media (max-width: 900px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }
    .dash-sidebar, .dash-utils {
        grid-column: span 1;
    }
    .dash-utils {
        flex-direction: column;
    }
}

/* 🌀 Galactic Typography System */
.font-outfit { font-family: 'Outfit', sans-serif; }
.font-orbitron { font-family: 'Orbitron', sans-serif; }
.font-space { font-family: 'Space Grotesk', sans-serif; }

/* 🌟 Aura & Glow Effects */
.aura-pulsing {
    box-shadow: 0 0 20px var(--clr-primary);
    animation: pulseAura 3s infinite ease-in-out;
}

@keyframes pulseAura {
    0% { box-shadow: 0 0 10px var(--clr-primary); transform: scale(1); }
    50% { box-shadow: 0 0 35px var(--clr-primary); transform: scale(1.01); }
    100% { box-shadow: 0 0 10px var(--clr-primary); transform: scale(1); }
}

.text-glow {
    text-shadow: 0 0 10px var(--clr-primary);
}

/* 💳 Membership Card Enhancements */
.membership-card {
    background: linear-gradient(135deg, hsla(var(--hue-primary), 100%, 50%, 0.1), hsla(var(--hue-secondary), 100%, 50%, 0.1));
    border: 1px solid hsla(var(--hue-primary), 100%, 50%, 0.2);
    position: relative;
    z-index: 1;
}

.membership-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, transparent 40%, hsla(var(--hue-primary), 100%, 100%, 0.05), transparent 60%);
    animation: cardShine 5s infinite linear;
    z-index: -1;
}

@keyframes cardShine {
    0% { transform: translateX(-100%) translateY(-100%); }
    100% { transform: translateX(100%) translateY(100%); }
}

/* 📱 Portal Specific Components */
.portal-bg-effects {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.qr-wrapper {
    background: white;
    padding: 12px;
    border-radius: 20px;
    display: inline-block;
    margin: 20px 0;
    box-shadow: 0 0 30px hsla(var(--hue-primary), 100%, 50%, 0.4);
    transition: var(--transition-smooth);
}

.qr-wrapper:hover {
    transform: scale(1.05) rotate(2deg);
}

.history-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
    border-left: 2px solid var(--clr-primary);
    padding-left: 16px;
}

details {
    width: 100%;
    background: hsla(0, 0%, 100%, 0.02);
    border-radius: 12px;
    padding: 4px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

details[open] {
    background: hsla(0, 0%, 100%, 0.05);
}

summary {
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    font-size: var(--text-xs);
    color: var(--clr-primary);
    font-weight: 700;
}

.settings-btn {
    position: absolute;
    top: 24px;
    right: 24px;
    font-size: 1.2rem;
    opacity: 0.4;
    cursor: pointer;
    transition: opacity 0.3s;
}

.settings-btn:hover { opacity: 1; }

/* 💬 Chat Widget (Premium) */
.chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
}

.chat-fab {
    width: 64px;
    height: 64px;
    background: var(--clr-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: 0 0 30px hsla(var(--hue-primary), 100%, 50%, 0.4);
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chat-fab:hover {
    transform: scale(1.15) rotate(12deg);
}

.chat-window {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 380px;
    height: 550px;
    max-height: 80vh;
    background: var(--bg-surface-2);
    backdrop-filter: blur(30px);
    border: 1px solid var(--border-glass);
    border-radius: 32px;
    display: none;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-neon-deep);
    animation: slideInUp 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    z-index: 2001;
}

.chat-header {
    padding: 24px;
    background: hsla(0, 0%, 100%, 0.03);
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-messages {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scrollbar-width: thin;
    scrollbar-color: var(--clr-primary) transparent;
}

.chat-messages::-webkit-scrollbar {
    width: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--clr-primary);
    border-radius: 10px;
}

.msg {
    padding: 12px 18px;
    border-radius: 20px;
    max-width: 85%;
    font-size: 0.9rem;
    line-height: 1.5;
    position: relative;
    animation: msgIn 0.3s ease-out forwards;
}

@keyframes msgIn {
    from { opacity: 0; transform: translateY(10px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.msg-user {
    align-self: flex-end;
    background: var(--clr-primary);
    color: black;
    border-bottom-right-radius: 4px;
    font-weight: 500;
}

.msg-biz {
    align-self: flex-start;
    background: var(--bg-surface-1);
    border: 1px solid var(--border-glass);
    border-bottom-left-radius: 4px;
}

.chat-input-area {
    padding: 24px;
    background: hsla(0, 0%, 100%, 0.02);
    border-top: 1px solid var(--border-glass);
    display: flex;
    gap: 12px;
}

.chat-input {
    flex: 1;
    background: rgba(0,0,0,0.4);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 12px 16px;
    color: white;
    font-family: inherit;
    font-size: 0.95rem;
}

.chat-input:focus {
    border-color: var(--clr-primary);
    outline: none;
    box-shadow: 0 0 15px hsla(var(--hue-primary), 100%, 50%, 0.1);
}

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

/* 🖥️ Desktop Multi-Column Optimization */
@media (min-width: 1024px) {
    .container-mobile.portal-desktop {
        max-width: 1200px;
        padding: 40px;
    }
    
    .portal-grid {
        display: grid;
        grid-template-columns: 450px 1fr;
        gap: 40px;
        align-items: start;
    }

    .grid-left {
        position: sticky;
        top: 40px;
        display: flex;
        flex-direction: column;
        gap: 24px;
    }

    .grid-right {
        display: flex;
        flex-direction: column;
        gap: 32px;
    }

    #metricsContainer {
        grid-template-columns: 1fr !important; /* Stack inside column */
        margin-top: 0 !important;
    }
}


/* 🔒 Locked Features System */
.locked-feature {
    position: relative !important;
    overflow: hidden !important;
    filter: grayscale(0.8) opacity(0.5);
    pointer-events: none !important;
    user-select: none;
    transition: all 0.5s ease;
}

.locked-feature::after {
    content: '🔒 REQUIERE PLAN PRO';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-5deg);
    background: linear-gradient(135deg, #ffcc00, #ff8800);
    color: #000;
    padding: 6px 15px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 900;
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 2px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    z-index: 1000;
    white-space: nowrap;
    opacity: 1 !important;
}

.locked-feature:hover {
    filter: grayscale(0.4) opacity(0.7);
}
