/* Paper Trading — AI Stock Sage */

/* ------------------------------------------------------------------ */
/* Layout                                                               */
/* ------------------------------------------------------------------ */

.pt-view {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.pt-view-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.pt-view-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.pt-view-title i {
    color: #00D924;
}

.pt-view-subtitle {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.9rem;
    margin: 0;
}

/* ------------------------------------------------------------------ */
/* Stat Cards                                                           */
/* ------------------------------------------------------------------ */

.pt-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

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

@media (max-width: 600px) {
    .pt-stats-grid { grid-template-columns: 1fr; }
    .pt-view { padding: 1rem; }
}

.pt-stat-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: border-color 0.2s;
}

.pt-stat-card:hover {
    border-color: rgba(255, 255, 255, 0.14);
}

.pt-stat-icon {
    width: 40px;
    height: 40px;
    background: rgba(0, 217, 36, 0.08);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #00D924;
    font-size: 1rem;
}

.pt-stat-body {
    min-width: 0;
}

.pt-stat-label {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.45);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.3rem;
}

.pt-stat-value {
    font-size: 1.35rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pt-stat-sub {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 0.15rem;
}

/* ------------------------------------------------------------------ */
/* P&L Colors                                                          */
/* ------------------------------------------------------------------ */

.pt-positive { color: #00D924 !important; }
.pt-negative { color: #ef4444 !important; }
.pt-neutral   { color: rgba(255, 255, 255, 0.4); }

/* ------------------------------------------------------------------ */
/* Main Grid                                                            */
/* ------------------------------------------------------------------ */

.pt-main-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
    align-items: start;
}

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

/* ------------------------------------------------------------------ */
/* Panels                                                               */
/* ------------------------------------------------------------------ */

.pt-panel {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
}

.pt-panel-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    padding: 1.1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pt-panel-title i {
    color: #00D924;
    font-size: 0.85rem;
}

/* ------------------------------------------------------------------ */
/* Trade Form                                                           */
/* ------------------------------------------------------------------ */

.pt-form-panel {
    padding: 0;
}

.pt-trade-form {
    padding: 1.4rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.pt-form-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    margin: 0 0 0.25rem;
}

.pt-side-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 6px;
    padding: 3px;
    gap: 3px;
}

.pt-side-btn {
    padding: 0.55rem;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s;
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
}

.pt-side-btn.active-buy {
    background: rgba(0, 217, 36, 0.15);
    color: #00D924;
    border: 1px solid rgba(0, 217, 36, 0.3);
}

.pt-side-btn.active-sell {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.pt-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.pt-field label {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.45);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pt-field input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 0.6rem 0.8rem;
    color: #fff;
    font-size: 0.95rem;
    transition: border-color 0.2s;
    outline: none;
    box-sizing: border-box;
}

.pt-field input:focus {
    border-color: rgba(0, 217, 36, 0.4);
    background: rgba(255, 255, 255, 0.07);
}

.pt-field input::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

/* Autocomplete */
.pt-suggestions {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #161616;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    z-index: 100;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.pt-suggestion-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.9rem;
    cursor: pointer;
    transition: background 0.15s;
}

.pt-suggestion-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.pt-sugg-sym {
    font-weight: 700;
    font-size: 0.9rem;
    color: #fff;
    min-width: 50px;
}

.pt-sugg-name {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.45);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Price preview */
.pt-price-preview {
    background: rgba(0, 217, 36, 0.05);
    border: 1px solid rgba(0, 217, 36, 0.15);
    border-radius: 6px;
    padding: 0.6rem 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.pt-price-name {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pt-price-val {
    font-size: 1rem;
    font-weight: 600;
    color: #00D924;
    white-space: nowrap;
}

.pt-price-loading {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
}

/* Order type toggle */
.pt-order-type-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.pt-type-btn {
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 5px;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.pt-type-btn.active {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
    color: #fff;
}

/* Cost estimate */
.pt-cost-estimate {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 6px;
    padding: 0.6rem 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.55);
}

.pt-cost-estimate.pt-cost-insufficient {
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.05);
}

.pt-cost-val {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
}

.pt-cost-warn {
    font-size: 0.8rem;
    color: #ef4444;
    margin-top: 0.15rem;
}

/* Error */
.pt-form-error {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 6px;
    padding: 0.6rem 0.8rem;
    color: #ef4444;
    font-size: 0.85rem;
}

/* Submit */
.pt-submit-btn {
    width: 100%;
    padding: 0.75rem;
    background: #00D924;
    color: #000;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
}

.pt-submit-btn:hover:not(:disabled) {
    opacity: 0.88;
}

.pt-submit-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pt-submit-btn.sell {
    background: #ef4444;
    color: #fff;
}

.pt-cash-note {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.35);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

/* ------------------------------------------------------------------ */
/* Positions / Trades Table                                             */
/* ------------------------------------------------------------------ */

.pt-positions-wrapper {
    overflow-x: auto;
}

.pt-positions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.pt-positions-table th {
    text-align: left;
    padding: 0.7rem 1rem;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.35);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    white-space: nowrap;
}

.pt-positions-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.8);
    vertical-align: middle;
}

