/**
 * Cloned Bot Profile Styles
 * Glass-morphism design for cloned AI trading bot management
 */

:root {
    --bg-primary: #0a0f19;
    --bg-secondary: #111827;
    --bg-card: #1a1f2e;
    --text-primary: #f9fafb;
    --text-secondary: rgba(0,207,255,0.4);
    --accent-cyan: #00cfff;
    --accent-green: #00ff88;
    --accent-red: #ff4444;
    --agent-color: #00cfff;
}

/* Note: base_content.html provides body styles, reset, header, and footer */

/* Page Loading */
.page-loading {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.page-loading.hidden {
    opacity: 0;
    visibility: hidden;
}

.page-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 207, 255, 0.2);
    border-top-color: var(--accent-cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.page-loading-text {
    margin-top: 16px;
    color: var(--text-secondary);
    font-size: 14px;
}

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

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 100px 20px;
    color: var(--text-secondary);
}

.loading-state .spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(0, 207, 255, 0.2);
    border-top-color: var(--accent-cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

/* Back Button */
.back-btn {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 100;
    width: 44px;
    height: 44px;
    border-radius: var(--panel-radius);
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
    color: var(--text-primary);
}

.back-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-cyan);
}

.back-btn svg {
    width: 20px;
    height: 20px;
}

/* Profile Header */
.profile-header {
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    padding: 60px 16px 24px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
}

/* Removed: profile-header gradient line */

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: var(--bg-card);
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    border: 3px solid var(--accent-cyan);
    box-shadow: 0 0 30px rgba(0, 207, 255, 0.2);
}

.profile-name {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.profile-tagline {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 16px;
}

.profile-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.profile-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 20px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
}

.trading-status {
    background: rgba(255, 68, 68, 0.15);
    border: 1px solid rgba(255, 68, 68, 0.3);
    color: #ff4444;
}

.trading-status.active {
    background: rgba(0, 255, 157, 0.15);
    border-color: rgba(0, 255, 157, 0.3);
    color: var(--accent-green);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.trading-status.active .status-dot {
    animation: pulse 2s infinite;
}

.trading-status.stop-loss {
    background: rgba(255, 68, 68, 0.2);
    border-color: rgba(255, 68, 68, 0.4);
    color: #ff4444;
}

.trading-status.take-profit {
    background: rgba(0, 255, 136, 0.2);
    border-color: rgba(0, 255, 136, 0.4);
    color: #00ff88;
}

.trading-status.position-long {
    background: rgba(0, 255, 136, 0.15);
    border-color: rgba(0, 255, 136, 0.3);
    color: var(--accent-green, #00ff88);
}

.trading-status.position-short {
    background: rgba(255, 68, 68, 0.15);
    border-color: rgba(255, 68, 68, 0.3);
    color: var(--accent-red, #ff4444);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.wallet-badge {
    background: rgba(0, 207, 255, 0.1);
    border: 1px solid rgba(0, 207, 255, 0.2);
    color: var(--accent-cyan);
    min-height: 44px;
    box-sizing: border-box;
}

.wallet-badge:hover {
    background: rgba(0, 207, 255, 0.2);
}

.wallet-badge svg {
    width: 14px;
    height: 14px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 16px;
    max-width: 600px;
    margin: 0 auto;
}

.stat-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 16px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-value.positive {
    color: var(--accent-green);
}

.stat-value.negative {
    color: var(--accent-red);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Owner-only breakdown under a stat (e.g. withdrawable vs internal P&L). */
.stat-sublabel {
    color: var(--text-secondary);
    font-size: 11px;
    line-height: 1.45;
    margin-top: 6px;
}

.stat-sublabel .sub-withdrawable {
    color: var(--accent-cyan, #00cfff);
    font-weight: 600;
}

/* Sections */
.section {
    padding: 16px;
    max-width: 600px;
    margin: 0 auto;
    overflow: hidden;
}
.section.activity-section {
    max-width: 960px;
    overflow: visible;
}

.section-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-cyan);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title svg {
    width: 16px;
    height: 16px;
}

/* Trading Toggle */
.trading-toggle-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.toggle-info h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.toggle-info p {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Profile page toggle — uses universal .et-toggle from main.css, slightly larger */
.toggle-switch {
    position: relative;
    width: 56px;
    height: 30px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 30px;
    transition: background 0.25s ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background: white;
    border-radius: 50%;
    transition: transform 0.25s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--accent-green);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(26px);
}

.trading-warning {
    margin-top: 12px;
    padding: 12px;
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid rgba(255, 68, 68, 0.2);
    border-radius: 10px;
    font-size: 12px;
    color: var(--accent-red);
    text-align: center;
}

/* ET-16411: nothing populates this box on most pages — when empty it rendered
   as a bare red "error" bar under the trading toggle. Show it only with content. */
.trading-warning:empty {
    display: none;
}

/* ET-16411: the same bar doubles as the toggle's success-confirmation slot. */
.trading-warning.trading-warning-success {
    background: rgba(0, 255, 136, 0.08);
    border-color: rgba(0, 255, 136, 0.25);
    color: #00ff88;
}

/* Settings Form */
.settings-form {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.form-group {
    margin-bottom: 20px;
}

.form-group:last-of-type {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--panel-radius);
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 16px;
    transition: border-color 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-cyan);
}

.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.market-filter-toggles {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.market-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    min-height: 44px;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: 'JetBrains Mono', monospace;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    box-sizing: border-box;
}

.market-toggle:has(input:checked) {
    border-color: var(--accent-cyan);
    background: rgba(0, 207, 255, 0.1);
}

.market-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-cyan);
    cursor: pointer;
}

.settings-save-btn {
    width: 100%;
    height: 52px;
    background: linear-gradient(135deg, rgba(0, 207, 255, 0.3) 0%, rgba(0, 150, 200, 0.3) 100%);
    border: 1px solid rgba(0, 207, 255, 0.5);
    border-radius: var(--panel-radius);
    color: #fff;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease, transform 0.25s ease;
}

.settings-save-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(0, 207, 255, 0.45) 0%, rgba(0, 150, 200, 0.45) 100%);
    box-shadow: 0 0 25px rgba(0, 207, 255, 0.3);
}

