/**
 * OptionFinder - Scanner Styles: STRATEGIES
 * 
 * Diese Datei enth&auml;lt NUR Styles f&uuml;r die Kategorie "Strategien":
 * - Strategy Filter Panel (einklappbar)
 * - Strategy Cards (Short Put, Bull Put Spread, etc.)
 * - Strategy Badges in der Tabelle
 * - Strategy-Filter Checkboxen
 * - Parameter Toggles und Inputs
 * - Toggle Switch
 * 
 * NICHT hier: Layout, Tabellen-Basis, andere Kategorien
 * 
 * @package OptionFinder_Member_Area
 * @version 3.0.0
 * @since 3.0.0 - Aufgeteilt aus dashboard-starter.css
 * 
 * @see dashboard-starter-base.css f&uuml;r Grundstruktur
 */

/* =====================================================
   STRATEGY SCHNELLFILTER-KACHELN (Spinner & Anpassungen)
   ===================================================== */

/* Spinner-Dot: Lade-Animation fuer Badge-Count */
.spinner-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--of-text-muted, #94a3b8);
    animation: spinnerDotPulse 1s ease-in-out infinite;
}

@keyframes spinnerDotPulse {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* Strategie-Chips: 1:1 das Schnellfilter-Pattern aus dem Aktien-Scanner.
   Hover = nur Teal-Border (kein BG/Glow), Aktiv = Teal-Border + 10% Tint
   + 3px-Glow + Teal-Title + gefuellte Teal-Count-Pille. */
#strategy-cards .filter-card[data-strategy] {
    cursor: pointer;
}

#strategy-cards .filter-card[data-strategy].active {
    border-color: var(--of-accent-teal, #14b8a6);
    background: rgba(20, 184, 166, 0.10);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.10);
}
#strategy-cards .filter-card[data-strategy].active .card-title {
    color: var(--of-accent-teal-dark, #0d9488);
}
#strategy-cards .filter-card[data-strategy].active .card-count {
    background: var(--of-accent-teal, #14b8a6);
    color: #fff;
}

/* Hover: nur Teal-Border (kein BG, kein Glow). Steht nach .active fuer
   Specificity-Tie-Break — bei aktivem Chip aendert sich nichts sichtbar,
   weil der Border ohnehin schon teal ist. */
#strategy-cards .filter-card[data-strategy]:hover {
    border-color: var(--of-accent-teal, #14b8a6);
}

/* Im Chip-Layout sind card-desc und card-sector ausgeblendet — die Info
   wandert ins title-Attribut (Browser-Tooltip beim Hover). */
#strategy-cards .card-sector { display: none; }

