/* ═══════════════════════════════════════════════════════════════════════════
   promiscore.css — MyPromiScore Window Styles
   3D-Podium-Ranking, Weight-Sliders, Onboarding-Wizard, Ranking-Liste
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Window Shell ────────────────────────────────────────────────────────── */
#promiscore-window {
    width: 780px;
    min-width: 520px;
    height: 680px;
    min-height: 480px;
    z-index: var(--z-window-base, 200);
    overflow: hidden;
}

#promiscore-window .unified-body {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    padding: 0;
}

/* ─── Tab Bar ─────────────────────────────────────────────────────────────── */
.ps-tab-bar {
    display: flex;
    gap: 2px;
    padding: 6px 12px;
    background: var(--bg-secondary, rgba(20, 20, 35, 0.95));
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    flex-shrink: 0;
}

.ps-tab-btn {
    flex: 1;
    padding: 8px 10px;
    border: none;
    border-radius: 8px 8px 0 0;
    background: transparent;
    color: var(--text-secondary, rgba(255, 255, 255, 0.55));
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.ps-tab-btn:hover {
    background: rgba(34, 197, 94, 0.1);
    color: var(--text-primary, #fff);
}

.ps-tab-btn.active {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border-bottom: 2px solid #22c55e;
}

/* ─── Tab Panels ──────────────────────────────────────────────────────────── */
.ps-panel {
    display: none;
    flex: 1;
    overflow: auto;
    padding: 0;
}

.ps-panel.active {
    display: flex;
    flex-direction: column;
}

/* ─── 3D Podium Panel ─────────────────────────────────────────────────────── */
.ps-podium-container {
    flex: 1;
    min-height: 300px;
    background: #0a0a1a;
    position: relative;
    overflow: hidden;
}

.ps-podium-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.ps-podium-overlay {
    position: absolute;
    bottom: 12px;
    left: 12px;
    right: 12px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    pointer-events: none;
    z-index: 2;
}

.ps-podium-hint {
    color: rgba(255, 255, 255, 0.45);
    font-size: 11px;
    pointer-events: none;
}

.ps-podium-actions {
    display: flex;
    gap: 6px;
    pointer-events: auto;
}

.ps-podium-btn {
    padding: 6px 12px;
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 6px;
    background: rgba(10, 10, 26, 0.85);
    color: #22c55e;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ps-podium-btn:hover {
    background: rgba(34, 197, 94, 0.2);
    border-color: #22c55e;
}

/* ─── Ranking List ────────────────────────────────────────────────────────── */
.ps-ranking-list {
    list-style: none;
    margin: 0;
    padding: 8px 12px;
    overflow-y: auto;
    flex: 1;
}

.ps-ranking-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.ps-ranking-item:hover {
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.2);
}

.ps-ranking-item.rank-1 { background: rgba(255, 215, 0, 0.08); }
.ps-ranking-item.rank-2 { background: rgba(192, 192, 192, 0.06); }
.ps-ranking-item.rank-3 { background: rgba(205, 127, 50, 0.06); }

.ps-rank-badge {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.ps-rank-badge.gold { background: linear-gradient(135deg, #FFD700, #FFA500); color: #000; }
.ps-rank-badge.silver { background: linear-gradient(135deg, #C0C0C0, #A0A0A0); color: #000; }
.ps-rank-badge.bronze { background: linear-gradient(135deg, #CD7F32, #A0522D); color: #fff; }
.ps-rank-badge.default { background: rgba(34, 197, 94, 0.15); color: #22c55e; }

.ps-rank-info {
    flex: 1;
    min-width: 0;
}

.ps-rank-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary, #fff);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ps-rank-subtitle {
    font-size: 11px;
    color: var(--text-secondary, rgba(255, 255, 255, 0.5));
    margin-top: 1px;
}

.ps-rank-score {
    font-weight: 700;
    font-size: 18px;
    color: #22c55e;
    flex-shrink: 0;
}

.ps-rank-bar {
    width: 100px;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
    flex-shrink: 0;
}

.ps-rank-bar-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, #22c55e, #4ade80);
    transition: width 0.4s ease;
}

.ps-rank-bar-fill.gold { background: linear-gradient(90deg, #FFD700, #FFA500); }
.ps-rank-bar-fill.silver { background: linear-gradient(90deg, #C0C0C0, #e0e0e0); }
.ps-rank-bar-fill.bronze { background: linear-gradient(90deg, #CD7F32, #daa520); }

/* ─── Weight Sliders Panel ────────────────────────────────────────────────── */
.ps-weights-panel {
    padding: 12px 16px;
    overflow-y: auto;
    flex: 1;
}

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

.ps-weights-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #fff);
}

.ps-weights-reset {
    padding: 4px 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 5px;
    background: transparent;
    color: var(--text-secondary, rgba(255, 255, 255, 0.6));
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ps-weights-reset:hover {
    border-color: #22c55e;
    color: #22c55e;
}

.ps-weight-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.ps-weight-icon {
    font-size: 18px;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}

.ps-weight-label {
    font-size: 13px;
    color: var(--text-primary, #fff);
    min-width: 130px;
    flex-shrink: 0;
}

.ps-weight-slider {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.ps-weight-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #22c55e;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: transform 0.15s ease;
}

.ps-weight-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.ps-weight-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #22c55e;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.ps-weight-value {
    font-size: 12px;
    color: #22c55e;
    font-weight: 600;
    min-width: 24px;
    text-align: right;
    flex-shrink: 0;
}

/* ─── Onboarding Wizard ───────────────────────────────────────────────────── */
.ps-onboarding {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px 20px;
    overflow-y: auto;
}

.ps-onboarding-intro {
    text-align: center;
    padding: 20px 0 16px;
}

.ps-onboarding-emoji {
    font-size: 48px;
    margin-bottom: 10px;
}

.ps-onboarding-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary, #fff);
    margin-bottom: 6px;
}

.ps-onboarding-desc {
    font-size: 13px;
    color: var(--text-secondary, rgba(255, 255, 255, 0.6));
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.5;
}

/* KG Auto-Fill button */
.ps-kg-autofill {
    margin: 14px auto 4px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(59, 130, 246, 0.25));
    border: 1px solid rgba(139, 92, 246, 0.4);
    color: #c4b5fd;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ps-kg-autofill:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.4), rgba(59, 130, 246, 0.4));
    border-color: rgba(139, 92, 246, 0.6);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}
.ps-kg-autofill-hint {
    font-size: 11px;
    color: var(--text-secondary, rgba(255, 255, 255, 0.4));
    margin-top: 4px;
    font-style: italic;
}

.ps-onboarding-step {
    display: none;
    flex-direction: column;
    gap: 12px;
    padding: 12px 0;
}

.ps-onboarding-step.active {
    display: flex;
}

.ps-onboarding-step-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #fff);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ps-onboarding-step-hint {
    font-size: 12px;
    color: var(--text-secondary, rgba(255, 255, 255, 0.5));
    line-height: 1.4;
}

.ps-onboarding-input {
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary, #fff);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

.ps-onboarding-input:focus {
    border-color: #22c55e;
}

.ps-onboarding-select {
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(20, 20, 35, 0.95);
    color: var(--text-primary, #fff);
    font-size: 14px;
    cursor: pointer;
    outline: none;
}

.ps-onboarding-select:focus {
    border-color: #22c55e;
}

.ps-onboarding-slider-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ps-onboarding-slider {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
}

.ps-onboarding-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #22c55e;
    cursor: pointer;
}

.ps-onboarding-slider-value {
    font-size: 16px;
    font-weight: 700;
    color: #22c55e;
    min-width: 30px;
    text-align: center;
}

.ps-onboarding-nav {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-top: 16px;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.ps-onboarding-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ps-onboarding-btn.secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary, rgba(255, 255, 255, 0.6));
}

.ps-onboarding-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.ps-onboarding-btn.primary {
    background: #22c55e;
    color: #000;
}

.ps-onboarding-btn.primary:hover {
    background: #4ade80;
}

.ps-onboarding-progress {
    display: flex;
    gap: 4px;
    justify-content: center;
    padding: 10px 0 6px;
}

.ps-onboarding-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
}

.ps-onboarding-dot.active {
    background: #22c55e;
    transform: scale(1.2);
}

.ps-onboarding-dot.done {
    background: rgba(34, 197, 94, 0.5);
}

/* ─── Profile Summary (in Onboarding) ─────────────────────────────────────── */
.ps-profile-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 12px 0;
}

.ps-profile-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(34, 197, 94, 0.06);
    border: 1px solid rgba(34, 197, 94, 0.12);
    font-size: 12px;
    color: var(--text-primary, #fff);
}

.ps-profile-chip-icon {
    font-size: 16px;
}

/* ─── Empty / Loading States ──────────────────────────────────────────────── */
.ps-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px 20px;
    text-align: center;
    color: var(--text-secondary, rgba(255, 255, 255, 0.5));
}

.ps-empty-icon {
    font-size: 48px;
}

.ps-empty-text {
    font-size: 14px;
    line-height: 1.5;
}

.ps-empty-action {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    background: #22c55e;
    color: #000;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ps-empty-action:hover {
    background: #4ade80;
}

/* ─── Gallery Badge (PromiScore on personality cards) ─────────────────────── */
.pg-promiscore-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.08));
    border: 1px solid rgba(34, 197, 94, 0.25);
    font-size: 11px;
    font-weight: 700;
    color: #4ade80;
    cursor: help;
    transition: all 0.2s ease;
}

.pg-promiscore-badge:hover {
    background: rgba(34, 197, 94, 0.25);
    border-color: #22c55e;
}

.pg-promiscore-badge .badge-star {
    font-size: 10px;
}

/* ─── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    #promiscore-window {
        width: 100vw;
        height: 100vh;
        min-width: unset;
    }

    .ps-profile-summary {
        grid-template-columns: 1fr;
    }

    .ps-weight-label {
        min-width: 100px;
        font-size: 12px;
    }
}
