/* Profit Simulator */

.ps-subtitle {
    color: rgba(255,255,255,0.6);
    font-size: 14px;
    margin-bottom: 16px;
}

/* Card container */
.ps-card {
    background: rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
}

/* Grid layouts */
.ps-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    align-items: start;
}

/* Field */
.ps-field {
    margin-bottom: 4px;
}

.ps-label {
    display: block;
    color: rgba(255,255,255,0.85);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

/* Select dropdown */
.ps-select {
    width: 100%;
    padding: 10px 12px;
    background: rgba(255,255,255,0.06);
    border: 2px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='rgba(255,255,255,0.5)' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    cursor: pointer;
}

.ps-select:focus {
    outline: none;
    border-color: #7A95F8;
    background-color: rgba(255,255,255,0.1);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='rgba(255,255,255,0.5)' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.ps-select option {
    background: #1a1a2e;
    color: #fff;
}

/* Slider */
.ps-slider-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.ps-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7A95F8, #6453CA);
    border: 2px solid #fff;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(122,149,248,0.4);
}

.ps-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7A95F8, #6453CA);
    border: 2px solid #fff;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(122,149,248,0.4);
}

.ps-slider-value {
    color: #7A95F8;
    font-size: 20px;
    font-weight: 700;
    min-width: 48px;
    text-align: right;
}