/* Option Type Badge */
.card-type {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 3px;
    letter-spacing: 0.5px;
    vertical-align: middle;
}
.card-type--put {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}
.card-type--call {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}
.card-type--both {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

/* Sektor-Zeile in Kachel */
.card-sector {
    display: block;
    font-size: 11px;
    color: var(--of-text-secondary, #64748b);
}

/* Inaktive Strategie (nicht konfiguriert): ausgegraut */
.filter-card.inactive {
    opacity: 0.45;
    pointer-events: none;
    cursor: default;
}
.filter-card.inactive .card-count {
    color: var(--of-text-muted, #94a3b8);
}

/* Pro-Locked Kachel (Iron Condor): sichtbar, dezent violett-angehaucht,
   mit Lock + Upgrade-Link. Klick oeffnet Upgrade-Modal (siehe dashboard.js
   showProUpgradeModal). */
.filter-card--pro-locked {
    opacity: 0.85;
    cursor: pointer;
    background: linear-gradient(
        135deg,
        rgba(139, 92, 246, 0.10) 0%,
        rgba(20, 184, 166, 0.05) 100%
    );
    border-style: dashed;
    transition: opacity 0.15s, transform 0.15s;
}
.filter-card--pro-locked:hover {
    opacity: 1;
    transform: translateY(-1px);
}
.filter-card--pro-locked .card-title .card-lock {
    margin-left: 6px;
    font-size: 12px;
    opacity: 0.75;
}
/* Count bleibt im gleichen Stil wie bei den freien Kacheln — Zahl ist der
   eigentliche Eyecatcher. Nur die Kachel an sich signalisiert via Lock + Link,
   dass IC im Pro-Plan steckt. */
.filter-card--pro-locked .card-count {
    color: #8b5cf6;
}
.filter-card--pro-locked .card-upgrade-link {
    color: #8b5cf6;
    text-decoration: none;
    font-weight: 500;
}
.filter-card--pro-locked .card-upgrade-link:hover {
    text-decoration: underline;
}

/* External-Link-Variante (Iron Condor fuer Pro-User): klickbar, leitet zum
   Multi-Leg Dashboard weiter. Sieht aus wie eine normale (nicht-aktive)
   Kachel — nur das ↗-Icon im Titel und der Hint-Text signalisieren den Link. */
.filter-card--external {
    cursor: pointer;
}
.filter-card--external:hover {
    border-color: var(--of-accent-teal, #14b8a6);
}
.filter-card--external .card-title .card-external {
    margin-left: 6px;
    font-size: 11px;
    color: var(--of-text-muted, #94a3b8);
    font-weight: 600;
}
.filter-card--external .card-external-hint {
    color: var(--of-text-secondary, #64748b);
    font-style: italic;
}

/* =====================================================
   STRATEGY FILTER PANEL
   ===================================================== */

/* Panel Container */
.ofma-strategy-panel {
    background: var(--ofma-color-slate-100);
    border: 1px solid var(--ofma-color-slate-200);
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
}

/* Panel Header (klickbar) */
.ofma-strategy-panel__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    cursor: pointer;
    transition: background 0.2s ease;
    user-select: none;
}

.ofma-strategy-panel__header:hover {
    background: rgba(0,0,0,0.03);
}

.ofma-strategy-panel__icon {
    font-size: 1.25rem;
}

.ofma-strategy-panel__title {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--ofma-color-slate-700);
    flex: 1;
}

.ofma-strategy-panel__toggle-icon {
    font-size: 0.75rem;
    color: var(--ofma-color-slate-500);
    transition: transform 0.3s ease;
}

.ofma-strategy-panel.open .ofma-strategy-panel__toggle-icon {
    transform: rotate(180deg);
}

/* Panel Content */
.ofma-strategy-panel__content {
    padding: 0 1rem 1rem;
    border-top: 1px solid var(--ofma-color-slate-200);
}

.ofma-strategy-panel__info {
    padding: 0.75rem 0;
    color: var(--ofma-color-slate-600);
    font-size: 0.8125rem;
}

.ofma-strategy-panel__info p {
    margin: 0;
}

/* =====================================================
   STRATEGY GRID &amp; CARDS
   ===================================================== */

/* Strategy Grid */
.ofma-strategy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Strategy Card */
.ofma-strategy-card {
    background: #ffffff;
    border: 1px solid var(--ofma-color-slate-200);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ofma-strategy-card:hover {
    border-color: var(--ofma-color-slate-300);
}

.ofma-strategy-card--locked {
    opacity: 0.6;
}

.ofma-strategy-card--locked:hover {
    border-color: var(--ofma-color-slate-300);
}

/* Card Header */
.ofma-strategy-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    border-bottom: 2px solid transparent;
    background: var(--ofma-color-slate-50);
}

.ofma-strategy-card__title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--ofma-color-slate-700);
}

.ofma-strategy-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    font-size: 0.875rem;
    color: white;
}

.ofma-strategy-card__abbr {
    color: var(--ofma-color-slate-500);
    font-weight: 400;
    font-size: 0.75rem;
}

.ofma-strategy-card__lock {
    font-size: 1rem;
    color: var(--ofma-color-slate-500);
}

/* Card Body */
.ofma-strategy-card__body {
    padding: 0.75rem;
}

.ofma-strategy-card__body--locked {
    padding: 1rem;
    text-align: center;
}

.ofma-strategy-card__upgrade p {
    color: var(--ofma-color-slate-400);
    font-size: 0.8125rem;
    margin: 0 0 0.75rem;
}

/* Card Row */
.ofma-strategy-card__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.375rem 0;
    border-bottom: 1px solid var(--ofma-color-slate-200);
}

