/* ══════════════════════════════════════════════════════════
   Glocal Legal Suite v1.6.0 — Feature CSS
   ══════════════════════════════════════════════════════════ */

/* ── Preferiti ──────────────────────────────────────────── */
.gls-fav-btn {
    position: absolute !important;
    top: 16px !important; right: 16px !important;
    background: transparent !important;
    border: none !important;
    font-size: 18px !important;
    color: #d1d5db !important;
    cursor: pointer !important;
    padding: 4px !important;
    line-height: 1 !important;
    transition: all .18s !important;
    border-radius: 6px !important;
}
.gls-fav-btn:hover { color: #c9a84c !important; background: rgba(201,168,76,.08) !important; }
.gls-fav-btn--active { color: #c9a84c !important; }

.gls-tool__header { position: relative !important; }

.gls-fav-bar {
    background: linear-gradient(135deg, #fffbeb, #fef9ee) !important;
    border: 1px solid #fde68a !important;
    border-radius: 14px !important;
    padding: 16px 20px !important;
    margin-bottom: 20px !important;
}
.gls-fav-bar__title {
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #b45309 !important;
    text-transform: uppercase !important;
    letter-spacing: .06em !important;
    margin-bottom: 12px !important;
}
.gls-fav-bar__list {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
}
.gls-fav-bar__item {
    display: inline-flex !important;
    align-items: center !important;
    padding: 6px 14px !important;
    background: #fff !important;
    border: 1px solid #fde68a !important;
    border-radius: 100px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #92400e !important;
    text-decoration: none !important;
    transition: all .18s !important;
}
.gls-fav-bar__item:hover {
    background: #fef3c7 !important;
    border-color: #c9a84c !important;
    color: #78350f !important;
    text-decoration: none !important;
}

/* Tool highlight animato */
.gls-tool--highlight {
    box-shadow: 0 0 0 3px #c9a84c !important;
    border-color: #c9a84c !important;
    transition: box-shadow .15s, border-color .15s !important;
}

/* ── Ricerca ─────────────────────────────────────────────── */
.gls-search-wrap {
    position: relative !important;
    margin-bottom: 20px !important;
}
.gls-search-inp {
    width: 100% !important;
    padding: 12px 44px 12px 16px !important;
    background: #fff !important;
    border: 1.5px solid #e5e7eb !important;
    border-radius: 12px !important;
    font-size: 15px !important;
    color: #111827 !important;
    font-family: 'Inter', system-ui, sans-serif !important;
    outline: none !important;
    box-sizing: border-box !important;
    transition: border-color .15s, box-shadow .15s !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.04) !important;
}
.gls-search-inp:focus {
    border-color: #1a2744 !important;
    box-shadow: 0 0 0 3px rgba(26,39,68,.1) !important;
}
.gls-search-clear {
    position: absolute !important;
    right: 12px !important; top: 50% !important;
    transform: translateY(-50%) !important;
    background: none !important;
    border: none !important;
    font-size: 16px !important;
    color: #9ca3af !important;
    cursor: pointer !important;
    padding: 4px !important;
    line-height: 1 !important;
}
.gls-search-clear:hover { color: #374151 !important; }
.gls-search-noresult {
    text-align: center !important;
    padding: 32px !important;
    color: #6b7280 !important;
    font-size: 15px !important;
    background: #f9fafb !important;
    border-radius: 12px !important;
    border: 1px dashed #e5e7eb !important;
}
mark.gls-highlight {
    background: #fef3c7 !important;
    color: #92400e !important;
    border-radius: 3px !important;
    padding: 0 2px !important;
}

/* ── Stampa e Export ─────────────────────────────────────── */
.gls-print-btn,
.gls-export-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 7px 16px !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 8px !important;
    background: #fff !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #374151 !important;
    cursor: pointer !important;
    transition: all .15s !important;
    font-family: 'Inter', system-ui, sans-serif !important;
}
.gls-print-btn:hover,
.gls-export-btn:hover {
    background: #f3f4f6 !important;
    border-color: #d1d5db !important;
}

.gls-export-wrap {
    margin-top: 8px !important;
    display: flex !important;
    justify-content: flex-end !important;
}

/* ── Toolbar flottante ──────────────────────────────────── */
.gls-toolbar {
    position: fixed !important;
    bottom: 28px !important; right: 24px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    z-index: 9999 !important;
}
.gls-toolbar-btn {
    width: 46px !important;
    height: 46px !important;
    border-radius: 50% !important;
    background: #0f1c38 !important;
    border: none !important;
    color: #e8d48a !important;
    font-size: 20px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    box-shadow: 0 4px 16px rgba(15,28,56,.35) !important;
    transition: all .2s !important;
}
.gls-toolbar-btn:hover {
    background: #1a2d55 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 24px rgba(15,28,56,.4) !important;
    color: #e8d48a !important;
    text-decoration: none !important;
}
#glsScrollTop {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateY(8px) !important;
}
#glsScrollTop.gls-toolbar-btn--visible {
    opacity: 1 !important;
    pointer-events: all !important;
    transform: translateY(0) !important;
}

