/**
 * Spalten-Konfigurator CSS
 *
 * Shared Modal-Styles fuer Options Scanner und Aktien Scanner.
 * Extrahiert aus aktien-scanner.css v4.41.0.
 *
 * @package OptionFinder_Member_Area
 * @version 1.0.0
 * @since 1.0.0
 */

/* =====================================================
   CONFIGURATOR BAR (Button above table)
   ===================================================== */

.ofma-configurator-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    margin-bottom: 0.5rem;
}

.ofma-configurator-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--of-bg-card);
    border: 1px solid var(--of-border);
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--of-text-primary);
    cursor: pointer;
    transition: all 0.15s;
}

.ofma-configurator-btn:hover {
    border-color: var(--of-accent-teal);
    box-shadow: var(--shadow-sm);
}

.ofma-configurator-btn svg {
    color: var(--of-accent-teal);
}

.ofma-configurator-btn__count {
    font-size: 0.6875rem;
    padding: 0.125rem 0.5rem;
    background: var(--of-accent-teal);
    color: white;
    border-radius: 10px;
    font-weight: 600;
}

/* =====================================================
   FILTER MODAL (Overlay)
   ===================================================== */

.filter-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    align-items: flex-start;
    justify-content: center;
    padding: 2rem;
    overflow-y: auto;
}

.filter-modal.open {
    display: flex;
}

.filter-modal__content {
    background: var(--of-bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 1200px;
    height: calc(100vh - 10rem);
    min-height: 400px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    resize: both;
}

/* Header */
.filter-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--of-border);
    flex-shrink: 0;
}

.filter-modal__header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-modal__compact-toggle {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid var(--of-border);
    color: var(--of-text-muted);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.15s;
}

.filter-modal__compact-toggle:hover {
    border-color: var(--of-accent-teal);
    color: var(--of-accent-teal);
}

.filter-modal__compact-toggle.active {
    background: var(--of-accent-teal);
    border-color: var(--of-accent-teal);
    color: white;
}

/* Compact Mode */
.filter-modal__content.filter-modal__content--compact {
    max-height: calc(100dvh - 2rem);
}

.filter-modal__content--compact .filter-modal__desc {
    display: none;
}

.filter-modal__content--compact .filter-modal__body {
    padding: 0.75rem;
    gap: 0.75rem;
}

.filter-modal__content--compact .filter-item {
    padding: 0.25rem 0.5rem;
}

.filter-modal__content--compact .active-column {
    padding: 0.375rem 0.5rem;
    margin-bottom: 0.25rem;
}

.filter-modal__content--compact .filter-category {
    margin-bottom: 0.5rem;
}

.filter-modal__content--compact .viz-legend {
    display: none;
}

.filter-modal__content--compact .filter-modal__footer {
    padding: 0.625rem 1rem;
}

.filter-modal__title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--of-text-primary);
    margin: 0;
}

.filter-modal__close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--of-text-muted);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.15s;
}

.filter-modal__close:hover {
    background: var(--of-bg-hover);
    color: var(--of-text-primary);
}

.filter-modal__desc {
    padding: 0.75rem 1.5rem;
    margin: 0;
    font-size: 0.875rem;
    color: var(--of-text-secondary);
    background: var(--of-bg-primary);
    border-bottom: 1px solid var(--of-border);
}

/* =====================================================
   MODAL BODY (2-column grid)
   ===================================================== */

.filter-modal__body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

/* Multi-group layout (3 columns: Active | Group 1 | Group 2) */
.filter-modal__body--multi {
    grid-template-columns: 1fr 1fr 1fr;
}

.filter-modal__content--wide {
    max-width: 1600px;
}

.filter-modal__section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--of-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 0.75rem 0;
}

/* Left column */
.filter-modal__column {
    display: flex;
    flex-direction: column;
}

.filter-modal__active {
    background: var(--of-bg-primary);
    border-radius: 8px;
    padding: 1rem;
    flex: 1;
    overflow-y: auto;
}

.filter-modal__list {
    min-height: 200px;
}

/* =====================================================
   ACTIVE COLUMN ITEM (draggable)
   ===================================================== */

.active-column {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    background: var(--of-bg-card);
    border: 1px solid var(--of-border);
    border-radius: 6px;
    margin-bottom: 0.5rem;
    cursor: grab;
    transition: all 0.15s;
}