.ofma-strategy-card__row:last-child {
    border-bottom: none;
}

/* Parameter Toggle (Checkbox + Label) */
.ofma-param-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--ofma-color-slate-600);
    min-width: 120px;
    cursor: pointer;
}

.ofma-param-toggle input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: var(--ofma-color-primary);
    cursor: pointer;
}

.ofma-param-toggle span {
    user-select: none;
}

/* Deaktivierte Parameter (Checkbox unchecked) */
.ofma-strategy-card__row:has(.ofma-param-checkbox:not(:checked)) .ofma-range-inputs,
.ofma-strategy-card__row:has(.ofma-param-checkbox:not(:checked)) .ofma-input--small {
    opacity: 0.4;
    pointer-events: none;
}

.ofma-strategy-card__row > label:not(.ofma-param-toggle) {
    font-size: 0.75rem;
    color: var(--ofma-color-slate-400);
    min-width: 100px;
}

.ofma-strategy-card__row--checkbox {
    justify-content: flex-start;
}

.ofma-strategy-card__row--checkbox label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--ofma-color-slate-600);
}

.ofma-strategy-card__row--checkbox input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: var(--ofma-color-primary);
}

/* Range Inputs */
.ofma-range-inputs {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.ofma-range-inputs span {
    color: var(--ofma-color-slate-500);
    font-size: 0.75rem;
}

/* Small Input — breit genug fuer 6-stellige Zahlen (z.B. 999999 bei price_max)
   und 2-Nachkomma-Delta-Werte (0.30). */
.ofma-input--small {
    width: 84px;
    padding: 0.3rem 0.5rem;
    font-size: 0.8125rem;
    text-align: center;
    background: #ffffff;
    border: 1px solid var(--ofma-color-slate-300);
    border-radius: 4px;
    color: var(--ofma-color-slate-700);
    transition: border-color 0.2s ease;
}

.ofma-input--small:focus {
    outline: none;
    border-color: var(--ofma-color-primary);
}

.ofma-input--small::-webkit-inner-spin-button,
.ofma-input--small::-webkit-outer-spin-button {
    opacity: 0.5;
}

/* Toggle Switch */
.ofma-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

.ofma-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.ofma-switch__slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--ofma-color-slate-300);
    transition: 0.3s;
    border-radius: 20px;
}

.ofma-switch__slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.ofma-switch input:checked + .ofma-switch__slider {
    background-color: var(--ofma-color-primary);
}

.ofma-switch input:checked + .ofma-switch__slider:before {
    transform: translateX(16px);
}

/* Panel Actions */
.ofma-strategy-panel__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--ofma-color-slate-200);
}

/* Status Message */
.ofma-strategy-panel__status {
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8125rem;
    text-align: center;
}

