/* Layout: Panel & Dock */

#gbn-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 280px; /* Reduced width */
    max-width: 90vw;
    height: 100vh;
    background: var(--bg, #ffffff);
    color: var(--text, #111111);
    z-index: 99999;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.05); /* Softer shadow */
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border-left: 1px solid var(--border-color, #e6e6e6);
    border-radius: 0;
    font-family: 'Source Sans 3', sans-serif;
}

/* Aplicar fuente Source Sans 3 a todos los elementos del panel GBN */
#gbn-panel,
#gbn-panel * {
    font-family: 'Source Sans 3', sans-serif;
    box-sizing: border-box;
}

#gbn-panel.is-open {
    transform: translateX(0);
}

/* Docking Effect */
body.gbn-panel-open main {
    width: calc(100% - 280px);
    margin-right: 280px;
    transition: width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), margin-right 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Ensure transition back */
main {
    transition: width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), margin-right 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

#gbn-panel .gbn-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* padding: 10px 14px; */
    border-bottom: 1px solid var(--border-color, #e6e6e6);
    font-size: 13px; /* Smaller font */
    font-weight: 600;
    background: #fafafa;
}

#gbn-panel .gbn-panel-header-title {
    font-weight: 700;
    letter-spacing: -0.01em;
}

#gbn-panel .gbn-panel-header-close {
    appearance: none;
    border: none;
    background: none;
    color: var(--muted, #6b6b6b);
    font-size: 18px;
    line-height: 1;
    padding: 2px;
    cursor: pointer;
    transition: color 0.2s ease;
}

#gbn-panel .gbn-panel-header-close:hover {
    color: var(--text, #111111);
}

#gbn-panel .gbn-body {
    padding: 14px; /* Reduced padding */
    overflow-y: auto;
    overflow-x: hidden;
    height: calc(100% - 40px - 36px); /* Adjusted for header/footer */
    padding-bottom: 20px;
}

#gbn-panel .gbn-panel-empty,
#gbn-panel .gbn-panel-coming-soon {
    font-size: 12px;
    color: var(--muted, #6b6b6b);
    line-height: 1.5;
    text-align: center;
    padding: 20px 0;
}

#gbn-panel .gbn-panel-block-summary {
    display: grid;
    gap: 2px;
    margin-bottom: 12px;
    font-size: 11px;
    color: var(--muted);
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

#gbn-panel .gbn-panel-block-id code {
    font-size: 10px;
    background: #f3f4f6;
    padding: 1px 4px;
    border-radius: 3px;
    color: #555;
}

#gbn-panel .gbn-footer-status {
    font-size: 10px;
    color: var(--muted, #6b6b6b);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* Footer dentro del panel */
#gbn-panel .gbn-footer {
    /* position: absolute; */
    /* bottom: 0; */
    /* left: 0; */
    /* right: 0; */
    display: flex;
    align-items: center;
    justify-content: center; /* Centered status */
    /* padding: 8px 14px; */
    /* border-top: 1px solid #f0f0f0; */
    /* background: #fafafa; */
    /* height: 36px; */
}

#gbn-panel .gbn-footer-primary {
    display: none; /* Hidden as requested, moved to dock */
}

/* Contenedor principal */
.glory-split {
    position: relative;
}

.glory-split,
.glory-split * {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

/* Layout en la lista de títulos: título + acciones en una fila */
.glory-split__titles .glory-content-item {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}
.glory-split__titles .glory-content-item .glory-split__title {
    flex: 1 1 auto;
    width: auto; /* evitar cubrir acciones */
    position: relative;
    z-index: 1;
}

/* Dock Styles */
.gbn-dock {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 50px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    z-index: 99999;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.gbn-dock-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #555;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
    padding: 0;
}

.gbn-dock-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #1d8ff1;
    transform: translateY(-1px);
}

.gbn-dock-btn svg {
    display: block;
    width: 16px;
    height: 16px;
}

/* Tooltip */
.gbn-dock-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    margin-bottom: 10px;
}

.gbn-dock-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

.gbn-dock-btn:hover .gbn-dock-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Active State for Toggle Button */
.gbn-active .gbn-dock-main {
    background: #1d8ff1;
    color: #fff;
    box-shadow: 0 4px 10px rgba(29, 143, 241, 0.3);
}

.gbn-active .gbn-dock-main:hover {
    background: #1578cf;
    color: #fff;
}

/* Save Button States */
.gbn-dock-save:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.gbn-dock-save.has-changes {
    color: #f59e0b; /* Orange for warning/changes */
    position: relative;
}

.gbn-dock-save.has-changes::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: #f59e0b;
    border-radius: 50%;
    top: auto;
    right: auto;
    border: none;
}

.gbn-dock-save.is-loading svg {
    animation: gbn-spin 1s linear infinite;
}

/* Hide other buttons when inactive if desired, or keep them disabled/dimmed */
/* User asked for "floating where those buttons are". 
   Let's hide the secondary buttons when GBN is inactive to keep it clean, 
   showing only the main toggle. */
.gbn-dock:not(.is-active) .gbn-dock-btn:not(.gbn-dock-main) {
    display: none;
}

.gbn-dock:not(.is-active) {
    padding: 5px;
    border-radius: 400px;
}

/* Breakpoint Selector */
.gbn-breakpoint-selector {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 20px;
    margin: 0 4px;
}

.gbn-breakpoint-btn {
    width: 28px;
    height: 28px;
    padding: 6px;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    color: #888;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gbn-breakpoint-btn svg {
    width: 16px;
    height: 16px;
    stroke-width: 2px;
}

.gbn-breakpoint-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #555;
}

.gbn-breakpoint-btn.active {
    background: #fff;
    color: #1d8ff1;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Indicadores de Origen Responsive */
.gbn-spacing-input {
    position: relative;
}

.gbn-spacing-input::after {
    content: '';
    position: absolute;
    top: 2px;
    right: 2px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: none;
}

/* Theme Source (Naranja) */
.gbn-source-theme .gbn-spacing-icon {
    color: #f39c12;
}
.gbn-source-theme input {
    border-color: rgba(243, 156, 18, 0.3);
}

/* Tablet Source (Púrpura) */
.gbn-source-tablet .gbn-spacing-icon {
    color: #9b59b6;
}
.gbn-source-tablet input {
    border-color: rgba(155, 89, 182, 0.3);
}

/* Block/Desktop Source (Azul) */
.gbn-source-block .gbn-spacing-icon {
    color: #3498db;
}
.gbn-source-block input {
    border-color: rgba(52, 152, 219, 0.3);
}

/* Override (Valor propio en breakpoint actual) */
.gbn-field-override input {
    font-weight: 600;
    color: #333;
}
