/* Position Size Calculator */

.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 layout */
.ps-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* 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;
}

/* Input with prefix/suffix */
.ps-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.ps-input {
    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;
}

.ps-input:focus {
    outline: none;
    border-color: #7A95F8;
    background: rgba(255,255,255,0.1);
}

.ps-input-prefix {
    position: absolute;
    left: 12px;
    color: rgba(255,255,255,0.4);
    font-size: 14px;
    pointer-events: none;
    z-index: 1;
}

.ps-input-suffix {
    position: absolute;
    right: 12px;
    color: rgba(255,255,255,0.4);
    font-size: 14px;
    pointer-events: none;
}

.ps-input-wrap .ps-input-prefix + .ps-input {
    padding-left: 28px;
}

.ps-input-wrap .ps-input:has(~ .ps-input-suffix) {
    padding-right: 40px;
}

/* Select */
.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;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='rgba(255,255,255,0.5)' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.ps-select:focus {
    outline: none;
    border-color: #7A95F8;
    background-color: rgba(255,255,255,0.1);
}

.ps-select option,
.ps-select optgroup {
    background: #2d1b69;
    color: #fff;
}

/* 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);
}

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

.ps-results-title {
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    text-align: center;
}

/* Metric cards */
.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%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    margin-bottom: 10px;
}

.ps-metric-icon-lots {
    background: rgba(122,149,248,0.15);
    color: #7A95F8;
}

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

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

.ps-metric-icon-rr {
    background: rgba(168,85,247,0.15);
    color: #a855f7;
}

.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.7);
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 4px;
}

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

/* Risk gauge */
.ps-gauge {
    background: rgba(255,255,255,0.06);
    border-radius: 10px;
    padding: 16px;
}

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

.ps-gauge-label {
    color: rgba(255,255,255,0.7);
    font-size: 13px;
    font-weight: 600;
}

.ps-gauge-pct {
    color: #fff;
    font-size: 16px;
    font-weight: 700;
}

.ps-gauge-track {
    width: 100%;
    height: 12px;
    background: rgba(255,255,255,0.08);
    border-radius: 6px;
    overflow: hidden;
}

.ps-gauge-fill {
    height: 100%;
    border-radius: 6px;
    background: linear-gradient(90deg, #22c55e, #22c55e);
    transition: width 0.4s ease, background 0.4s ease;
    min-width: 0;
}

.ps-gauge-fill.ps-gauge-moderate {
    background: linear-gradient(90deg, #22c55e, #fbbf24);
}

.ps-gauge-fill.ps-gauge-aggressive {
    background: linear-gradient(90deg, #fbbf24, #ef4444);
}

.ps-gauge-legend {
    display: flex;
    gap: 16px;
    margin-top: 8px;
    font-size: 11px;
    color: rgba(255,255,255,0.45);
}

.ps-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
}

.ps-dot-conservative { background: #22c55e; }
.ps-dot-moderate { background: #fbbf24; }
.ps-dot-aggressive { background: #ef4444; }

/* Tables */
.ps-scaling,
.ps-rr-table {
    background: rgba(255,255,255,0.06);
    border-radius: 10px;
    padding: 16px;
}

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

.ps-table-wrap {
    overflow-x: auto;
    margin-top: 12px;
    -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: 12px;
    padding: 8px 12px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.ps-table thead th:first-child {
    text-align: left;
}

.ps-table tbody td {
    padding: 8px 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;
}

.ps-table tbody td:first-child {
    text-align: left;
    font-weight: 500;
}

.ps-table-label {
    white-space: nowrap;
}

.ps-row-current {
    background: rgba(122,149,248,0.1);
}

.ps-row-current td {
    color: #fff;
    font-weight: 600;
}

.ps-current-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    color: #7A95F8;
    background: rgba(122,149,248,0.2);
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 4px;
    letter-spacing: 0.5px;
}

.ps-cell-profit {
    color: #22c55e !important;
    font-weight: 600;
}

.ps-cell-impact {
    color: #22c55e !important;
}

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

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

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

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

.ps-explainer-name i {
    color: #7A95F8;
    margin-right: 6px;
}

.ps-explainer-item p {
    color: rgba(255,255,255,0.6);
    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-2 {
        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: 1fr;
    }

    .ps-gauge-legend {
        flex-wrap: wrap;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .ps-card,
    .ps-results,
    .ps-cta {
        padding: 16px;
    }

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

    .ps-presets {
        gap: 4px;
    }

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

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

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

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