.active-column:hover {
    border-color: var(--of-accent-teal);
    box-shadow: var(--shadow-sm);
}

.active-column.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.active-column.drag-over {
    border-color: var(--of-accent-teal);
    border-style: dashed;
    background: var(--of-bg-hover);
}

.active-column__drag {
    color: var(--of-text-muted);
    font-size: 0.875rem;
    cursor: grab;
    flex-shrink: 0;
}

.active-column__name {
    flex: 1;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--of-text-primary);
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.active-column__tag {
    font-size: 0.6875rem;
    padding: 0.125rem 0.5rem;
    background: var(--of-bg-subtle);
    color: var(--of-text-primary);
    border-radius: 4px;
    flex-shrink: 0;
    white-space: nowrap;
}

.active-column__remove {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--of-text-muted);
    cursor: pointer;
    border-radius: 4px;
    font-size: 1rem;
    transition: all 0.15s;
    flex-shrink: 0;
}

.active-column__remove:hover {
    background: rgba(220, 38, 38, 0.1);
    color: var(--score-weak);
}

.active-column__remove-placeholder {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Toggle-Schalter (ADX/ADI) */
.active-column__toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    margin-right: 0.5rem;
    flex-shrink: 0;
}
.toggle-label {
    font-size: 10px;
    font-weight: 600;
    color: #94a3b8;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
}
.toggle-label.active {
    color: #14b8a6;
}
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 28px;
    height: 14px;
    cursor: pointer;
    flex-shrink: 0;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-slider {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #cbd5e1;
    border-radius: 7px;
    transition: background 0.2s;
}
.toggle-slider::before {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    left: 2px;
    top: 2px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
}
.toggle-switch input:checked + .toggle-slider {
    background: #14b8a6;
}
.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(14px);
}

/* =====================================================
   AVAILABLE COLUMNS (right panel)
   ===================================================== */

.filter-modal__available {
    display: flex;
    flex-direction: column;
}

.filter-modal__search {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--of-border);
    border-radius: 6px;
    font-size: 0.8125rem;
    margin-bottom: 1rem;
    transition: all 0.2s;
    background: var(--of-bg-card);
    color: var(--of-text-primary);
}

.filter-modal__search:focus {
    outline: none;
    border-color: var(--of-accent-teal);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

.filter-modal__categories {
    overflow-y: auto;
    flex: 1;
}

.filter-modal__categories--secondary {
    overflow-y: auto;
    flex: 1;
}

/* =====================================================
   FILTER CATEGORY & ITEMS
   ===================================================== */

.filter-category {
    margin-bottom: 1rem;
}

.filter-category__title {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--of-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 0.5rem 0;
    padding-bottom: 0.375rem;
    border-bottom: 2px solid var(--of-border);
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.625rem;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s;
}

.filter-item:hover {
    background: var(--of-bg-hover);
}

/* Selected items: still visible but dimmed */
.filter-item.selected {
    opacity: 0.5;
}

/* Custom checkbox styling */
.filter-item input[type="checkbox"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--of-border-dark, var(--of-border));
    border-radius: 3px;
    background: var(--of-bg-card);
    cursor: pointer;
    position: relative;
    transition: all 0.15s;
    flex-shrink: 0;
}

.filter-item input[type="checkbox"]:hover {
    border-color: var(--of-accent-teal);
}

.filter-item input[type="checkbox"]:checked {
    background: var(--of-accent-teal);
    border-color: var(--of-accent-teal);
}

.filter-item input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 4.5px;
    top: 1.5px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.filter-item span:nth-child(2) {
    font-size: 0.8125rem;
    color: var(--of-text-primary);
}

.filter-item__spacer {
    flex: 1;
}

.filter-item__tag {
    font-size: 0.625rem;
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    flex-shrink: 0;
    white-space: nowrap;
}

/* =====================================================
   HELP ICON & TOOLTIP
   ===================================================== */

