/* web_app/css/ai-position-advisor.css */
/**
 * 🤖 AI Position Advisor Styles v2.0
 * Modern mobile app design
 */

/* ═══════════════════════════════════════════════════════════════
   MAIN CONTAINER
   ═══════════════════════════════════════════════════════════════ */

#ai-position-advisor-container {
    padding: 0;
}

/* ═══════════════════════════════════════════════════════════════
   AIPA CARD - Base card for all states
   ═══════════════════════════════════════════════════════════════ */

.aipa-card {
    margin: 12px 0;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
}

.aipa-card-inner {
    padding: 28px 20px 24px;
    position: relative;
    z-index: 1;
}

/* Setup Required Card */
.aipa-setup-card {
    background: linear-gradient(165deg, #1a1035 0%, #0f1729 50%, #0a1628 100%);
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.aipa-setup-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #8B5CF6, #06B6D4, #8B5CF6);
    background-size: 200% 100%;
    animation: aipa-gradient-line 3s ease infinite;
}

/* Free User Card */
.aipa-free-card {
    background: linear-gradient(165deg, #1a1035 0%, #0f1729 50%, #0a1628 100%);
    border: 1px solid rgba(139, 92, 246, 0.15);
}

.aipa-free-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #8B5CF6, #F59E0B, #8B5CF6);
    background-size: 200% 100%;
    animation: aipa-gradient-line 3s ease infinite;
}

@keyframes aipa-gradient-line {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ═══════════════════════════════════════════════════════════════
   AIPA HEADER
   ═══════════════════════════════════════════════════════════════ */

.aipa-header {
    text-align: center;
    margin-bottom: 24px;
}

.aipa-icon-wrap {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(6, 182, 212, 0.2));
    border: 1px solid rgba(139, 92, 246, 0.3);
    font-size: 22px;
    color: #A78BFA;
}

.aipa-icon-glow {
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.15);
    animation: aipa-icon-pulse 2.5s ease-in-out infinite;
}

@keyframes aipa-icon-pulse {
    0%, 100% { box-shadow: 0 0 20px rgba(139, 92, 246, 0.15); }
    50% { box-shadow: 0 0 30px rgba(139, 92, 246, 0.3); }
}

.aipa-title {
    margin: 0 0 6px;
    font-size: 19px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.3px;
}

.aipa-subtitle {
    margin: 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.5;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}

/* ═══════════════════════════════════════════════════════════════
   AIPA FEATURES
   ═══════════════════════════════════════════════════════════════ */

.aipa-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 24px;
}

.aipa-feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.35;
}

.aipa-feature-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(6, 182, 212, 0.15));
    color: #A78BFA;
}

/* ═══════════════════════════════════════════════════════════════
   AIPA LIMITS (Free user card)
   ═══════════════════════════════════════════════════════════════ */

.aipa-limits {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}

.aipa-limits-title {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.aipa-limit-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.aipa-limit-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.aipa-limit-disabled {
    opacity: 0.4;
}

.aipa-limit-highlight {
    color: #FCD34D;
    font-weight: 600;
}

.aipa-limit-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.5);
}

.aipa-badge-basic {
    background: rgba(96, 165, 250, 0.15);
    color: #60A5FA;
}

.aipa-badge-pro {
    background: rgba(139, 92, 246, 0.15);
    color: #A78BFA;
}

.aipa-badge-premium {
    background: rgba(244, 114, 182, 0.15);
    color: #F472B6;
}

.aipa-badge-diamond {
    background: rgba(252, 211, 77, 0.15);
    color: #FCD34D;
}

/* ═══════════════════════════════════════════════════════════════
   AIPA BUTTONS
   ═══════════════════════════════════════════════════════════════ */

.aipa-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    letter-spacing: -0.2px;
}

.aipa-btn:active {
    transform: scale(0.97);
}

.aipa-btn-connect {
    background: linear-gradient(135deg, #8B5CF6, #06B6D4);
    color: #fff;
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.25);
}

.aipa-btn-connect:hover {
    box-shadow: 0 6px 24px rgba(139, 92, 246, 0.35);
    transform: translateY(-1px);
}

.aipa-btn-upgrade {
    background: linear-gradient(135deg, #8B5CF6, #F59E0B);
    color: #fff;
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.25);
}

.aipa-btn-upgrade:hover {
    box-shadow: 0 6px 24px rgba(245, 158, 11, 0.35);
    transform: translateY(-1px);
}

/* Button Group */
.aipa-btn-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.aipa-btn-add-exchange {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: #A78BFA;
}

.aipa-btn-add-exchange:hover {
    background: rgba(139, 92, 246, 0.12);
    border-color: rgba(139, 92, 246, 0.5);
}

/* Disclaimer */
.aipa-disclaimer {
    margin-top: 16px;
    font-size: 11px;
    text-align: center;
    color: rgba(255, 255, 255, 0.35);
}

/* ═══════════════════════════════════════════════════════════════
   API KEY SETUP MODAL - Bottom Sheet Style
   ═══════════════════════════════════════════════════════════════ */

.apim-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.apim-overlay.apim-active {
    opacity: 1;
}

.apim-sheet {
    width: 100%;
    max-width: 480px;
    max-height: 92vh;
    background: linear-gradient(180deg, #1a1f35 0%, #111827 100%);
    border-radius: 24px 24px 0 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: 0 -4px 40px rgba(0, 0, 0, 0.4);
}

.apim-active .apim-sheet {
    transform: translateY(0);
}

/* Desktop: center the modal instead of bottom-sheet */
@media (min-width: 768px) {
    .apim-overlay {
        align-items: center;
    }
    .apim-sheet {
        border-radius: 20px;
        max-height: 85vh;
        transform: translateY(40px);
        opacity: 0;
        transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.25s ease;
    }
    .apim-active .apim-sheet {
        transform: translateY(0);
        opacity: 1;
    }
    .apim-handle {
        display: none;
    }
}

/* Drag handle */
.apim-handle {
    width: 36px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    margin: 10px auto 0;
    flex-shrink: 0;
}

/* Header */
.apim-header {
    padding: 16px 20px 20px;
    text-align: center;
    position: relative;
    flex-shrink: 0;
}

.apim-header-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(6, 182, 212, 0.2));
    border: 1px solid rgba(139, 92, 246, 0.25);
    font-size: 18px;
    color: #A78BFA;
}

