/* ============================================================
   PAYMENT FLOW — Interactive Money Flow Diagram Styles
   ============================================================ */

.pf-wrap {
    --pf-bg: #0f172a;
    --pf-panel: rgba(17, 25, 40, 0.75);
    --pf-border: rgba(148, 163, 184, 0.18);
    --pf-accent: #7c3aed;
    --pf-accent-2: #06b6d4;
    --pf-accent-3: #f59e0b;
    --pf-green: #22d3ee;
    --pf-red: #f43f5e;
    --pf-text: #e2e8f0;
    --pf-muted: #94a3b8;

    color: var(--pf-text);
    padding: 24px 28px;
    background:
        radial-gradient(1200px 500px at 10% -10%, rgba(124, 58, 237, 0.25), transparent 60%),
        radial-gradient(900px 500px at 100% 10%, rgba(6, 182, 212, 0.18), transparent 60%),
        radial-gradient(700px 400px at 50% 100%, rgba(245, 158, 11, 0.12), transparent 60%),
        linear-gradient(180deg, #0b1220 0%, #0f172a 100%);
    border-radius: 20px;
    min-height: 100vh;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.pf-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.pf-title {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0;
    background: linear-gradient(90deg, #a78bfa, #22d3ee, #f59e0b);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.pf-subtitle {
    color: var(--pf-muted);
    font-size: 14px;
    margin-top: 4px;
}

.pf-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(34, 211, 238, 0.12);
    color: #67e8f9;
    border: 1px solid rgba(34, 211, 238, 0.25);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.pf-badge::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #22d3ee;
    border-radius: 50%;
    box-shadow: 0 0 12px #22d3ee;
    animation: pf-pulse 1.4s ease-in-out infinite;
}

@keyframes pf-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.7); }
}

/* Filter panel */
.pf-filters {
    display: grid;
    grid-template-columns: 1fr 2fr auto;
    gap: 18px;
    background: var(--pf-panel);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--pf-border);
    border-radius: 16px;
    padding: 18px 20px;
    margin-bottom: 20px;
}

@media (max-width: 900px) {
    .pf-filters { grid-template-columns: 1fr; }
}

.pf-field-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--pf-muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.pf-field-label .pf-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--pf-accent);
    box-shadow: 0 0 8px var(--pf-accent);
}

.pf-field-label.currency .pf-dot {
    background: var(--pf-accent-2);
    box-shadow: 0 0 8px var(--pf-accent-2);
}

/* Restyle Dash Dropdowns inside .pf-wrap */
.pf-wrap .Select-control,
.pf-wrap .Select--single > .Select-control,
.pf-wrap .Select--multi .Select-control {
    background-color: rgba(15, 23, 42, 0.7) !important;
    border: 1px solid var(--pf-border) !important;
    border-radius: 10px !important;
    color: var(--pf-text) !important;
    min-height: 44px !important;
    box-shadow: none !important;
}

.pf-wrap .Select-value,
.pf-wrap .Select-value-label,
.pf-wrap .Select-placeholder,
.pf-wrap .Select-input > input {
    color: var(--pf-text) !important;
}

.pf-wrap .Select-menu-outer {
    background-color: #0f172a !important;
    border: 1px solid var(--pf-border) !important;
    border-radius: 10px !important;
    color: var(--pf-text) !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5) !important;
    z-index: 1000 !important;
}

/* Prevent lower panels from covering the open dropdown */
.pf-wrap .Select.is-open {
    position: relative;
    z-index: 1000;
}

.pf-filters {
    position: relative;
    z-index: 500;
}

.pf-wrap .VirtualizedSelectOption {
    color: var(--pf-text) !important;
    background-color: transparent !important;
}

.pf-wrap .VirtualizedSelectFocusedOption {
    background-color: rgba(124, 58, 237, 0.2) !important;
}

.pf-wrap .Select--multi .Select-value {
    background-color: rgba(6, 182, 212, 0.18) !important;
    border: 1px solid rgba(6, 182, 212, 0.4) !important;
    color: #67e8f9 !important;
    border-radius: 999px !important;
    padding: 2px 4px !important;
}

.pf-wrap .Select--multi .Select-value-icon {
    border-right: 1px solid rgba(6, 182, 212, 0.35) !important;
    color: #67e8f9 !important;
}

/* Refresh button (header) */
.pf-refresh-btn {
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.15), rgba(124, 58, 237, 0.15));
    border: 1px solid rgba(34, 211, 238, 0.35);
    color: #67e8f9;
    padding: 8px 14px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}

.pf-refresh-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(34, 211, 238, 0.25);
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.25), rgba(124, 58, 237, 0.25));
}

