/* ============================================================================
   MEGA MENU V1.0 - "THE COCKPIT"
   Menu flutuante premium acionado pelo avatar do header.
   ============================================================================ */

/* Container Principal (Glassmorphism) */
.mega-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal-backdrop);
    background: rgba(0, 0, 0, 0.4);
    /* Dimmed bg */
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mega-menu-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.mega-menu-container {
    position: fixed;
    top: 80px;
    /* Abaixo do header */
    right: 24px;
    width: 900px;
    max-width: 90vw;
    min-height: 400px;

    background: rgba(20, 20, 20, 0.85);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);

    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    box-shadow:
        0 24px 48px -12px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);

    z-index: var(--z-modal);
    transform: translateY(-20px) scale(0.98);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);

    display: grid;
    grid-template-columns: 280px 1fr 280px;
    /* Profile | Quick Actions | Clients */
    overflow: hidden;
}

.mega-menu-backdrop.active .mega-menu-container {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
}

/* ========================================
   COLUNA 1: PERFIL & PLANO
   ======================================== */
.mm-col-profile {
    background: rgba(0, 0, 0, 0.2);
    padding: 32px;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.mm-user-info {
    text-align: center;
}

.mm-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--gradient-primary);
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 0 20px rgba(var(--color-primary-rgb), 0.4);
}

.mm-name {
    font-family: var(--font-primary);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.mm-email {
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

.mm-plan-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
}

.mm-plan-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.mm-plan-value {
    font-family: var(--font-primary);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-secondary);
    text-shadow: 0 0 12px rgba(var(--color-secondary-rgb), 0.4);
}

/* ========================================
   COLUNA 2: CONFIGURAÇÕES RÁPIDAS
   ======================================== */
.mm-col-actions {
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.mm-section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.mm-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    color: var(--text-primary);
    transition: all 0.2s ease;
    cursor: pointer;
}

.mm-action-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--color-primary);
    transform: translateY(-2px);
}

.mm-action-icon {
    width: 32px;
    height: 32px;
    color: var(--color-primary);
}

/* ========================================
   COLUNA 3: CLIENT SWITCHER
   ======================================== */
.mm-col-clients {
    background: rgba(0, 0, 0, 0.2);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
}

.mm-clients-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mm-clients-list {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
    max-height: 400px;
}

.mm-client-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.mm-client-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.mm-client-item.active {
    background: rgba(var(--color-primary-rgb), 0.1);
    color: var(--color-primary);
    border: 1px solid rgba(var(--color-primary-rgb), 0.2);
}

.mm-client-avatar {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

/* ========================================
   LIGHT MODE OVERRIDES
   ======================================== */
[data-mode="light"] .mega-menu-container {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 24px 64px -12px rgba(0, 0, 0, 0.2);
}

[data-mode="light"] .mm-col-profile,
[data-mode="light"] .mm-col-clients {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.06);
}

[data-mode="light"] .mm-plan-card {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

[data-mode="light"] .mm-action-btn {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}

[data-mode="light"] .mm-action-btn:hover {
    background: #fafafa;
    border-color: var(--color-primary);
}

[data-mode="light"] .mm-client-item:hover {
    background: rgba(0, 0, 0, 0.05);
}