.pt-position-row:last-child td,
.pt-trade-row:last-child td {
    border-bottom: none;
}

.pt-position-row:hover td,
.pt-trade-row:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.pt-pos-symbol {
    font-weight: 700;
    color: #fff;
    font-size: 0.9rem;
}

.pt-pos-name {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.35);
    margin-top: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 110px;
}

.pt-pnl-pct {
    font-size: 0.75rem;
    opacity: 0.8;
}

.pt-date-cell {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.45);
    white-space: nowrap;
}

.pt-type-cell {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: capitalize;
}

/* Badges */
.pt-side-badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.pt-side-badge.buy {
    background: rgba(0, 217, 36, 0.12);
    color: #00D924;
}

.pt-side-badge.sell {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

.pt-status-badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: capitalize;
}

.pt-status-badge.filled   { background: rgba(0, 217, 36, 0.12); color: #00D924; }
.pt-status-badge.pending  { background: rgba(251, 191, 36, 0.12); color: #fbbf24; }
.pt-status-badge.cancelled { background: rgba(255, 255, 255, 0.06); color: rgba(255, 255, 255, 0.35); }

/* Action buttons in table */
.pt-sell-btn,
.pt-cancel-btn {
    width: 28px;
    height: 28px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    background: transparent;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    transition: all 0.2s;
}

.pt-sell-btn:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.07);
}

.pt-cancel-btn:hover {
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
}

/* ------------------------------------------------------------------ */
/* Bottom Panel — Tabs                                                  */
/* ------------------------------------------------------------------ */

.pt-bottom-panel {
    min-height: 200px;
}

.pt-inner-tabs {
    display: flex;
    gap: 0.25rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    overflow-x: auto;
    scrollbar-width: none;
}

.pt-inner-tabs::-webkit-scrollbar { display: none; }

.pt-inner-tab {
    padding: 0.45rem 0.9rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 5px;
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.pt-inner-tab:hover {
    color: rgba(255, 255, 255, 0.75);
    border-color: rgba(255, 255, 255, 0.15);
}

.pt-inner-tab.active {
    background: rgba(0, 217, 36, 0.1);
    border-color: rgba(0, 217, 36, 0.3);
    color: #00D924;
}

.pt-tab-content {
    padding: 1rem 0;
}

/* ------------------------------------------------------------------ */
/* Portfolio Chart                                                      */
/* ------------------------------------------------------------------ */

.pt-chart-wrapper {
    padding: 1rem 1.5rem;
    height: 280px;
    position: relative;
}

.pt-chart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 180px;
    color: rgba(255, 255, 255, 0.2);
    gap: 0.75rem;
    text-align: center;
    padding: 2rem;
}

.pt-chart-empty i {
    font-size: 2.5rem;
    opacity: 0.3;
}

.pt-chart-empty p {
    font-size: 0.9rem;
    margin: 0;
}

/* ------------------------------------------------------------------ */
/* Analytics Grid                                                       */
/* ------------------------------------------------------------------ */

.pt-analytics-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
}

.pt-analytics-card {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    min-width: 160px;
    flex: 1;
}

.pt-analytics-icon {
    width: 36px;
    height: 36px;
    background: rgba(0, 217, 36, 0.07);
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #00D924;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.pt-analytics-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
}

.pt-analytics-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.38);
    margin-top: 0.15rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ------------------------------------------------------------------ */
/* Empty / Loading states                                               */
/* ------------------------------------------------------------------ */

.pt-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    color: rgba(255, 255, 255, 0.2);
    gap: 0.5rem;
    text-align: center;
}

.pt-empty-state i {
    font-size: 2rem;
    opacity: 0.25;
    margin-bottom: 0.25rem;
}

.pt-empty-state p {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.35);
    margin: 0;
}

.pt-empty-state span {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.2);
}

.pt-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    height: 300px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.95rem;
}

.pt-spinner {
    width: 32px;
    height: 32px;
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-top-color: #00D924;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

/* ------------------------------------------------------------------ */
/* Buttons                                                              */
/* ------------------------------------------------------------------ */

.pt-reset-btn {
    padding: 0.6rem 1.1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s;
    white-space: nowrap;
}

.pt-reset-btn:hover {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.06);
}

.pt-confirm-reset-btn {
    padding: 0.65rem 1.25rem;
    background: #ef4444;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.pt-confirm-reset-btn:hover:not(:disabled) { opacity: 0.85; }
.pt-confirm-reset-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ------------------------------------------------------------------ */
/* Reset Modal                                                          */
/* ------------------------------------------------------------------ */

.pt-reset-modal {
    max-width: 440px;
}