/* Preset pills */
.ps-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.ps-preset {
    padding: 4px 12px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 20px;
    background: transparent;
    color: rgba(255,255,255,0.6);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.ps-preset:hover {
    border-color: #7A95F8;
    color: #fff;
    background: rgba(122,149,248,0.15);
}

/* Period buttons */
.ps-btn-row {
    display: flex;
    gap: 6px;
}

.ps-period-btn {
    flex: 1;
    padding: 10px 8px;
    border: 2px solid rgba(255,255,255,0.25);
    border-radius: 8px;
    background: transparent;
    color: rgba(255,255,255,0.75);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    font-weight: 500;
}

.ps-period-btn:hover {
    border-color: rgba(255,255,255,0.5);
    color: #fff;
}

.ps-period-btn.active {
    background: linear-gradient(100deg, #7A95F8 0%, #6453CA 100%);
    border-color: transparent;
    color: #fff;
    font-weight: 600;
}

/* Chart Section */
.ps-chart-section {
    background: rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 24px;
}

.ps-chart-header {
    margin-bottom: 16px;
}

.ps-section-title {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.ps-chart-note {
    color: rgba(255,255,255,0.4);
    font-size: 12px;
    margin-bottom: 0;
}

.ps-chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Legend */
.ps-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.ps-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ps-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.ps-legend-name {
    color: rgba(255,255,255,0.7);
    font-size: 12px;
    font-weight: 500;
}

.ps-legend-profit {
    font-size: 12px;
    font-weight: 700;
}

.ps-profit-pos { color: #22c55e; }
.ps-profit-neg { color: #ef4444; }

/* Metrics */
.ps-metrics {
    background: rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 20px;
}

.ps-metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.ps-metric-card {
    background: rgba(255,255,255,0.06);
    border-radius: 10px;
    padding: 16px 12px;
    text-align: center;
    transition: transform 0.2s, background 0.2s;
}

.ps-metric-card:hover {
    transform: translateY(-2px);
    background: rgba(255,255,255,0.1);
}

.ps-metric-highlight {
    border: 1px solid rgba(122,149,248,0.3);
    background: rgba(122,149,248,0.08);
}

.ps-metric-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(122,149,248,0.15);
    color: #7A95F8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    margin-bottom: 10px;
}

.ps-icon-roi {
    background: rgba(34,197,94,0.15);
    color: #22c55e;
}

.ps-icon-fast {
    background: rgba(251,191,36,0.15);
    color: #fbbf24;
}

.ps-icon-cheap {
    background: rgba(244,114,182,0.15);
    color: #f472b6;
}

.ps-metric-value {
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
    line-height: 1.2;
}

.ps-metric-label {
    color: rgba(255,255,255,0.6);
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 4px;
}

.ps-metric-firm {
    color: rgba(255,255,255,0.35);
    font-size: 11px;
}

/* Sort row */
.ps-sort-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.ps-sort-label {
    color: rgba(255,255,255,0.5);
    font-size: 12px;
    font-weight: 500;
}

.ps-sort-btn {
    padding: 5px 14px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 20px;
    background: transparent;
    color: rgba(255,255,255,0.6);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.ps-sort-btn:hover {
    border-color: rgba(255,255,255,0.4);
    color: #fff;
}

.ps-sort-btn.active {
    background: rgba(122,149,248,0.15);
    border-color: #7A95F8;
    color: #7A95F8;
    font-weight: 600;
}

/* Table Section */
.ps-table-section {
    background: rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 24px;
}

.ps-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.ps-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}

.ps-table thead th {
    color: rgba(255,255,255,0.5);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 12px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    white-space: nowrap;
}

.ps-th-rank { width: 40px; text-align: center; }
.ps-th-firm { text-align: left !important; min-width: 160px; }

.ps-table tbody td {
    padding: 12px 12px;
    text-align: center;
    color: rgba(255,255,255,0.75);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: background 0.15s;
    vertical-align: middle;
    white-space: nowrap;
}

.ps-table tbody tr:hover td {
    background: rgba(255,255,255,0.04);
}

.ps-row-top td {
    background: rgba(122,149,248,0.03);
}

/* Rank badges */
.ps-td-rank { text-align: center; }

.ps-rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
}

.ps-rank-gold { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.ps-rank-silver { background: linear-gradient(135deg, #94a3b8, #64748b); }
.ps-rank-bronze { background: linear-gradient(135deg, #d97706, #92400e); }
.ps-rank-num { color: rgba(255,255,255,0.4); font-size: 13px; }

/* Firm cell */
.ps-td-firm { text-align: left !important; }

.ps-firm-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ps-firm-logo {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    object-fit: contain;
    background: rgba(255,255,255,0.1);
    padding: 2px;
    flex-shrink: 0;
}

.ps-firm-name {
    font-weight: 600;
    color: #fff;
    font-size: 13px;
}

/* Badges */
.ps-split-badge {
    background: rgba(122,149,248,0.15);
    color: #7A95F8;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.ps-per-mo {
    color: rgba(255,255,255,0.35);
    font-size: 10px;
    margin-left: 2px;
}

.ps-be-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.ps-be-fast {
    background: rgba(34,197,94,0.15);
    color: #22c55e;
}

.ps-be-ok {
    background: rgba(251,191,36,0.15);
    color: #fbbf24;
}

.ps-be-slow {
    background: rgba(239,68,68,0.1);
    color: #ef4444;
}

.ps-td-profit { font-size: 14px; }

.ps-roi-val {
    font-weight: 700;
    font-size: 13px;
}

.ps-view-btn {
    display: inline-block;
    padding: 5px 14px;
    background: rgba(255,255,255,0.08);
    border-radius: 6px;
    color: rgba(255,255,255,0.7);
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.ps-view-btn:hover {
    background: linear-gradient(100deg, #7A95F8, #6453CA);
    color: #fff;
    text-decoration: none;
}

/* Empty state */
.ps-empty {
    text-align: center;
    color: rgba(255,255,255,0.4);
    font-size: 14px;
    padding: 32px 16px;
}

.ps-empty-cell {
    text-align: center !important;
    color: rgba(255,255,255,0.4) !important;
    padding: 32px 16px !important;
    font-size: 14px;
}

/* Disclaimer */
.ps-disclaimer {
    color: rgba(255,255,255,0.3);
    font-size: 11px;
    font-style: italic;
    text-align: center;
}

/* Explainer */
.ps-explainer {
    background: rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 24px;
}

.ps-explainer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 16px;
}

.ps-explainer-item {
    background: rgba(255,255,255,0.04);
    border-radius: 8px;
    padding: 16px;
    position: relative;
}

.ps-explainer-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7A95F8, #6453CA);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.ps-explainer-name {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
}

.ps-explainer-item p {
    color: rgba(255,255,255,0.55);
    font-size: 12px;
    line-height: 1.6;
    margin: 0;
}

/* CTA */
.ps-cta {
    text-align: center;
    padding: 24px;
    background: rgba(255,255,255,0.06);
    border-radius: 12px;
}

.ps-cta-text {
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    margin-bottom: 16px;
}

.ps-cta-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ps-cta-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.ps-cta-primary {
    background: linear-gradient(100deg, #7A95F8 0%, #6453CA 100%);
    color: #fff;
}

.ps-cta-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(122,149,248,0.3);
    color: #fff;
    text-decoration: none;
}

.ps-cta-secondary {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.8);
    border: 1px solid rgba(255,255,255,0.15);
}

.ps-cta-secondary:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
    text-decoration: none;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .ps-grid-3 {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .ps-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ps-metric-value {
        font-size: 18px;
    }

    .ps-explainer-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ps-btn-row {
        flex-wrap: wrap;
    }

    .ps-period-btn {
        padding: 8px 6px;
        font-size: 12px;
    }

    .ps-chart-container {
        height: 250px;
    }

    .ps-chart-legend {
        gap: 8px;
    }

    .ps-legend-item {
        flex-basis: calc(50% - 6px);
    }

    .ps-table {
        font-size: 12px;
    }

    .ps-firm-name {
        font-size: 12px;
        max-width: 100px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .ps-sort-row {
        gap: 6px;
    }
}

@media (max-width: 480px) {
    .ps-card,
    .ps-chart-section,
    .ps-table-section,
    .ps-metrics,
    .ps-explainer,
    .ps-cta {
        padding: 16px;
    }

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

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

    .ps-presets {
        gap: 4px;
    }

    .ps-preset {
        padding: 4px 10px;
        font-size: 11px;
    }

    .ps-cta-buttons {
        flex-direction: column;
    }

    .ps-table thead th,
    .ps-table tbody td {
        padding: 8px 6px;
        font-size: 11px;
    }

    .ps-firm-logo {
        width: 22px;
        height: 22px;
    }

    .ps-chart-container {
        height: 200px;
    }
}
