/* ============================================================
   floating-window.css — Eclipse Zone
   Ventanas flotantes reutilizables (estilo Discord desktop):
   arrastrables, con z-index centralizado y un dock lateral
   para minimizar/restaurar/cerrar. Ver js/floating-window.js.
   ============================================================ */

/* ── Dock lateral — lista de ventanas abiertas ────────────── */
.fw-dock {
    position: fixed;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    z-index: 16500;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.fw-dock:empty { display: none; }

.fw-dock-btn {
    pointer-events: auto;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border-color, rgba(255,255,255,.1));
    background: var(--card-bg, #1e1e2a);
    color: var(--text, #e9ebff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,0,0,.35);
    transition: transform .15s ease, border-color .15s ease;
}

.fw-dock-btn:hover { transform: scale(1.08); border-color: var(--primary, #5865F2); }

.fw-dock-btn.fw-dock-btn-active {
    border-color: var(--primary, #5865F2);
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb, 88,101,242), .35);
}

/* ── Ventana flotante ──────────────────────────────────────── */
.fw-window {
    position: fixed;
    display: flex;
    flex-direction: column;
    min-width: 260px;
    min-height: 220px;
    background: var(--card-bg, #1e1e2a);
    border: 1px solid var(--border-color, rgba(255,255,255,.1));
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,.45);
    overflow: hidden;
    z-index: 16000;
}

.fw-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(255,255,255,.03);
    border-bottom: 1px solid var(--border-color, rgba(255,255,255,.08));
    cursor: grab;
    user-select: none;
    flex-shrink: 0;
}

.fw-header:active { cursor: grabbing; }

.fw-title {
    font-weight: 600;
    font-size: .9rem;
    color: var(--text, #e9ebff);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fw-actions { display: flex; gap: 4px; flex-shrink: 0; }

.fw-btn {
    background: none;
    border: none;
    color: var(--muted, #b6baf2);
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: .85rem;
    transition: background .15s, color .15s;
}

.fw-btn:hover { background: rgba(255,255,255,.08); color: var(--text, #e9ebff); }
.fw-btn.fw-close:hover { background: #ed4245; color: #fff; }

.fw-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: auto;
}

/* Las ventanas flotantes son un realce de escritorio: en pantallas
   angostas se prefiere el flujo fullscreen ya existente del sitio. */
@media (max-width: 768px) {
    .fw-dock { display: none; }
    .fw-window { display: none !important; }
}

/* ── Contenido de discord-friends.js (DM) embebido en una fw-window ──
   El chat ya trae su propio header (avatar/nombre); se oculta el botón
   "volver" (solo tiene sentido en el flujo fullscreen de móvil) y se
   reduce la altura para no duplicar espacio junto al header de la
   ventana flotante. */
.fw-window.dmf-floating .fw-body .dmf-header {
    height: 46px;
}
.fw-window.dmf-floating .fw-body .dmf-back-btn {
    display: none;
}