.apim-header-title {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.3px;
}

.apim-header-desc {
    margin: 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.4;
}

.apim-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.apim-close:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* Body */
.apim-body {
    padding: 0 20px;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

/* Form Fields */
.apim-field {
    margin-bottom: 16px;
}

.apim-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.apim-select-wrap {
    position: relative;
}

.apim-select {
    width: 100%;
    padding: 13px 40px 13px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    font-size: 14px;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: border-color 0.2s;
}

.apim-select:focus {
    outline: none;
    border-color: rgba(139, 92, 246, 0.5);
}

.apim-select option {
    background: #1a1f35;
    color: #fff;
}

.apim-select-arrow {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.35);
    pointer-events: none;
}

.apim-input-wrap {
    position: relative;
}

.apim-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    color: rgba(255, 255, 255, 0.3);
}

.apim-input {
    width: 100%;
    padding: 13px 14px 13px 40px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    font-size: 14px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.apim-input:focus {
    outline: none;
    border-color: rgba(139, 92, 246, 0.5);
}

.apim-input::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

/* Passphrase Field Hint */
.apim-field-hint {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
    margin-top: 6px;
    padding-left: 2px;
}

/* Security Notice */
.apim-security {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 12px;
    margin-bottom: 16px;
}

.apim-security-icon {
    font-size: 16px;
    color: #A78BFA;
    margin-top: 2px;
}

.apim-security-title {
    font-size: 13px;
    font-weight: 600;
    color: #A78BFA;
    margin-bottom: 2px;
}

.apim-security-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.4;
}

/* Instructions */
.apim-instructions {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    background: rgba(6, 182, 212, 0.08);
    border: 1px solid rgba(6, 182, 212, 0.15);
    border-radius: 12px;
    margin-bottom: 16px;
}

.apim-instructions-icon {
    font-size: 16px;
    color: #06B6D4;
    margin-top: 2px;
}

.apim-instructions-title {
    font-size: 13px;
    font-weight: 600;
    color: #06B6D4;
    margin-bottom: 2px;
}

.apim-instructions-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.4;
}

/* Footer */
.apim-footer {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    flex-shrink: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.apim-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    border: none;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: -0.2px;
}

.apim-btn:active {
    transform: scale(0.97);
}

.apim-btn-cancel {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
}

.apim-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.12);
}

.apim-btn-submit {
    background: linear-gradient(135deg, #8B5CF6, #06B6D4);
    color: #fff;
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.25);
}

.apim-btn-submit:hover {
    box-shadow: 0 6px 24px rgba(139, 92, 246, 0.35);
}

/* Connecting state - animated link icon */
.apim-connecting {
    opacity: 0.8;
    pointer-events: none;
}

.apim-icon-connecting {
    animation: apim-connect-spin 1s linear infinite;
}

@keyframes apim-connect-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════════════════════════
   AI ANALYZE BUTTON & ANALYSIS RESULT (Detail View)
   ═══════════════════════════════════════════════════════════════ */

/* AI Analyze Button */
.aipa-ai-analyze-wrap {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.aipa-btn-ai-analyze {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(6, 182, 212, 0.15));
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    color: #A78BFA;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

.aipa-btn-ai-analyze:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(6, 182, 212, 0.25));
    border-color: rgba(139, 92, 246, 0.5);
}

.aipa-btn-ai-analyze:active {
    transform: scale(0.97);
}

.aipa-btn-ai-analyze .fa-brain {
    font-size: 15px;
}

/* AI Analysis Section */
.aipa-ai-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(139, 92, 246, 0.15);
}

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

.aipa-ai-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.aipa-ai-icon {
    font-size: 14px;
    color: #A78BFA;
}

.aipa-ai-title {
    font-size: 13px;
    font-weight: 700;
    color: #A78BFA;
}

/* Risk Badge */
.aipa-risk-badge {
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.aipa-risk-low {
    background: rgba(16, 185, 129, 0.15);
    color: #10B981;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.aipa-risk-medium {
    background: rgba(245, 158, 11, 0.15);
    color: #F59E0B;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.aipa-risk-high {
    background: rgba(239, 68, 68, 0.15);
    color: #EF4444;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

/* AI Quick Stats */
.aipa-ai-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.aipa-ai-stat {
    padding: 8px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    text-align: center;
}

.aipa-ai-stat-label {
    display: block;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.45);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}

.aipa-ai-stat-value {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
}

/* AI Analysis Text */
.aipa-ai-text {
    padding: 10px 12px;
    background: rgba(139, 92, 246, 0.06);
    border-radius: 10px;
    border: 1px solid rgba(139, 92, 246, 0.1);
    margin-bottom: 12px;
}

.aipa-ai-text p {
    margin: 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
}

/* Teaser Notice */
.aipa-teaser-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.15);
    border-radius: 10px;
    margin-bottom: 12px;
    font-size: 12px;
    color: #F59E0B;
}

.aipa-teaser-notice .fa-lock {
    font-size: 13px;
}

.aipa-teaser-upgrade {
    margin-left: auto;
    padding: 4px 10px;
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 6px;
    color: #F59E0B;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

/* Technical Levels */
.aipa-ai-levels {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.aipa-ai-level {
    flex: 1;
    padding: 8px;
    border-radius: 8px;
    text-align: center;
}

.aipa-level-label {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
    opacity: 0.7;
}

.aipa-level-value {
    display: block;
    font-size: 13px;
    font-weight: 700;
}

.aipa-level-resistance {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.15);
    color: #EF4444;
}

.aipa-level-support {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.15);
    color: #10B981;
}

.aipa-level-invalidation {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.15);
    color: #F59E0B;
}

