/* Vibe Editor Studio Pro - CSS */
:root {
    --vibe-bg: #141416;
    --vibe-surface: #1e1e24;
    --vibe-border: #33333b;
    --vibe-accent: #e5c158;
    --vibe-text: #eaeaea;
    --vibe-text-muted: #8b8b99;
}

/* =========================================================
   1. MODO EDICIÓN GLOBAL
   ========================================================= */
body.vibe-editor-active {
    /* Eliminamos padding-right para evitar que rompa el layout (100vw, etc) */
}
body.vibe-editor-active [contenteditable="true"] {
    outline: 2px dashed rgba(229, 193, 88, 0.4);
    outline-offset: 4px;
    border-radius: 4px;
    transition: outline 0.2s;
    cursor: text;
}
body.vibe-editor-active [contenteditable="true"]:focus {
    outline: 2px solid var(--vibe-accent);
    background: rgba(229, 193, 88, 0.05);
}

/* Tarjetas y Secciones con controles */
.vibe-target {
    position: relative;
    transition: box-shadow 0.2s;
}
.vibe-target:hover {
    box-shadow: 0 0 0 2px rgba(229, 193, 88, 0.6);
}
.vibe-card-hidden {
    opacity: 0.3 !important;
    filter: grayscale(1);
}

/* =========================================================
   2. SIDEBAR INSPECTOR (DERECHA)
   ========================================================= */
#vibe-inspector {
    position: fixed;
    top: 0;
    right: -320px;
    width: 320px;
    height: 100vh;
    background: var(--vibe-bg);
    border-left: 1px solid var(--vibe-border);
    z-index: 999999;
    color: var(--vibe-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overflow-y: auto;
    transition: right 0.3s ease;
    box-shadow: -4px 0 24px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
}
#vibe-inspector.visible {
    right: 0;
}
.vibe-panel-header {
    padding: 16px;
    border-bottom: 1px solid var(--vibe-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--vibe-surface);
}
.vibe-panel-header h3 {
    margin: 0;
    font-size: 14px;
    color: var(--vibe-accent);
    font-weight: 600;
}
.vibe-btn-close {
    background: none;
    border: none;
    color: var(--vibe-text-muted);
    cursor: pointer;
    font-size: 18px;
}
.vibe-btn-close:hover {
    color: #fff;
}
.vibe-section {
    padding: 16px;
    border-bottom: 1px solid var(--vibe-border);
}
.vibe-section h4 {
    margin: 0 0 12px 0;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--vibe-text-muted);
}
.vibe-control-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.vibe-control-row label {
    font-size: 12px;
    color: #bbb;
    flex: 1;
}
.vibe-input {
    background: #000;
    border: 1px solid var(--vibe-border);
    color: #fff;
    padding: 6px 8px;
    border-radius: 4px;
    width: 80px;
    font-size: 12px;
    outline: none;
}
.vibe-input:focus {
    border-color: var(--vibe-accent);
}
.vibe-select {
    background: #000;
    border: 1px solid var(--vibe-border);
    color: #fff;
    padding: 6px;
    border-radius: 4px;
    font-size: 12px;
    flex: 1;
    margin-left: 10px;
}
.vibe-action-btn {
    background: #2a2a32;
    border: 1px solid #444;
    color: #eaeaea;
    width: 100%;
    padding: 8px;
    margin-bottom: 6px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.2s;
}
.vibe-action-btn:hover {
    background: #3a3a42;
}
.vibe-action-btn.danger {
    color: #ff6b6b;
    border-color: #522;
    background: #311;
}
.vibe-action-btn.danger:hover {
    background: #522;
}

/* =========================================================
   3. DOCK PRINCIPAL (ABAJO)
   ========================================================= */
#vibe-dock {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 20, 22, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid var(--vibe-border);
    border-radius: 12px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 999998;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    display: none; /* Oculto por defecto, visible cuando activo */
}
.vibe-dock-btn {
    background: var(--vibe-surface);
    border: 1px solid var(--vibe-border);
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.vibe-dock-btn:hover {
    background: #2a2a32;
}
.vibe-dock-btn.primary {
    background: var(--vibe-accent);
    color: #000;
    border: none;
}
.vibe-dock-btn.primary:hover {
    background: #f5d168;
    transform: translateY(-2px);
}

/* =========================================================
   4. BUBBLE MENU (FLOTANTE SOBRE TEXTO)
   ========================================================= */
#vibe-bubble {
    position: absolute;
    background: #111;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 6px;
    display: none;
    gap: 4px;
    z-index: 9999999;
    box-shadow: 0 8px 16px rgba(0,0,0,0.6);
    transform: translate(-50%, -100%);
    margin-top: -10px;
}
#vibe-bubble.visible {
    display: flex;
}
.vibe-bubble-btn {
    background: transparent;
    border: none;
    color: #ccc;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 14px;
}
.vibe-bubble-btn:hover {
    background: #333;
    color: #fff;
}
.vibe-bubble-divider {
    width: 1px;
    background: #333;
    margin: 0 4px;
}

/* =========================================================
   5. GESTOR DE IMÁGENES / CARDS
   ========================================================= */
.vibe-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--vibe-accent);
    color: #000;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 99999;
}
.vibe-target:hover > .vibe-badge,
.vibe-img-wrap:hover > .vibe-badge {
    opacity: 1;
}
.vibe-img-wrap {
    position: relative;
    display: inline-block;
}

/* Modal Subida */
#vibe-modal {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
    z-index: 9999999;
    display: none;
    align-items: center;
    justify-content: center;
}
#vibe-modal.visible {
    display: flex;
}
.vibe-modal-content {
    background: var(--vibe-surface);
    border: 1px solid var(--vibe-border);
    padding: 24px;
    border-radius: 12px;
    width: 400px;
    color: #fff;
    font-family: sans-serif;
}
.vibe-modal-content h3 { margin-top: 0; color: var(--vibe-accent); }
.vibe-upload-box {
    border: 2px dashed #444;
    padding: 32px;
    text-align: center;
    border-radius: 8px;
    margin: 16px 0;
    cursor: pointer;
    transition: border 0.2s;
}
.vibe-upload-box:hover {
    border-color: var(--vibe-accent);
}
#vibe-file-input { display: none; }

/* =========================================================
   6. TOAST NOTIFICATIONS
   ========================================================= */
#vibe-toast {
    position: fixed;
    bottom: -60px;
    right: 20px;
    background: var(--vibe-accent);
    color: #000;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    transition: bottom 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 9999999;
}
#vibe-toast.visible {
    bottom: 20px;
}

/* === ESTILOS VISUALES DE SELECCIÓN === */
.vibe-selected {
    outline: 3px solid #e5c158 !important;
    outline-offset: 2px;
    box-shadow: 0 0 15px rgba(229, 193, 88, 0.6) !important;
    z-index: 99999;
    resize: both;
    overflow: hidden;
}
