/* ============================================================
   🤖 MentorSync — Sidebar + Menu + Modal
   - Botón flotante
   - Menú de opciones (tres puntos)
   - Modal de memoria
   - Light/Dark Mode con data-theme
============================================================ */

/* ============================================================
   SIDEBAR — BOTÓN FLOTANTE (CORREGIDO + CENTRADO)
============================================================ */
.mentorsync-sidebar {
    position: fixed;
    right: 1.5rem;

    /* 🔥 Centrado vertical perfecto */
    top: 50%;
    transform: translateY(-50%);

    width: 52px;
    height: 52px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 16px;
    cursor: pointer;
    z-index: 2147483646;

    border: 1px solid rgba(155, 140, 255, 0.45);
    background: linear-gradient(145deg, #1a1630 0%, #0C0A14 100%);
    box-shadow: 0 6px 16px rgba(12, 10, 20, 0.35);
    transition: transform .22s ease, box-shadow .22s ease;
    overflow: hidden;
}

.mentorsync-sidebar:hover {
    transform: translateY(-50%) translateY(-2px);
    box-shadow: 0 10px 22px rgba(110, 92, 230, 0.28);
}

.mentorsync-sidebar-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 14px;
    object-fit: cover;
    object-position: center 42%;
    user-select: none;
    pointer-events: none;
}

.mentorsync-sidebar-inner {
    width: 100%;
    height: 100%;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.mentorsync-sidebar-avatar-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    object-position: center 42%;
    display: block;
    margin: 0;
    border-radius: 14px;
    pointer-events: none;
    user-select: none;
}

.mentorsync-sidebar-avatar-img.is-broken {
    opacity: 0;
    width: 0;
    height: 0;
}

.mentorsync-sidebar-inner::before {
    content: "";
    display: none;
    width: 62%;
    height: 62%;
    border-radius: 999px;
    background: center / 70% no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 3a9 9 0 0 0-7.35 14.12L3 21l3.88-1.65A9 9 0 1 0 12 3Zm0 2a7 7 0 1 1 0 14 7 7 0 0 1 0-14Zm-2.2 4.5h4.4v1.6h-1.4v4.4h-1.6v-4.4H9.8V9.5Z'/%3E%3C/svg%3E");
}

.mentorsync-sidebar-inner.has-fallback-avatar .mentorsync-sidebar-avatar-img,
.mentorsync-sidebar-avatar-img.is-broken {
    display: none !important;
}

.mentorsync-sidebar-inner.has-fallback-avatar::after,
.mentorsync-sidebar-inner.is-fallback::after {
    content: "✦";
    font-size: 1.35rem;
    line-height: 1;
    color: #fff;
    font-weight: 700;
}

.mentorsync-sidebar-inner {
    width: 100% !important;
    height: 100% !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    padding: 0 !important;
    margin: 0 !important;

    line-height: 0 !important; /* 🔥 Bootstrap lo rompe */
}