/* Scenarios */
.aipa-ai-scenarios {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.aipa-ai-scenario {
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.aipa-scenario-bullish {
    background: rgba(16, 185, 129, 0.06);
    border-color: rgba(16, 185, 129, 0.12);
}

.aipa-scenario-bearish {
    background: rgba(239, 68, 68, 0.06);
    border-color: rgba(239, 68, 68, 0.12);
}

.aipa-scenario-neutral {
    background: rgba(255, 255, 255, 0.04);
}

.aipa-scenario-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}

.aipa-scenario-prob {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 700;
}

.aipa-scenario-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.4;
}

/* AI Disclaimer */
.aipa-ai-disclaimer {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.35);
    text-align: center;
    padding: 8px 0;
    line-height: 1.4;
}

/* AI Refresh Button */
.aipa-btn-ai-refresh {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.aipa-btn-ai-refresh:hover {
    background: rgba(139, 92, 246, 0.12);
    border-color: rgba(139, 92, 246, 0.25);
    color: #A78BFA;
}

.aipa-btn-ai-refresh:active {
    transform: scale(0.97);
}

/* ═══════════════════════════════════════════════════════════════
   EXISTING COMPONENTS - Keep for positions view
   ═══════════════════════════════════════════════════════════════ */

.ai-advisor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.ai-advisor-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

.header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.exchange-selector {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 14px;
}

.btn-sync {
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-sync:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-sync.syncing {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Limits Bar */
.limits-bar {
    background: var(--card-bg);
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 16px;
}

.limits-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.badge-free {
    background: #ffc107;
    color: #000;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
}

.progress-bar {
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transition: width 0.3s ease;
}

/* Positions Grid */
.positions-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

/* Position Card */
.position-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.position-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.position-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.position-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.symbol {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.side {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
}

.side.long {
    background: rgba(0, 255, 0, 0.1);
    color: #00ff00;
}

.side.short {
    background: rgba(255, 0, 0, 0.1);
    color: #ff0000;
}

.position-pnl {
    font-size: 16px;
    font-weight: 700;
}

.position-pnl.positive { color: #00ff00; }
.position-pnl.negative { color: #ff0000; }
.position-pnl small { font-size: 12px; opacity: 0.8; }

.position-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.detail-row span:first-child { color: var(--text-secondary); }
.detail-row span:last-child { color: var(--text-primary); font-weight: 600; }

/* AI Analysis Section */
.ai-analysis-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 2px solid var(--border-color);
}

.ai-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.ai-icon { font-size: 20px; }

.ai-title {
    flex: 1;
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
}

.risk-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
}

.risk-low { background: #d4edda; color: #155724; }
.risk-medium { background: #fff3cd; color: #856404; }
.risk-high { background: #f8d7da; color: #721c24; }

.ai-quick-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.stat-item {
    text-align: center;
    padding: 10px;
    background: var(--stat-bg, rgba(0,0,0,0.05));
    border-radius: 10px;
}

.stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.ai-analysis-text {
    background: var(--analysis-bg, rgba(0,0,0,0.03));
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 12px;
}

.analysis-title {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.ai-analysis-text p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    margin: 0;
}

.teaser-notice {
    background: rgba(255, 165, 0, 0.1);
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 12px;
    font-size: 13px;
    text-align: center;
}

.btn-upgrade-inline {
    display: inline-block;
    margin-top: 8px;
    padding: 6px 16px;
    background: #ff9800;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.technical-levels {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.level-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
}

.level-item.resistance { background: rgba(255, 0, 0, 0.1); }
.level-item.support { background: rgba(0, 255, 0, 0.1); }
.level-item.invalidation { background: rgba(255, 165, 0, 0.1); }

.scenarios { margin-bottom: 12px; }

.scenarios-title {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.scenario-item {
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 6px;
}

.scenario-bullish { background: rgba(0, 255, 0, 0.05); border-left: 3px solid #00ff00; }
.scenario-bearish { background: rgba(255, 0, 0, 0.05); border-left: 3px solid #ff0000; }
.scenario-neutral { background: rgba(128, 128, 128, 0.05); border-left: 3px solid #808080; }

.scenario-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.scenario-icon { font-size: 16px; }
.scenario-name { flex: 1; font-weight: 600; font-size: 13px; }
.scenario-probability { font-weight: 700; font-size: 13px; color: var(--accent-color); }
.scenario-desc { font-size: 12px; color: var(--text-secondary); line-height: 1.4; }

.ai-disclaimer {
    background: rgba(255, 165, 0, 0.1);
    padding: 10px;
    border-radius: 8px;
    font-size: 11px;
    text-align: center;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.btn-refresh-ai,
.btn-analyze {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-refresh-ai:hover,
.btn-analyze:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.analyze-button-container {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 2px solid var(--border-color);
}

/* ═══════════════════════════════════════════════════════════════
   BALANCE SECTION (No Positions Card)
   ═══════════════════════════════════════════════════════════════ */

.aipa-balance-section {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 16px;
    text-align: center;
}

.aipa-balance-label {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.45);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 8px;
}

.aipa-balance-total {
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
    margin-bottom: 14px;
    background: linear-gradient(135deg, #fff 0%, #A78BFA 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.aipa-balance-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.aipa-balance-row-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

.aipa-balance-row-value {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
}

/* No Positions Info Box */
.aipa-no-positions-info {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid rgba(251, 191, 36, 0.15);
    border-radius: 12px;
    margin-bottom: 16px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.45;
}

.aipa-no-positions-info i {
    color: #FBBF24;
    margin-top: 2px;
    font-size: 13px;
}

/* No Positions Card */
.ai-advisor-no-positions {
    text-align: center;
    padding: 40px 20px;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Upgrade Prompt */
.upgrade-prompt { text-align: center; padding: 24px; }
.upgrade-icon { font-size: 64px; margin-bottom: 16px; }
.upgrade-prompt h3 { font-size: 20px; margin-bottom: 8px; }
.upgrade-prompt p { color: var(--text-secondary); margin-bottom: 20px; }

.package-limits {
    background: var(--card-bg);
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.limit-item {
    padding: 8px;
    margin-bottom: 6px;
    border-radius: 6px;
    font-size: 14px;
}

.limit-item.highlight {
    background: linear-gradient(90deg, rgba(255,215,0,0.2), rgba(255,105,180,0.2));
    font-weight: 700;
}

.btn-upgrade {
    padding: 12px 32px;
    background: linear-gradient(90deg, #ff9800, #ff5722);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.3s;
}

.btn-upgrade:hover { transform: scale(1.05); }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 380px) {
    .aipa-features {
        grid-template-columns: 1fr;
    }

    .aipa-card-inner {
        padding: 24px 16px 20px;
    }
}

@media (max-width: 640px) {
    .ai-advisor-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .header-actions {
        width: 100%;
        flex-direction: column;
    }

    .exchange-selector,
    .btn-sync {
        width: 100%;
    }

    .ai-quick-stats {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════════════════════════
   DIAMOND MULTI-EXCHANGE CARD
   ═══════════════════════════════════════════════════════════════ */

.aipa-diamond-card {
    background: linear-gradient(165deg, #1a1a2e 0%, #16213e 50%, #1a1a2e 100%);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
}

.aipa-diamond-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #8B5CF6, #06B6D4, #10B981, #F59E0B);
}

/* Diamond Header */
.aipa-diamond-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0 16px;
}

.aipa-diamond-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.aipa-diamond-icon-wrap {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(6, 182, 212, 0.3));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #A78BFA;
}

.aipa-diamond-title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.aipa-diamond-subtitle {
    font-size: 11px;
    color: #10B981;
    font-weight: 600;
    margin: 2px 0 0;
}

.aipa-diamond-add-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: #A78BFA;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.aipa-diamond-add-btn:active {
    transform: scale(0.95);
    background: rgba(139, 92, 246, 0.25);
}

/* Grand Total */
.aipa-grand-total {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    margin-bottom: 16px;
}

.aipa-grand-total-label {
    font-size: 10px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 6px;
}

.aipa-grand-total-value {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -1px;
    background: linear-gradient(135deg, #fff 0%, #A78BFA 50%, #06B6D4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
}

.aipa-grand-total-details {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.aipa-grand-detail {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.55);
    display: flex;
    align-items: center;
    gap: 5px;
}

.aipa-grand-detail-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.aipa-dot-green { background: #10B981; }
.aipa-dot-orange { background: #F59E0B; }

/* Exchange Tabs */
.aipa-exchange-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 12px;
    margin-bottom: 12px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.aipa-exchange-tabs::-webkit-scrollbar {
    display: none;
}

.aipa-exchange-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    flex-shrink: 0;
}

.aipa-exchange-tab:active {
    transform: scale(0.97);
}

.aipa-exchange-tab.aipa-tab-active {
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.4);
    color: #fff;
}

.aipa-tab-initial {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 800;
    flex-shrink: 0;
}

.aipa-tab-badge {
    background: rgba(139, 92, 246, 0.3);
    color: #A78BFA;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 8px;
    min-width: 18px;
    text-align: center;
}

/* All Exchanges Summary */
.aipa-all-exchanges {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.aipa-exchange-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    padding: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.aipa-exchange-card:active {
    transform: scale(0.98);
    background: rgba(255, 255, 255, 0.06);
}

.aipa-exchange-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.aipa-exchange-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    flex-shrink: 0;
}

.aipa-exchange-card-info {
    flex: 1;
    min-width: 0;
}

.aipa-exchange-card-name {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
}

.aipa-exchange-card-type {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
}

.aipa-exchange-card-balance {
    text-align: right;
    flex-shrink: 0;
}

.aipa-exchange-card-amount {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
}

.aipa-exchange-card-pnl {
    font-size: 12px;
    font-weight: 600;
}

.aipa-exchange-card-positions {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.35);
}

.aipa-pnl-positive { color: #10B981; }
.aipa-pnl-negative { color: #EF4444; }

/* Mini Positions List */
.aipa-exchange-card-positions-list {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.aipa-mini-position {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.aipa-mini-symbol {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
    flex: 1;
}

.aipa-mini-side {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}

.aipa-side-long {
    background: rgba(16, 185, 129, 0.15);
    color: #10B981;
}

.aipa-side-short {
    background: rgba(239, 68, 68, 0.15);
    color: #EF4444;
}

.aipa-side-spot {
    background: rgba(99, 102, 241, 0.15);
    color: #818CF8;
}

.aipa-spot-holding-card {
    border-left: 2px solid rgba(99, 102, 241, 0.4);
}

.aipa-mini-pnl {
    font-weight: 600;
    font-size: 12px;
}

.aipa-mini-more {
    font-size: 11px;
    color: rgba(139, 92, 246, 0.7);
    text-align: center;
    padding-top: 4px;
}

/* Single Exchange Detail */
.aipa-single-exchange-detail {
    margin-bottom: 16px;
}

.aipa-exchange-detail-balance {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 12px;
}

.aipa-exchange-detail-positions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.aipa-detail-position {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 12px 14px;
}

.aipa-detail-position-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.aipa-detail-position-symbol {
    display: flex;
    align-items: center;
    gap: 8px;
}

.aipa-detail-symbol {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
}

.aipa-detail-side {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
}

.aipa-detail-position-pnl {
    font-size: 15px;
    font-weight: 700;
}

.aipa-detail-position-pnl small {
    font-size: 11px;
    opacity: 0.7;
    margin-left: 2px;
}

.aipa-detail-position-info {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.aipa-detail-info-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 11px;
}

.aipa-detail-info-item span:first-child {
    color: rgba(255, 255, 255, 0.4);
}

.aipa-detail-info-item span:last-child {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 600;
}

/* Diamond Actions */
.aipa-diamond-actions {
    padding-top: 4px;
}

/* Button Group for multi-exchange */
.aipa-btn-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.aipa-btn-add-exchange {
    background: rgba(139, 92, 246, 0.1) !important;
    border: 1px solid rgba(139, 92, 246, 0.3) !important;
    color: #A78BFA !important;
}

/* Responsive for Diamond Card */
@media (max-width: 380px) {
    .aipa-grand-total-value {
        font-size: 26px;
    }

    .aipa-grand-total-details {
        flex-direction: column;
        gap: 6px;
        align-items: center;
    }

    .aipa-detail-position-info {
        grid-template-columns: 1fr 1fr;
    }
}

/* ═══════════════════════════════════════════════════════════════
   SYNC BUTTON STATES (Rate Limiting & Spinning)
   ═══════════════════════════════════════════════════════════════ */

.aipa-syncing {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.aipa-syncing .fa-sync-alt {
    animation: aipa-spin 1s linear infinite;
}

/* Sync button disabled state for full-width buttons */
.aipa-btn.aipa-syncing {
    cursor: not-allowed;
    opacity: 0.7;
}

@keyframes aipa-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════════════════════════
   POSITIONS VIEW - Header, Cards, Analysis
   ═══════════════════════════════════════════════════════════════ */

.aipa-positions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.aipa-positions-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.aipa-positions-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.aipa-exchange-select {
    padding: 6px 10px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 8px;
    color: #fff;
    font-size: 12px;
    max-width: 140px;
}

.aipa-btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.aipa-btn-icon:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.1);
}

/* Balance Summary */
.aipa-balance-summary {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

.aipa-balance-item {
    flex: 1;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.aipa-balance-item-label {
    display: block;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.45);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.aipa-balance-item-value {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}

/* Limits Bar */
.aipa-limits-bar {
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    margin-bottom: 14px;
}

.aipa-limits-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 6px;
}

.aipa-badge-teaser {
    background: #F59E0B;
    color: #000;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
}

.aipa-badge-unlimited {
    background: linear-gradient(135deg, #8B5CF6, #06B6D4);
    color: #fff;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
}

.aipa-badge-limit-reached {
    background: #EF4444;
    color: #fff;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
    animation: aipa-pulse 2s ease-in-out infinite;
}

.aipa-badge-limit-low {
    background: #F59E0B;
    color: #000;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
}

@keyframes aipa-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.aipa-limits-reached {
    border: 1px solid rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.08);
}

.aipa-limits-low {
    border: 1px solid rgba(245, 158, 11, 0.3);
    background: rgba(245, 158, 11, 0.05);
}

.aipa-progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
}

.aipa-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #8B5CF6, #06B6D4);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.aipa-progress-fill.aipa-progress-red {
    background: linear-gradient(90deg, #EF4444, #DC2626);
}

.aipa-progress-fill.aipa-progress-orange {
    background: linear-gradient(90deg, #F59E0B, #D97706);
}

.aipa-limits-upgrade {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    gap: 8px;
}

.aipa-btn-upgrade-small {
    background: linear-gradient(135deg, #8B5CF6, #06B6D4);
    color: #fff;
    border: none;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.2s;
}

.aipa-btn-upgrade-small:hover {
    opacity: 0.85;
}

/* Upgrade prompt current package highlight */
.upgrade-prompt .limit-item.current {
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-radius: 6px;
    padding: 4px 8px;
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════
   POSITION GROUPS (Futures / Spot)
   ═══════════════════════════════════════════════════════════════ */

.aipa-group {
    margin-top: 16px;
}

.aipa-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.aipa-group-spot .aipa-group-header {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.aipa-group-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
}

.aipa-group-title i {
    font-size: 12px;
    color: rgba(139, 92, 246, 0.7);
}

.aipa-group-count {
    background: rgba(139, 92, 246, 0.15);
    color: #A78BFA;
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
}

.aipa-group-value {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    font-weight: 500;
}

.aipa-group-toggle-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
    padding: 4px 8px;
    cursor: pointer;
}

/* Spot group collapse/expand */
.aipa-group-body {
    overflow: hidden;
    max-height: 5000px;
    transition: max-height 0.4s ease, opacity 0.3s ease;
    opacity: 1;
}

.aipa-group-collapsed .aipa-group-body {
    max-height: 0;
    opacity: 0;
}

/* Dust notice for hidden small holdings */
.aipa-dust-notice {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    margin-top: 8px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
}

.aipa-dust-notice i {
    font-size: 10px;
}

/* Show More Button */
.aipa-show-more-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px;
    margin-top: 8px;
    background: rgba(139, 92, 246, 0.08);
    border: 1px dashed rgba(139, 92, 246, 0.2);
    border-radius: 10px;
    color: #A78BFA;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.aipa-show-more-btn:active {
    background: rgba(139, 92, 246, 0.15);
}

/* Hidden positions container */
.aipa-hidden-positions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}

/* ═══════════════════════════════════════════════════════════════
   COMPACT CARD MODE
   ═══════════════════════════════════════════════════════════════ */

/* Compact header - always visible */
.aipa-compact-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.aipa-compact-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.aipa-compact-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.aipa-card-expand-icon {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.3);
    transition: transform 0.2s;
}

/* Expandable details - hidden by default */
.aipa-card-details {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.35s ease, opacity 0.25s ease;
}

/* Expanded state */
.aipa-position-card.aipa-card-expanded .aipa-card-details {
    max-height: 5000px;
    opacity: 1;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ═══════════════════════════════════════════════════════════════ */

/* Positions List */
.aipa-positions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Position Card */
.aipa-position-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 14px;
    transition: border-color 0.2s;
}

.aipa-position-card:active {
    border-color: rgba(139, 92, 246, 0.3);
}

.aipa-position-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.aipa-position-symbol-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.aipa-position-symbol {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}

.aipa-position-side {
    padding: 3px 8px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.aipa-side-long {
    background: rgba(16, 185, 129, 0.15);
    color: #10B981;
}

.aipa-side-short {
    background: rgba(239, 68, 68, 0.15);
    color: #EF4444;
}

.aipa-position-pnl {
    font-size: 15px;
    font-weight: 700;
    text-align: right;
}

.aipa-position-pnl small {
    display: block;
    font-size: 11px;
    font-weight: 500;
    opacity: 0.7;
}

.aipa-pnl-positive {
    color: #10B981;
}

.aipa-pnl-negative {
    color: #EF4444;
}

/* Position Details */
.aipa-position-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.aipa-detail-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.aipa-detail-row span:first-child {
    color: rgba(255, 255, 255, 0.45);
}

.aipa-detail-row span:last-child {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
}

/* AI Analyze Button */
.aipa-analyze-btn-wrap {
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.aipa-btn-analyze {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(6, 182, 212, 0.2));
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 10px;
    color: #A78BFA;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.aipa-btn-analyze:active {
    transform: scale(0.98);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(6, 182, 212, 0.3));
}

.aipa-btn-analyze.aipa-btn-disabled,
.aipa-btn-analyze:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(107, 114, 128, 0.15);
    border-color: rgba(107, 114, 128, 0.3);
    color: #6B7280;
}

.aipa-btn-analyze.aipa-btn-disabled:active,
.aipa-btn-analyze:disabled:active {
    transform: none;
}

/* Analyzing state - spinning brain */
.aipa-btn-analyze.aipa-btn-analyzing,
.aipa-btn-ai-refresh.aipa-btn-analyzing {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(6, 182, 212, 0.3));
    border-color: rgba(139, 92, 246, 0.5);
    color: #C4B5FD;
    cursor: wait;
    pointer-events: none;
}

.aipa-btn-analyze.aipa-btn-analyzing:active,
.aipa-btn-ai-refresh.aipa-btn-analyzing:active {
    transform: none;
}

/* ═══════════════════════════════════════════════════════════════
   UPGRADE PROMPT OVERLAY
   ═══════════════════════════════════════════════════════════════ */

.aipa-upgrade-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    animation: aipa-fade-in 0.2s ease;
}

@keyframes aipa-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.aipa-upgrade-modal {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border-radius: 20px;
    padding: 32px 24px;
    max-width: 380px;
    width: 100%;
    text-align: center;
    position: relative;
    border: 1px solid rgba(139, 92, 246, 0.3);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.aipa-upgrade-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: #9CA3AF;
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}

.aipa-upgrade-close:hover {
    color: #fff;
}

.aipa-upgrade-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.aipa-upgrade-modal h3 {
    color: #F59E0B;
    font-size: 18px;
    margin: 0 0 8px 0;
}

.aipa-upgrade-modal p {
    color: #9CA3AF;
    font-size: 14px;
    margin: 0 0 20px 0;
}

.aipa-upgrade-packages {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.aipa-upgrade-pkg {
    padding: 10px 16px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: #D1D5DB;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid transparent;
}

.aipa-upgrade-pkg.aipa-pkg-current {
    border-color: rgba(139, 92, 246, 0.5);
    background: rgba(139, 92, 246, 0.1);
    color: #A78BFA;
}

.aipa-upgrade-pkg.aipa-pkg-highlight {
    background: rgba(6, 182, 212, 0.1);
    color: #22D3EE;
}

.aipa-btn-upgrade {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #8B5CF6, #06B6D4);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.aipa-btn-upgrade:active {
    opacity: 0.8;
}

/* ═══════════════════════════════════════════════════════════════
   AI POSITION ADVISOR - ENHANCED ANALYSIS STYLES
   ═══════════════════════════════════════════════════════════════ */

/* --- Timeframe Selector --- */
.aipa-timeframe-selector {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
}

.aipa-timeframe-btn {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 8px;
    background: transparent;
    color: #8b949e;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.aipa-timeframe-btn:hover {
    background: rgba(139, 92, 246, 0.1);
    color: #A78BFA;
}

.aipa-timeframe-btn.active {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(6, 182, 212, 0.2));
    border-color: rgba(139, 92, 246, 0.5);
    color: #fff;
}

/* --- Technical Chart --- */
.aipa-chart-section {
    margin: 12px 0;
    position: relative;
}

.aipa-chart-wrapper {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(139, 92, 246, 0.15);
    cursor: pointer;
    transition: border-color 0.2s;
}

.aipa-chart-wrapper:hover {
    border-color: rgba(139, 92, 246, 0.4);
}

.aipa-chart-img {
    width: 100%;
    height: auto;
    display: block;
}

.aipa-chart-fullscreen-hint {
    position: absolute;
    bottom: 8px;
    right: 8px;
    padding: 5px 10px;
    background: rgba(13, 17, 23, 0.85);
    border-radius: 6px;
    color: #8b949e;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: opacity 0.2s;
    pointer-events: none;
}

.aipa-chart-wrapper:hover .aipa-chart-fullscreen-hint {
    color: #A78BFA;
}

/* --- Chart Fullscreen Overlay --- */
.aipa-chart-fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    animation: aipa-fadeIn 0.2s ease;
}

@keyframes aipa-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.aipa-fullscreen-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(13, 17, 23, 0.9);
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

.aipa-fullscreen-title {
    color: #c9d1d9;
    font-size: 14px;
    font-weight: 600;
}

.aipa-fullscreen-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #c9d1d9;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aipa-fullscreen-image-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    touch-action: none;
}

.aipa-fullscreen-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.1s ease;
}

.aipa-fullscreen-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(13, 17, 23, 0.9);
    border-top: 1px solid rgba(139, 92, 246, 0.2);
}

.aipa-zoom-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(139, 92, 246, 0.3);
    background: rgba(139, 92, 246, 0.1);
    color: #A78BFA;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aipa-zoom-level {
    color: #8b949e;
    font-size: 13px;
    min-width: 50px;
    text-align: center;
}

/* --- Enhanced Risk Gauge --- */
.aipa-risk-gauge-container {
    margin: 14px 0;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(139, 92, 246, 0.1);
}

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

.aipa-risk-gauge-title {
    font-size: 13px;
    font-weight: 600;
    color: #c9d1d9;
}

.aipa-risk-gauge-visual {
    position: relative;
    width: 160px;
    height: 90px;
    margin: 0 auto 16px;
}

.aipa-gauge-bg {
    width: 160px;
    height: 80px;
    border-radius: 80px 80px 0 0;
    background: conic-gradient(
        from 180deg at 50% 100%,
        #10B981 0deg,
        #FBBF24 60deg,
        #F59E0B 100deg,
        #EF4444 160deg,
        #DC2626 180deg
    );
    position: relative;
    overflow: hidden;
}

.aipa-gauge-bg::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 60px;
    background: #0d1117;
    border-radius: 60px 60px 0 0;
}

.aipa-gauge-needle {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 3px;
    height: 55px;
    background: #fff;
    transform-origin: bottom center;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 3px;
    z-index: 2;
}

.aipa-gauge-center {
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    z-index: 3;
}

.aipa-gauge-score {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    margin-top: 4px;
}

.aipa-gauge-score-low { color: #10B981; }
.aipa-gauge-score-medium { color: #FBBF24; }
.aipa-gauge-score-high { color: #EF4444; }

.aipa-gauge-label {
    text-align: center;
    font-size: 11px;
    color: #8b949e;
    margin-top: 2px;
}

/* Risk Factor Bars */
.aipa-risk-factors {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.aipa-risk-factor-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.aipa-risk-factor-label {
    font-size: 11px;
    color: #8b949e;
    min-width: 90px;
    flex-shrink: 0;
}

.aipa-risk-factor-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    overflow: hidden;
}

.aipa-risk-factor-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease;
}

.aipa-risk-factor-fill.risk-low { background: #10B981; }
.aipa-risk-factor-fill.risk-medium { background: #FBBF24; }
.aipa-risk-factor-fill.risk-high { background: #EF4444; }

.aipa-risk-factor-value {
    font-size: 10px;
    color: #6e7681;
    min-width: 28px;
    text-align: right;
}

/* --- Technical Indicator Cards --- */
.aipa-indicators-section {
    margin: 14px 0;
}

.aipa-indicators-title {
    font-size: 13px;
    font-weight: 600;
    color: #c9d1d9;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.aipa-indicators-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

@media (min-width: 600px) {
    .aipa-indicators-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.aipa-indicator-card {
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: border-color 0.2s;
}

.aipa-indicator-card:hover {
    border-color: rgba(139, 92, 246, 0.2);
}

.aipa-indicator-name {
    font-size: 10px;
    color: #6e7681;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.aipa-indicator-value {
    font-size: 16px;
    font-weight: 700;
    color: #c9d1d9;
    margin-bottom: 6px;
}

.aipa-indicator-signal {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
}

.aipa-signal-bullish {
    background: rgba(16, 185, 129, 0.15);
    color: #10B981;
}

.aipa-signal-bearish {
    background: rgba(239, 68, 68, 0.15);
    color: #EF4444;
}

.aipa-signal-neutral {
    background: rgba(251, 191, 36, 0.15);
    color: #FBBF24;
}

.aipa-signal-overbought {
    background: rgba(239, 68, 68, 0.15);
    color: #EF4444;
}

.aipa-signal-oversold {
    background: rgba(16, 185, 129, 0.15);
    color: #10B981;
}

/* Indicator visual bars */
.aipa-indicator-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
    position: relative;
}

.aipa-indicator-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.6s ease;
}

.aipa-indicator-bar-fill.bar-green { background: #10B981; }
.aipa-indicator-bar-fill.bar-red { background: #EF4444; }
.aipa-indicator-bar-fill.bar-yellow { background: #FBBF24; }
.aipa-indicator-bar-fill.bar-cyan { background: #06B6D4; }
.aipa-indicator-bar-fill.bar-purple { background: #8B5CF6; }

/* --- PnL Projection Table --- */
.aipa-pnl-section {
    margin: 14px 0;
}

.aipa-pnl-title {
    font-size: 13px;
    font-weight: 600;
    color: #c9d1d9;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.aipa-pnl-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.aipa-pnl-table th {
    background: rgba(139, 92, 246, 0.08);
    padding: 8px 10px;
    font-size: 10px;
    font-weight: 600;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
}

.aipa-pnl-table td {
    padding: 8px 10px;
    font-size: 12px;
    color: #c9d1d9;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.aipa-pnl-table tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.02);
}

.aipa-pnl-profit {
    color: #10B981 !important;
    font-weight: 600;
}

.aipa-pnl-loss {
    color: #EF4444 !important;
    font-weight: 600;
}

.aipa-pnl-level-name {
    font-weight: 600;
    text-transform: capitalize;
}

/* --- Enhanced Scenarios --- */
.aipa-scenario-prob-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}

.aipa-scenario-prob-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.6s ease;
}

.aipa-scenario-bullish .aipa-scenario-prob-fill { background: #10B981; }
.aipa-scenario-bearish .aipa-scenario-prob-fill { background: #EF4444; }
.aipa-scenario-neutral .aipa-scenario-prob-fill { background: #FBBF24; }

.aipa-scenario-target {
    font-size: 11px;
    color: #8b949e;
    margin-top: 4px;
}

.aipa-scenario-target strong {
    color: #c9d1d9;
}

/* --- Advanced Scenarios (Collapsible) --- */
.aipa-advanced-toggle {
    width: 100%;
    padding: 10px;
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 10px;
    background: rgba(139, 92, 246, 0.05);
    color: #A78BFA;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 12px 0;
    transition: all 0.2s;
}

.aipa-advanced-toggle:hover {
    background: rgba(139, 92, 246, 0.1);
}

.aipa-advanced-toggle i {
    transition: transform 0.3s;
}

.aipa-advanced-toggle.expanded i {
    transform: rotate(180deg);
}

.aipa-advanced-scenarios {
    display: none;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
    animation: aipa-slideDown 0.3s ease;
}

.aipa-advanced-scenarios.visible {
    display: flex;
}

@keyframes aipa-slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.aipa-adv-scenario-card {
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.aipa-adv-scenario-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.aipa-adv-scenario-name {
    font-size: 12px;
    font-weight: 600;
    color: #c9d1d9;
    display: flex;
    align-items: center;
    gap: 6px;
}

.aipa-adv-scenario-badges {
    display: flex;
    gap: 6px;
    align-items: center;
}

.aipa-adv-prob-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
}

.aipa-adv-confidence-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(139, 92, 246, 0.1);
    color: #A78BFA;
}

.aipa-adv-scenario-factors {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.aipa-adv-factor-tag {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    color: #8b949e;
}

.aipa-adv-scenario-bar {
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.aipa-adv-scenario-bar-fill {
    height: 100%;
    border-radius: 2px;
    background: linear-gradient(90deg, #8B5CF6, #06B6D4);
    transition: width 0.6s ease;
}

/* --- Strategy Suitability --- */
.aipa-strategy-section {
    margin: 14px 0;
    display: flex;
    gap: 10px;
}

.aipa-strategy-card {
    flex: 1;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.aipa-strategy-label {
    font-size: 10px;
    color: #6e7681;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.aipa-strategy-score-text {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
}

.aipa-strategy-bar {
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    overflow: hidden;
}

.aipa-strategy-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease;
}

.aipa-strategy-bar-fill.strategy-good { background: #10B981; }
.aipa-strategy-bar-fill.strategy-ok { background: #FBBF24; }
.aipa-strategy-bar-fill.strategy-bad { background: #EF4444; }

/* --- Chart Loading State --- */
.aipa-chart-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(139, 92, 246, 0.1);
    color: #8b949e;
    font-size: 13px;
    gap: 8px;
}

.aipa-chart-loading .spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(139, 92, 246, 0.2);
    border-top: 2px solid #8B5CF6;
    border-radius: 50%;
    animation: aipa-spin 0.8s linear infinite;
}

@keyframes aipa-spin {
    to { transform: rotate(360deg); }
}

/* --- Analysis Section Divider --- */
.aipa-section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.2), transparent);
    margin: 14px 0;
}

/* ═══════════════════════════════════════════════════════════════
   AI POSITION ADVISOR - INFO POPUP
   ═══════════════════════════════════════════════════════════════ */

.aipa-btn-info {
    background: rgba(59, 130, 246, 0.1) !important;
    border-color: rgba(59, 130, 246, 0.25) !important;
    color: #60A5FA !important;
}

.aipa-btn-info:active {
    background: rgba(59, 130, 246, 0.2) !important;
}

.aipa-info-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.aipa-info-overlay.aipa-info-visible {
    opacity: 1;
}

.aipa-info-popup {
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    background: linear-gradient(165deg, #1a1035 0%, #0f1729 50%, #0a1628 100%);
    border-radius: 20px 20px 0 0;
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-bottom: none;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.aipa-info-visible .aipa-info-popup {
    transform: translateY(0);
}

.aipa-info-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 14px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.15);
    flex-shrink: 0;
}

.aipa-info-popup-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.aipa-info-popup-header h3 i {
    color: #A78BFA;
}

.aipa-info-close {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: #9CA3AF;
    font-size: 22px;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.aipa-info-close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.aipa-info-popup-body {
    overflow-y: auto;
    padding: 16px 20px 24px;
    -webkit-overflow-scrolling: touch;
}

.aipa-info-section {
    margin-bottom: 20px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.aipa-info-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.aipa-info-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.aipa-info-section-header i {
    color: #A78BFA;
    font-size: 15px;
    width: 20px;
    text-align: center;
}

.aipa-info-section-header h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
}

.aipa-info-section > p {
    font-size: 13px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.65);
    margin: 0 0 12px;
}

/* Feature List */
.aipa-info-feature-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.aipa-info-feature {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.aipa-info-feature-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(139, 92, 246, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #A78BFA;
    font-size: 14px;
}

.aipa-info-feature strong {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 3px;
}

.aipa-info-feature p {
    font-size: 12px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
}

/* Exchange Guides (Accordion) */
.aipa-info-exchange-guide {
    margin-top: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
}

.aipa-info-exchange-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: background 0.2s;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
}

.aipa-info-exchange-header:hover {
    background: rgba(255, 255, 255, 0.06);
}

.aipa-info-exchange-header i {
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
    transition: transform 0.3s;
}

.aipa-info-exchange-guide.open .aipa-info-exchange-header i {
    transform: rotate(180deg);
}

.aipa-info-exchange-body {
    display: none;
    padding: 12px 14px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.aipa-info-exchange-guide.open .aipa-info-exchange-body {
    display: block;
}

.aipa-info-exchange-body ol {
    margin: 0;
    padding: 0 0 0 20px;
    list-style: decimal;
}

.aipa-info-exchange-body li {
    font-size: 12px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 6px;
}

.aipa-info-exchange-body li:last-child {
    margin-bottom: 0;
}

/* Limits Grid */
.aipa-info-limits-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}

.aipa-info-limit-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
}

.aipa-info-limit-highlight {
    background: rgba(6, 182, 212, 0.08) !important;
    border: 1px solid rgba(6, 182, 212, 0.2);
}

.aipa-info-limit-badge {
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    min-width: 60px;
    text-align: center;
}

/* Important Notes */
.aipa-info-notes-list {
    margin: 0;
    padding: 0 0 0 18px;
    list-style: disc;
}

.aipa-info-notes-list li {
    font-size: 12px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 8px;
}

.aipa-info-notes-list li:last-child {
    margin-bottom: 0;
}

/* ═══════════════════════════════════════════════════════════════
   APIM Inline Toast Animations
   ═══════════════════════════════════════════════════════════════ */
@keyframes apimToastSlideDown {
    from { opacity: 0; transform: translateY(-100%); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes apimToastSlideUp {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(-100%); }
}

/* ═══════════════════════════════════════════════════════════════
   AI Analysis Collapse/Expand Toggle
   ═══════════════════════════════════════════════════════════════ */
.aipa-analysis-toggle-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.aipa-analysis-toggle-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.aipa-analysis-toggle-brain {
    color: #8B5CF6;
    font-size: 16px;
    flex-shrink: 0;
}

.aipa-analysis-toggle-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary, #fff);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.aipa-analysis-toggle-btn {
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.25);
    color: #8B5CF6;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    font-size: 12px;
}

.aipa-analysis-toggle-btn:hover {
    background: rgba(139, 92, 246, 0.25);
}

.aipa-analysis-toggle-header .aipa-risk-badge {
    font-size: 11px;
    padding: 2px 8px;
    flex-shrink: 0;
}

/* Collapsible Body */
.aipa-analysis-body {
    overflow: hidden;
    max-height: 5000px;
    transition: max-height 0.4s ease, opacity 0.3s ease;
    opacity: 1;
}

/* Collapsed State */
.aipa-ai-section.aipa-analysis-collapsed .aipa-analysis-body {
    max-height: 0;
    opacity: 0;
    padding: 0;
    margin: 0;
}

.aipa-ai-section.aipa-analysis-collapsed .aipa-analysis-toggle-header {
    padding-bottom: 0;
}