.pf-refresh-btn:active {
    transform: translateY(0);
}

/* Freshness line */
.pf-freshness {
    display: flex;
    justify-content: flex-end;
    margin: -8px 4px 12px;
    font-size: 12px;
}

.pf-freshness-inner {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--pf-text);
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid var(--pf-border);
    padding: 5px 12px;
    border-radius: 999px;
    backdrop-filter: blur(8px);
}

/* Reset button */
.pf-reset {
    align-self: end;
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.15), rgba(124, 58, 237, 0.15));
    border: 1px solid rgba(244, 63, 94, 0.35);
    color: #fda4af;
    padding: 10px 18px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.pf-reset:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(244, 63, 94, 0.25);
}

/* Stats strip */
.pf-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

@media (max-width: 900px) {
    .pf-stats { grid-template-columns: repeat(2, 1fr); }
}

.pf-stat {
    position: relative;
    background: var(--pf-panel);
    backdrop-filter: blur(14px);
    border: 1px solid var(--pf-border);
    border-radius: 14px;
    padding: 16px 18px;
    overflow: hidden;
    animation: pf-fade-up 0.5s ease both;
}

.pf-stat::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 60%, currentColor 200%);
    opacity: 0.06;
    pointer-events: none;
}

.pf-stat .pf-stat-label {
    font-size: 11px;
    color: var(--pf-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
}

.pf-stat .pf-stat-value {
    font-size: 30px;
    font-weight: 800;
    margin-top: 4px;
    letter-spacing: -0.02em;
}

.pf-stat.--accent .pf-stat-value { color: #a78bfa; }
.pf-stat.--cyan   .pf-stat-value { color: #22d3ee; }
.pf-stat.--gold   .pf-stat-value { color: #fbbf24; }
.pf-stat.--rose   .pf-stat-value { color: #fb7185; }

/* Main content */
.pf-main {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 20px;
}

@media (max-width: 1200px) {
    .pf-main { grid-template-columns: 1fr; }
}

.pf-diagram-card,
.pf-methods-card {
    background: var(--pf-panel);
    backdrop-filter: blur(14px);
    border: 1px solid var(--pf-border);
    border-radius: 16px;
    padding: 18px 20px;
    min-height: 620px;
}

.pf-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.pf-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--pf-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.pf-card-title .pf-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--pf-accent), var(--pf-accent-2));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    box-shadow: 0 8px 20px rgba(124, 58, 237, 0.4);
}

.pf-card-hint {
    color: var(--pf-muted);
    font-size: 12px;
}

/* Method cards list */
.pf-methods-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 560px;
    overflow-y: auto;
    padding-right: 4px;
}

.pf-methods-list::-webkit-scrollbar {
    width: 6px;
}
.pf-methods-list::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.25);
    border-radius: 3px;
}

.pf-method {
    position: relative;
    display: grid;
    grid-template-columns: 44px 1fr auto;
    gap: 12px;
    align-items: center;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.75), rgba(15, 23, 42, 0.65));
    border: 1px solid var(--pf-border);
    border-radius: 12px;
    padding: 12px 14px;
    animation: pf-slide-in 0.45s cubic-bezier(.22,.61,.36,1) both;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.pf-method:hover {
    transform: translateY(-2px);
    border-color: rgba(124, 58, 237, 0.45);
    box-shadow: 0 10px 25px rgba(124, 58, 237, 0.15);
}

.pf-method .pf-method-avatar {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 15px;
    background: linear-gradient(135deg, #7c3aed, #06b6d4);
    box-shadow: 0 6px 18px rgba(124, 58, 237, 0.35);
}

.pf-method .pf-method-name {
    font-weight: 700;
    font-size: 14px;
    color: var(--pf-text);
    letter-spacing: -0.01em;
}

.pf-method-code {
    font-family: 'SF Mono', ui-monospace, Consolas, Monaco, monospace;
    font-size: 11px;
    color: #94a3b8;
    letter-spacing: 0.02em;
    margin-top: 2px;
    opacity: 0.85;
    user-select: all;
    cursor: text;
}

.pf-chip.--provider {
    background: rgba(167, 139, 250, 0.16);
    color: #c4b5fd;
    border-color: rgba(167, 139, 250, 0.32);
    text-transform: capitalize;
}

.pf-method .pf-method-sub {
    font-size: 11px;
    color: var(--pf-muted);
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pf-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.14);
    color: var(--pf-text);
    font-size: 10.5px;
    font-weight: 600;
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.pf-chip.--currency {
    background: rgba(6, 182, 212, 0.16);
    color: #67e8f9;
    border-color: rgba(6, 182, 212, 0.3);
}

.pf-chip.--commission {
    background: rgba(245, 158, 11, 0.16);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.3);
}