/* ============================================================
   LIGHT MODE — SIDEBAR
============================================================ */
html[data-theme="light"] .mentorsync-sidebar {
    background: linear-gradient(135deg, #6e5ce6 0%, #9b8cff 55%, #e8789a 100%);
    box-shadow: 0 12px 28px rgba(110, 92, 230, 0.35);
}

html[data-theme="light"] .mentorsync-sidebar:hover {
    filter: brightness(1.1);
}

/* ============================================================
   DARK MODE — SIDEBAR
============================================================ */
html[data-theme="dark"] .mentorsync-sidebar {
    background: linear-gradient(135deg, #6e5ce6 0%, #9b8cff 50%, #e8789a 100%);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(155, 140, 255, 0.2);
}

html[data-theme="dark"] .mentorsync-sidebar:hover {
    filter: brightness(1.12);
}


.mentorsync-ai-menu-item {
    padding: 0.65rem 1rem;
    font-size: 0.85rem;
    cursor: pointer;

    display: flex;
    align-items: center;
    gap: 0.65rem;

    transition: background .2s ease, color .2s ease;
}

/* ------------------------------------------------------------
   ÍCONOS DEL MENÚ
------------------------------------------------------------ */
.mentorsync-ai-menu-item i {
    font-size: 0.95rem;
}

/* ============================================================
   LIGHT MODE — MENU
============================================================ */
html[data-theme="light"] .mentorsync-ai-menu {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0,0,0,0.08);
}

html[data-theme="light"] .mentorsync-ai-menu-item {
    color: #111;
}

html[data-theme="light"] .mentorsync-ai-menu-item:hover {
    background: rgba(0, 0, 0, 0.06);
}

/* ============================================================
   DARK MODE — MENU
============================================================ */
html[data-theme="dark"] .mentorsync-ai-menu {
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(148,163,184,0.25);
}

html[data-theme="dark"] .mentorsync-ai-menu-item {
    color: #e2e8f0;
}

html[data-theme="dark"] .mentorsync-ai-menu-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* ============================================================
   MODAL DE MEMORIA
============================================================ */
.mentorsync-memory-modal {
    position: fixed;
    inset: 0;

    display: none;
    align-items: center;
    justify-content: center;

    z-index: 2147483647;
    padding: 1rem;
}

.mentorsync-memory-modal.is-visible {
    display: flex;
}

/* Contenido del modal */
.mentorsync-memory-box {
    width: min(420px, 100%);
    padding: 1.4rem 1.1rem;
    border-radius: 1.1rem;

    backdrop-filter: blur(14px);
    border: 1px solid transparent;
    transition: background .25s ease, border-color .25s ease, color .25s ease;
}

/* Título */
.mentorsync-memory-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
}

/* Botones dentro del modal */
.mentorsync-memory-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.1rem;
}

.mentorsync-memory-btn {
    padding: 0.55rem 1.15rem;
    border-radius: 0.65rem;
    border: none;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background .22s ease, color .22s ease, border-color .22s ease;
}

/* ============================================================
   LIGHT MODE — MODAL
============================================================ */
html[data-theme="light"] .mentorsync-memory-modal {
    background: rgba(255,255,255,0.55);
}

html[data-theme="light"] .mentorsync-memory-box {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(0,0,0,0.12);
    color: #111;
}

html[data-theme="light"] .mentorsync-memory-btn {
    background: #2563eb;
    color: white;
}
html[data-theme="light"] .mentorsync-memory-btn:hover {
    background: #1d4ed8;
}

/* Close / Secondary button */
html[data-theme="light"] .mentorsync-memory-btn.cancel {
    background: rgba(0,0,0,0.07);
    color: #111;
}
html[data-theme="light"] .mentorsync-memory-btn.cancel:hover {
    background: rgba(0,0,0,0.12);
}

/* ============================================================
   DARK MODE — MODAL
============================================================ */
html[data-theme="dark"] .mentorsync-memory-modal {
    background: rgba(2,6,23,0.55);
}

html[data-theme="dark"] .mentorsync-memory-box {
    background: rgba(15, 23, 42, 0.92);
    border-color: rgba(148,163,184,0.25);
    color: #e2e8f0;
}

html[data-theme="dark"] .mentorsync-memory-btn {
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    color: white;
}
html[data-theme="dark"] .mentorsync-memory-btn:hover {
    filter: brightness(1.12);
}

/* Close / Secondary button */
html[data-theme="dark"] .mentorsync-memory-btn.cancel {
    background: rgba(255,255,255,0.09);
    color: #e2e8f0;
}
html[data-theme="dark"] .mentorsync-memory-btn.cancel:hover {
    background: rgba(255,255,255,0.15);
}

/* ============================================================
   ANIMACIONES
============================================================ */
@keyframes msyncModalIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mentorsync-memory-box {
    animation: msyncModalIn .25s ease;
}