.filter-item__help {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    background: transparent;
    border: 1px solid var(--of-accent-violet, #8b5cf6);
    border-radius: 50%;
    font-size: 0.5625rem;
    font-weight: 600;
    color: var(--of-accent-violet, #8b5cf6);
    cursor: pointer;
    margin-left: 0.25rem;
    transition: all 0.15s;
    flex-shrink: 0;
}

.filter-item__help:hover {
    background: var(--of-accent-violet, #8b5cf6);
    color: white;
}

.filter-item__tooltip {
    display: none;
    position: fixed;
    width: 240px;
    padding: 0.625rem 0.875rem;
    background: var(--of-accent-violet, #8b5cf6);
    color: white;
    font-size: 0.75rem;
    line-height: 1.4;
    border-radius: 6px;
    z-index: 9999;
    box-shadow: var(--shadow-lg);
    pointer-events: none;
}

.filter-item.tooltip-open .filter-item__tooltip {
    display: block;
}

/* =====================================================
   VISUALIZATION ICONS
   ===================================================== */

.viz-icons {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

.viz-icons--placeholder {
    width: 48px;
}

.viz-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    background: var(--of-bg-card);
    border: 1px solid var(--of-border);
    border-radius: 4px;
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--of-text-muted);
    cursor: pointer;
    transition: all 0.15s;
}

.viz-icon:hover {
    border-color: var(--of-accent-violet, #8b5cf6);
    color: var(--of-accent-violet, #8b5cf6);
}

.viz-icon.active {
    background: var(--of-bg-card);
    border-color: var(--of-accent-violet, #8b5cf6);
    color: var(--of-accent-violet, #8b5cf6);
}

.viz-icon--text {
    font-family: serif;
}

.viz-icon__dot {
    width: 8px;
    height: 8px;
    background: currentColor;
    border-radius: 50%;
}

.viz-icon__bar {
    width: 12px;
    height: 6px;
    background: currentColor;
    border-radius: 2px;
}

.viz-icon__badge {
    width: 10px;
    height: 8px;
    background: var(--score-medium, #d97706);
    border-radius: 2px;
}

.viz-icon.active .viz-icon__badge {
    background: var(--of-accent-violet, #8b5cf6);
}

/* =====================================================
   MODAL FOOTER
   ===================================================== */

.filter-modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--of-border);
    background: var(--of-bg-primary);
    flex-shrink: 0;
}

.filter-modal__btn {
    padding: 0.625rem 1.25rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.filter-modal__btn--secondary {
    background: var(--of-bg-card);
    border: 1px solid var(--of-accent-violet, #8b5cf6);
    color: var(--of-accent-violet, #8b5cf6);
}

.filter-modal__btn--secondary:hover {
    background: var(--of-accent-violet, #8b5cf6);
    color: white;
}

.filter-modal__btn--primary {
    background: var(--of-accent-teal);
    border: none;
    color: white;
}

.filter-modal__btn--primary:hover {
    background: #0b8277;
}

/* =====================================================
   VISUALIZATION LEGEND
   ===================================================== */

.viz-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--of-bg-primary);
    border-radius: 6px;
    margin-top: 1rem;
}

.viz-legend__title {
    width: 100%;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--of-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.viz-legend__item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--of-text-secondary);
}

.viz-legend__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: var(--of-bg-card);
    border: 1px solid var(--of-border);
    border-radius: 4px;
    font-size: 0.5625rem;
    font-weight: 600;
    color: var(--of-text-muted);
}

.viz-legend__icon--text {
    font-family: serif;
}

.viz-legend__icon .viz-icon__dot {
    width: 6px;
    height: 6px;
    background: var(--score-excellent, #059669);
    border-radius: 50%;
}

.viz-legend__icon .viz-icon__badge {
    width: 10px;
    height: 10px;
    background: var(--score-medium, #d97706);
    border-radius: 3px;
}

.viz-legend__icon .viz-icon__bar {
    width: 10px;
    height: 4px;
    background: var(--of-accent-teal);
    border-radius: 2px;
}

.viz-legend__toggle-desc {
    font-size: 0.6875rem;
    color: #64748b;
    font-style: italic;
    margin-left: 0.5rem;
}
.viz-legend__toggle-desc:empty {
    display: none;
}

/* =====================================================
   EMPTY STATE
   ===================================================== */

.filter-modal__empty {
    color: var(--of-text-muted);
    font-size: 0.8125rem;
    text-align: center;
    padding: 2rem;
}