.pf-chip.--type {
    background: rgba(124, 58, 237, 0.16);
    color: #c4b5fd;
    border-color: rgba(124, 58, 237, 0.3);
}

.pf-method-commission {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    min-width: 96px;
}

.pf-method-commission > div:first-of-type,
.pf-comm-input-wrap {
    display: flex;
    align-items: baseline;
    gap: 3px;
}

.pf-comm-input {
    width: 68px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.25);
    color: #fbbf24;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.02em;
    text-align: right;
    padding: 4px 8px;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    /* hide native number spinners */
    -moz-appearance: textfield;
}
.pf-comm-input::-webkit-outer-spin-button,
.pf-comm-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.pf-comm-input:hover {
    border-color: rgba(245, 158, 11, 0.5);
    background: rgba(15, 23, 42, 0.9);
}

.pf-comm-input:focus {
    border-color: #fbbf24;
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.18);
    background: rgba(15, 23, 42, 0.95);
}

.pf-comm-input.--overridden {
    color: #22d3ee;
    border-color: rgba(6, 182, 212, 0.55);
    background: rgba(6, 182, 212, 0.08);
    box-shadow: 0 0 12px rgba(6, 182, 212, 0.15);
}

.pf-comm-unit {
    color: var(--pf-muted);
    font-size: 12px;
    font-weight: 700;
}

.pf-comm-original {
    font-size: 10px;
    color: #67e8f9;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    font-weight: 600;
    text-align: right;
    min-height: 12px;
}

.pf-method.--overridden {
    border-color: rgba(6, 182, 212, 0.45);
    box-shadow: inset 3px 0 0 #22d3ee;
}

/* Overrides badge + reset button in methods header */
.pf-overrides-badge {
    display: inline-flex;
    align-items: center;
    color: #67e8f9;
    background: rgba(6, 182, 212, 0.12);
    border: 1px solid rgba(6, 182, 212, 0.35);
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.pf-overrides-badge:empty {
    display: none;
}

.pf-reset-comm {
    background: rgba(30, 41, 59, 0.7);
    color: var(--pf-muted);
    border: 1px solid var(--pf-border);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.pf-reset-comm:hover {
    color: #fda4af;
    border-color: rgba(244, 63, 94, 0.4);
}

/* Empty state */
.pf-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--pf-muted);
    text-align: center;
    animation: pf-fade-up 0.5s ease both;
}

.pf-empty .pf-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    filter: drop-shadow(0 6px 18px rgba(244, 63, 94, 0.35));
}

.pf-empty .pf-empty-title {
    color: var(--pf-text);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

/* Keyframe animations */
@keyframes pf-fade-up {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes pf-slide-in {
    from { opacity: 0; transform: translateX(-14px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* Stagger for method cards */
.pf-method:nth-child(1)  { animation-delay: 0.02s; }
.pf-method:nth-child(2)  { animation-delay: 0.05s; }
.pf-method:nth-child(3)  { animation-delay: 0.08s; }
.pf-method:nth-child(4)  { animation-delay: 0.11s; }
.pf-method:nth-child(5)  { animation-delay: 0.14s; }
.pf-method:nth-child(6)  { animation-delay: 0.17s; }
.pf-method:nth-child(7)  { animation-delay: 0.20s; }
.pf-method:nth-child(8)  { animation-delay: 0.23s; }
.pf-method:nth-child(9)  { animation-delay: 0.26s; }
.pf-method:nth-child(10) { animation-delay: 0.29s; }
.pf-method:nth-child(n+11) { animation-delay: 0.32s; }

/* Diagram inner styling */
.pf-diagram-canvas {
    border-radius: 12px;
    background:
        radial-gradient(600px 300px at 20% 20%, rgba(124, 58, 237, 0.15), transparent 60%),
        radial-gradient(400px 260px at 80% 80%, rgba(6, 182, 212, 0.15), transparent 60%),
        rgba(15, 23, 42, 0.55);
    padding: 8px;
}

/* Legend */
.pf-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
    padding: 10px 12px;
    background: rgba(15, 23, 42, 0.55);
    border-radius: 10px;
    border: 1px dashed rgba(148, 163, 184, 0.22);
    font-size: 12px;
    color: var(--pf-muted);
}

.pf-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid var(--pf-border);
    border-radius: 999px;
    color: var(--pf-text);
    white-space: nowrap;
}

.pf-legend-swatch {
    width: 12px;
    height: 12px;
    border-radius: 4px;
    box-shadow: 0 0 10px currentColor;
    flex-shrink: 0;
}