.ofma-strategy-panel__status--success {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.ofma-strategy-panel__status--error {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.ofma-strategy-panel__status--warning {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* =====================================================
   STRATEGY BADGES (in Tabelle) - Pastellfarben Design
   ===================================================== */

/* Badges Container */
.ofma-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

/* Badge ohne Strategien */
.ofma-badge-none {
    color: var(--ofma-color-slate-500);
    font-size: 0.75rem;
}

/* Basis-Stil f&uuml;r alle Strategy-Badges */
.ofma-badge {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    cursor: help;
}

/* Short Put - Gr&uuml;n */
.ofma-badge.badge-short-put {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Bull Put Spread - Blau */
.ofma-badge.badge-bull-put-spread {
    background: rgba(59, 130, 246, 0.15);
    color: #2563eb;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Covered Call - Violett */
.ofma-badge.badge-covered-call {
    background: rgba(139, 92, 246, 0.15);
    color: #7c3aed;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

/* Bear Call Spread - Orange */
.ofma-badge.badge-bear-call-spread {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Iron Condor - Teal */
.ofma-badge.badge-iron-condor {
    background: rgba(20, 184, 166, 0.15);
    color: #0d9488;
    border: 1px solid rgba(20, 184, 166, 0.3);
}

/* Spalte breiter machen f&uuml;r Badges */
.ofma-scanner__table td .ofma-badges {
    justify-content: flex-start;
    min-width: 80px;
}

/* =====================================================
   DARK MODE - STRATEGIES
   ===================================================== */

/* Dark Mode - Strategy Badges */
[data-theme="dark"] .ofma-badge.badge-short-put {
    background: rgba(16, 185, 129, 0.25);
    border-color: rgba(16, 185, 129, 0.5);
}

[data-theme="dark"] .ofma-badge.badge-bull-put-spread {
    background: rgba(59, 130, 246, 0.25);
    border-color: rgba(59, 130, 246, 0.5);
}

[data-theme="dark"] .ofma-badge.badge-covered-call {
    background: rgba(20, 184, 166, 0.25);
    border-color: rgba(20, 184, 166, 0.5);
}

[data-theme="dark"] .ofma-badge.badge-bear-call-spread {
    background: rgba(139, 92, 246, 0.25);
    border-color: rgba(139, 92, 246, 0.5);
}

[data-theme="dark"] .ofma-badge.badge-iron-condor {
    background: rgba(245, 158, 11, 0.25);
    border-color: rgba(245, 158, 11, 0.5);
}

/* Strategy Panel Dark Mode */
[data-theme="dark"] .ofma-strategy-panel {
    background: var(--ofma-color-slate-800);
    border-color: var(--ofma-color-slate-700);
}

[data-theme="dark"] .ofma-strategy-panel__header:hover {
    background: rgba(255,255,255,0.03);
}

[data-theme="dark"] .ofma-strategy-panel__title {
    color: var(--ofma-color-slate-200);
}

[data-theme="dark"] .ofma-strategy-panel__toggle-icon {
    color: var(--ofma-color-slate-400);
}

[data-theme="dark"] .ofma-strategy-panel__content {
    border-top-color: var(--ofma-color-slate-700);
}

[data-theme="dark"] .ofma-strategy-panel__info {
    color: var(--ofma-color-slate-400);
}

[data-theme="dark"] .ofma-strategy-card {
    background: #1a1f2e;
    border-color: var(--ofma-color-slate-700);
}

[data-theme="dark"] .ofma-strategy-card:hover {
    border-color: var(--ofma-color-slate-600);
}

[data-theme="dark"] .ofma-strategy-card--locked:hover {
    border-color: var(--ofma-color-slate-700);
}

[data-theme="dark"] .ofma-strategy-card__header {
    background: rgba(255, 255, 255, 0.02);
}

[data-theme="dark"] .ofma-strategy-card__title {
    color: var(--ofma-color-slate-200);
}

[data-theme="dark"] .ofma-strategy-card__row {
    border-bottom-color: var(--ofma-color-slate-700);
}

[data-theme="dark"] .ofma-strategy-card__row--checkbox label {
    color: var(--ofma-color-slate-300);
}

[data-theme="dark"] .ofma-param-toggle {
    color: var(--ofma-color-slate-400);
}

[data-theme="dark"] .ofma-input--small {
    background: var(--ofma-color-slate-700);
    border-color: var(--ofma-color-slate-600);
    color: var(--ofma-color-slate-200);
}

[data-theme="dark"] .ofma-switch__slider {
    background-color: var(--ofma-color-slate-600);
}

[data-theme="dark"] .ofma-strategy-panel__actions {
    border-top-color: var(--ofma-color-slate-700);
}

/* =====================================================
   RESPONSIVE - STRATEGIES
   ===================================================== */
@media (max-width: 768px) {
    .ofma-strategy-grid {
        grid-template-columns: 1fr;
    }
    
    .ofma-strategy-card__row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .ofma-range-inputs {
        width: 100%;
        justify-content: flex-start;
    }
    
    .ofma-strategy-panel__actions {
        flex-direction: column;
    }
    
    .ofma-strategy-panel__actions .ofma-btn {
        width: 100%;
    }
    
    .ofma-badge {
        padding: 0.25rem 0.625rem;
        font-size: 0.625rem;
    }
    
    .ofma-badges {
        gap: 2px;
    }
}