/* ── Side Panel Storico/Preferiti ───────────────────────── */
.gls-side-overlay {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(0,0,0,.4) !important;
    z-index: 10000 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity .25s !important;
    backdrop-filter: blur(2px) !important;
}
.gls-side-overlay--open {
    opacity: 1 !important;
    pointer-events: all !important;
}
.gls-side-panel {
    position: fixed !important;
    top: 0 !important; right: 0 !important;
    width: 380px !important;
    max-width: 95vw !important;
    height: 100vh !important;
    background: #fff !important;
    z-index: 10001 !important;
    box-shadow: -8px 0 40px rgba(0,0,0,.15) !important;
    transform: translateX(100%) !important;
    transition: transform .3s cubic-bezier(.4,0,.2,1) !important;
    display: flex !important;
    flex-direction: column !important;
}
.gls-side-panel--open { transform: translateX(0) !important; }

.gls-side-panel__header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 20px 20px 0 !important;
    border-bottom: 1px solid #f3f4f6 !important;
    padding-bottom: 0 !important;
}
.gls-side-tabs {
    display: flex !important;
    gap: 0 !important;
}
.gls-side-tab {
    padding: 12px 20px !important;
    background: none !important;
    border: none !important;
    border-bottom: 2px solid transparent !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #6b7280 !important;
    cursor: pointer !important;
    transition: all .15s !important;
    font-family: 'Inter', system-ui, sans-serif !important;
}
.gls-side-tab--active {
    color: #0f1c38 !important;
    border-bottom-color: #c9a84c !important;
}
.gls-side-close {
    width: 32px !important; height: 32px !important;
    border-radius: 8px !important;
    background: #f3f4f6 !important;
    border: none !important;
    font-size: 14px !important;
    color: #6b7280 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all .15s !important;
    margin-bottom: 2px !important;
}
.gls-side-close:hover { background: #e5e7eb !important; color: #111827 !important; }

.gls-side-panel__body {
    flex: 1 !important;
    overflow-y: auto !important;
    padding: 20px !important;
}

.gls-hist-item {
    padding: 14px 0 !important;
    border-bottom: 1px solid #f3f4f6 !important;
}
.gls-hist-item:last-child { border-bottom: none !important; }
.gls-hist-item__top {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    gap: 8px !important;
    margin-bottom: 5px !important;
}
.gls-hist-item__label {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #111827 !important;
    line-height: 1.3 !important;
}
.gls-hist-item__date {
    font-size: 11px !important;
    color: #9ca3af !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}
.gls-hist-item__params {
    font-size: 12px !important;
    color: #6b7280 !important;
    margin-bottom: 5px !important;
    line-height: 1.5 !important;
}
.gls-hist-item__result {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #0f1c38 !important;
    font-family: 'Playfair Display', Georgia, serif !important;
}

.gls-side-clear {
    width: 100% !important;
    margin-top: 16px !important;
    padding: 10px !important;
    background: #fef2f2 !important;
    border: 1px solid #fecaca !important;
    border-radius: 8px !important;
    color: #b91c1c !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all .15s !important;
    font-family: 'Inter', system-ui, sans-serif !important;
}
.gls-side-clear:hover { background: #fee2e2 !important; }

/* ── Dark Mode ──────────────────────────────────────────── */
html.gls-dark .gls-hub__card,
html.gls-dark .gls-tool,
html.gls-dark .gls-res-rows,
html.gls-dark .gls-search-inp,
html.gls-dark .gls-side-panel {
    background: #1e2535 !important;
    border-color: #2d3748 !important;
    color: #e2e8f0 !important;
}
html.gls-dark .gls-tool__title,
html.gls-dark .gls-hub__card-label,
html.gls-dark .gls-res-row__value,
html.gls-dark .gls-fg label {
    color: #e2e8f0 !important;
}
html.gls-dark .gls-tool__header,
html.gls-dark .gls-hub__note {
    background: #111827 !important;
    border-color: #2d3748 !important;
}
html.gls-dark .gls-inp {
    background: #111827 !important;
    border-color: #374151 !important;
    color: #e2e8f0 !important;
}
html.gls-dark .gls-tool__desc,
html.gls-dark .gls-res-row__label,
html.gls-dark .gls-hub__note {
    color: #9ca3af !important;
}
html.gls-dark .gls-res-row {
    border-color: #2d3748 !important;
}
html.gls-dark .gls-res-row:hover { background: #1a2535 !important; }
html.gls-dark .gls-hist-item { border-color: #2d3748 !important; }
html.gls-dark .gls-hist-item__label { color: #e2e8f0 !important; }
html.gls-dark .gls-side-tab { color: #9ca3af !important; }
html.gls-dark .gls-side-tab--active { color: #e2e8f0 !important; }
html.gls-dark .gls-side-panel__header { border-color: #2d3748 !important; }
html.gls-dark .gls-side-close { background: #2d3748 !important; color: #9ca3af !important; }
html.gls-dark .gls-print-btn,
html.gls-dark .gls-export-btn {
    background: #1e2535 !important;
    border-color: #374151 !important;
    color: #e2e8f0 !important;
}

/* Responsive toolbar */
@media (max-width: 640px) {
    .gls-toolbar { bottom: 16px !important; right: 14px !important; }
    .gls-side-panel { width: 100% !important; }
}