.settings-save-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.settings-save-btn .btn-spinner {
    display: none;
}

.settings-save-btn.loading .btn-text {
    display: none;
}

.settings-save-btn.loading .btn-spinner {
    display: inline;
}

/* Activity Feed */
.activity-feed {
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

.activity-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-secondary);
}

.activity-empty svg {
    width: 32px;
    height: 32px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.activity-item {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 12px;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-icon.buy {
    background: rgba(0, 255, 157, 0.15);
    color: var(--accent-green);
}

.activity-icon.sell {
    background: rgba(255, 68, 68, 0.15);
    color: var(--accent-red);
}

.activity-icon svg {
    width: 18px;
    height: 18px;
}

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

.activity-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-side {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 1px 5px;
    border-radius: 3px;
    vertical-align: middle;
}

.activity-side.buy {
    background: rgba(0, 255, 136, 0.15);
    color: var(--accent-green, #00ff88);
}

.activity-side.sell {
    background: rgba(255, 68, 68, 0.15);
    color: var(--accent-red, #ff4444);
}

.activity-meta {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    gap: 8px;
}

.activity-amount {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 600;
    text-align: right;
}

.activity-amount.positive {
    color: var(--accent-green);
}

.activity-amount.negative {
    color: var(--accent-red);
}

.activity-tx {
    font-size: 12px;
    color: var(--accent-cyan);
    text-decoration: none;
    display: block;
    margin-top: 2px;
}

.activity-tx:hover {
    text-decoration: underline;
}

/* Trade History — Desktop Table */
.trade-history-desktop {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.trade-history-table {
    width: 100%;
    min-width: 700px;
    border-collapse: collapse;
    font-size: 13px;
    background: var(--bg-card);
    border-radius: var(--panel-radius);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.trade-history-table thead th {
    padding: 12px 14px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    white-space: nowrap;
}
.trade-history-table tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    white-space: nowrap;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
}
.trade-history-table tbody tr:hover {
    background: rgba(0, 207, 255, 0.04);
}
.trade-history-table tbody tr:last-child td { border-bottom: none; }
.trade-history-table .side-buy { color: var(--accent-green, #00ff88); font-weight: 600; }
.trade-history-table .side-sell { color: var(--accent-red, #ff4444); font-weight: 600; }
.trade-history-table .pnl-positive { color: var(--accent-green, #00ff88); }
.trade-history-table .pnl-negative { color: var(--accent-red, #ff4444); }
.trade-history-table .status-open { color: var(--accent-cyan, #00cfff); font-style: italic; }

/* Trade type badges */
.trade-type-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: 'JetBrains Mono', monospace;
}
.trade-type-binary { background: rgba(0, 207, 255,0.18); color: #4da6ff; border: 1px solid var(--panel-border-hover); }
.trade-type-wta    { background: rgba(0,207,255,0.15); color: #00cfff; border: 1px solid rgba(0,207,255,0.25); }
.trade-type-arena  { background: rgba(0,255,136,0.12); color: #00ff88; border: 1px solid rgba(0,255,136,0.25); }
.trade-type-clob   { background: rgba(0, 207, 255, 0.1); color: #4da6ff; border: 1px solid var(--panel-border-hover); }
.trade-type-exchange { background: rgba(0,207,255,0.15); color: #00cfff; border: 1px solid rgba(0,207,255,0.25); }
.trade-type-event_card { background: rgba(0,255,136,0.12); color: #00ff88; border: 1px solid rgba(0,255,136,0.25); }

/* Binary YES/NO action badges */
.binary-yes { color: #00ff88; font-weight: 700; }
.binary-no  { color: #ff4444; font-weight: 700; }

/* Trade History — Mobile Card View */
.trade-history-mobile { display: none; }
.trade-card {
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 10px;
}
.trade-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.trade-card-header .trade-type-badge { margin-right: 8px; }
.trade-card-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
}
.trade-card-body .label {
    color: rgba(255,255,255,0.4);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
@media (max-width: 768px) {
    .trade-history-desktop { display: none; }
    .trade-history-mobile { display: block !important; }
}
@media (max-width: 360px) {
    .trade-card-body { grid-template-columns: 1fr; }
}

.load-more-btn {
    width: 100%;
    padding: 14px;
    min-height: 44px;
    background: transparent;
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: var(--panel-radius);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    margin-top: 12px;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
    box-sizing: border-box;
}

.load-more-btn:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

/* Chat Section */
.chat-container {
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

.chat-messages {
    height: 300px;
    overflow-y: auto;
    padding: 16px;
}

.chat-welcome {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

.chat-message {
    margin-bottom: 12px;
    display: flex;
    gap: 10px;
}

.chat-message.user {
    flex-direction: row-reverse;
}

.chat-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
}

.chat-message.bot .chat-bubble {
    background: rgba(0, 207, 255, 0.1);
    border: 1px solid rgba(0, 207, 255, 0.2);
    border-radius: 16px 16px 16px 4px;
}

.chat-message.user .chat-bubble {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px 16px 4px 16px;
}

.chat-input-form {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-input-form input {
    flex: 1;
    height: 48px;
    padding: 0 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--panel-radius);
    color: var(--text-primary);
    font-size: 14px;
}

.chat-input-form input:focus {
    outline: none;
    border-color: var(--accent-cyan);
}

.chat-send-btn {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--accent-cyan), #0088cc);
    border: none;
    border-radius: var(--panel-radius);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
    flex-shrink: 0;
}

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

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.chat-send-btn svg {
    width: 20px;
    height: 20px;
}

/* Owner Only Notice */
.owner-only-notice {
    margin: 16px;
    padding: 16px;
    background: rgba(0, 207, 255, 0.1);
    border: 1px solid var(--panel-border-hover);
    border-radius: var(--panel-radius);
    display: flex;
    align-items: center;
    gap: 12px;
    color: #00cfff;
    font-size: 13px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.owner-only-notice svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Footer provided by base_content.html */

/* Team badges */
.team-badge { padding: 4px 10px; border-radius: 12px; font-size: 0.75rem; font-weight: 600; }
.team-badge.team-blue { background: rgba(0,207,255,0.15); color: #00cfff; border: 1px solid rgba(0,207,255,0.3); }
.team-badge.team-red { background: rgba(255,107,107,0.15); color: #ff6b6b; border: 1px solid rgba(255,107,107,0.3); }
.mode-badge { padding: 4px 10px; border-radius: 12px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.mode-badge.live { background: rgba(0,255,136,0.15); color: #00ff88; border: 1px solid rgba(0,255,136,0.3); }
.mode-badge.paper { background: rgba(0,207,255,0.15); color: #00cfff; border: 1px solid rgba(0,207,255,0.3); }

/* Fund section */
.fund-card { background: rgba(10,20,40,0.8); border-radius: 16px; padding: 24px; border: 1px solid rgba(0,207,255,0.2); }
.fund-card h2 { font-size: 1.25rem; color: #00cfff; margin: 0 0 4px; }
.fund-card p { color: rgba(0,207,255,0.4); font-size: 0.85rem; margin: 0 0 16px; }
.fund-progress { margin-bottom: 16px; }
.fund-progress-bar { height: 8px; background: rgba(255,255,255,0.1); border-radius: 4px; overflow: hidden; }
.fund-progress-fill { height: 100%; background: linear-gradient(90deg, #00cfff, #00ff88); border-radius: 4px; transition: width 0.5s ease; }
.fund-progress-label { font-size: 0.8rem; color: rgba(0,207,255,0.4); margin-top: 6px; }
.fund-address-row { display: flex; gap: 8px; align-items: center; margin: 16px 0; }
.fund-address { flex: 1; background: rgba(0,0,0,0.3); padding: 10px 14px; border-radius: 8px; font-size: 0.75rem; color: #00cfff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fund-copy-btn { padding: 10px 16px; background: #00cfff; color: #000; border: none; border-radius: 8px; font-weight: 600; cursor: pointer; font-size: 0.85rem; transition: transform 0.1s; }
.fund-copy-btn:active { transform: scale(0.95); }
.fund-qr { display: flex; justify-content: center; margin: 16px 0; padding: 16px; background: #fff; border-radius: var(--panel-radius); width: fit-content; margin-left: auto; margin-right: auto; }
.fund-status { text-align: center; font-size: 0.85rem; color: rgba(0,207,255,0.4); margin-top: 12px; }
.fund-status.detected { color: #00ff88; }


/* Delete Confirmation Modal */
.delete-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.delete-modal {
    background: linear-gradient(135deg, #0a1628, #0f2440);
    border: 1px solid rgba(255, 68, 68, 0.3);
    border-radius: 16px;
    padding: 24px;
    max-width: 360px;
    width: 100%;
    text-align: center;
}

.delete-modal-icon {
    color: #ff4444;
    margin-bottom: 12px;
}

.delete-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px;
}

.delete-modal-text {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0 0 20px;
    line-height: 1.5;
}

.delete-modal-text strong {
    color: var(--text-primary);
}

.delete-modal-actions {
    display: flex;
    gap: 10px;
}

.delete-modal-cancel {
    flex: 1;
    padding: 10px;
    min-height: 44px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s, opacity 0.2s, transform 0.2s;
    box-sizing: border-box;
}

.delete-modal-cancel:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
}

.delete-modal-confirm {
    flex: 1;
    padding: 10px;
    min-height: 44px;
    background: rgba(255, 68, 68, 0.25);
    border: 1px solid rgba(255, 68, 68, 0.5);
    border-radius: 10px;
    color: #fca5a5;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s, opacity 0.2s, transform 0.2s;
    box-sizing: border-box;
}

.delete-modal-confirm:hover {
    background: rgba(255, 68, 68, 0.4);
}

.delete-modal-confirm:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Avatar Edit Overlay */
.profile-avatar-wrapper {
    position: relative;
    width: 80px;
    margin: 0 auto 16px;
}

.profile-avatar-wrapper.editable {
    cursor: pointer;
}

.avatar-edit-overlay {
    position: absolute;
    inset: 0;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    color: #fff;
}

.profile-avatar-wrapper.editable:hover .avatar-edit-overlay {
    opacity: 1;
}

.profile-avatar-wrapper .profile-avatar {
    margin: 0;
}

.avatar-uploading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 17px;
}

/* Editable Name */
.profile-name.editable {
    border-bottom: 1px dashed rgba(255, 255, 255, 0.3);
    cursor: text;
    outline: none;
    transition: border-color 0.2s ease;
    display: inline-block;
}

.profile-name.editable:hover {
    border-bottom-color: var(--accent-cyan);
}

.profile-name.editable:focus {
    border-bottom: 2px solid var(--accent-cyan);
}

.profile-name .name-saved {
    font-size: 12px;
    color: var(--accent-green);
    margin-left: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.profile-name .name-saved.visible {
    opacity: 1;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .profile-header {
        padding: 50px 12px 20px;
    }

    .profile-avatar-wrapper {
        width: 64px;
    }

    .profile-avatar {
        width: 64px;
        height: 64px;
        font-size: 28px;
    }

    .profile-name {
        font-size: 20px;
    }

    .profile-badges {
        flex-direction: column;
        align-items: center;
    }

    .stats-grid {
        padding: 12px;
        gap: 10px;
    }

    .stat-value {
        font-size: 18px;
    }

    .section {
        padding: 12px;
    }

    .chat-messages {
        height: 250px;
    }

}

/* =============================================================================
   LIGHT MODE OVERRIDES
   ============================================================================= */

/* --- Page & Header Backgrounds --- */
[data-theme="light"] .page-loading {
    background: var(--bg-primary, #f8f9fc);
}

[data-theme="light"] .profile-header {
    background: linear-gradient(180deg, var(--bg-secondary, #f0f2f8) 0%, var(--bg-primary, #f8f9fc) 100%);
    border-bottom-color: var(--panel-border, rgba(0, 80, 160, 0.10));
}

/* --- Cards & Panels --- */
[data-theme="light"] .stat-card,
[data-theme="light"] .settings-form,
[data-theme="light"] .activity-feed,
[data-theme="light"] .chat-container,
[data-theme="light"] .trading-toggle-card,
[data-theme="light"] .fund-card {
    background: var(--panel-bg, rgba(255, 255, 255, 0.95));
    border-color: var(--panel-border, rgba(0, 80, 160, 0.10));
}

[data-theme="light"] .back-btn {
    background: var(--panel-bg, rgba(255, 255, 255, 0.95));
    border-color: var(--panel-border, rgba(0, 80, 160, 0.10));
    color: var(--text-primary, #0f172a);
}

[data-theme="light"] .back-btn:hover {
    background: var(--bg-secondary, #f0f2f8);
}

[data-theme="light"] .profile-avatar {
    background: var(--bg-secondary, #f0f2f8);
}

/* --- Text --- */
[data-theme="light"] .profile-name {
    color: var(--text-heading, #0f172a);
}

[data-theme="light"] .profile-tagline,
[data-theme="light"] .toggle-info p,
[data-theme="light"] .activity-meta,
[data-theme="light"] .chat-welcome,
[data-theme="light"] .activity-empty,
[data-theme="light"] .loading-state,
[data-theme="light"] .page-loading-text,
[data-theme="light"] .form-hint,
[data-theme="light"] .fund-card p,
[data-theme="light"] .fund-progress-label,
[data-theme="light"] .fund-status {
    color: var(--text-secondary, #475569);
}

[data-theme="light"] .toggle-info h3,
[data-theme="light"] .activity-title {
    color: var(--text-heading, #0f172a);
}

/* --- Form Inputs --- */
[data-theme="light"] .form-group input,
[data-theme="light"] .chat-input-form input {
    background: var(--input-bg, #ffffff);
    border-color: var(--input-border, rgba(0, 80, 160, 0.20));
    color: var(--text-primary, #0f172a);
}

/* --- Activity Items --- */
[data-theme="light"] .activity-item {
    border-bottom-color: var(--panel-border, rgba(0, 80, 160, 0.10));
}

/* --- Chat --- */
[data-theme="light"] .chat-input-form {
    border-top-color: var(--panel-border, rgba(0, 80, 160, 0.10));
}

[data-theme="light"] .chat-message.user .chat-bubble {
    background: rgba(0, 80, 160, 0.06);
    border-color: var(--panel-border, rgba(0, 80, 160, 0.10));
}

[data-theme="light"] .chat-message.bot .chat-bubble {
    background: rgba(0, 130, 210, 0.06);
    border-color: rgba(0, 130, 210, 0.15);
}

/* --- Market Toggles --- */
[data-theme="light"] .market-toggle {
    background: var(--panel-bg, rgba(255, 255, 255, 0.95));
    border-color: var(--panel-border, rgba(0, 80, 160, 0.10));
    color: var(--text-primary, #0f172a);
}

/* --- Load More Button --- */
[data-theme="light"] .load-more-btn {
    border-color: var(--panel-border, rgba(0, 80, 160, 0.15));
    color: var(--text-secondary, #475569);
}

/* --- Delete Modal --- */
[data-theme="light"] .delete-modal {
    background: var(--panel-bg, rgba(255, 255, 255, 0.98));
    border-color: rgba(220, 38, 38, 0.2);
}

[data-theme="light"] .delete-modal-title {
    color: var(--text-heading, #0f172a);
}

[data-theme="light"] .delete-modal-text {
    color: var(--text-secondary, #475569);
}

[data-theme="light"] .delete-modal-cancel {
    background: var(--bg-secondary, #f0f2f8);
    border-color: var(--panel-border, rgba(0, 80, 160, 0.15));
    color: var(--text-primary, #0f172a);
}

/* --- Fund Section --- */
[data-theme="light"] .fund-address {
    background: var(--bg-secondary, #f0f2f8);
    color: var(--accent-cyan, #0091d5);
}

[data-theme="light"] .fund-progress-bar {
    background: rgba(0, 80, 160, 0.1);
}

/* --- Toggle Slider --- */
[data-theme="light"] .toggle-slider {
    background: rgba(0, 80, 160, 0.15);
}

/* --- Owner Notice --- */
[data-theme="light"] .owner-only-notice {
    background: rgba(0, 207, 255, 0.06);
    border-color: var(--panel-border);
    color: #0096cc;
}
