/* Body and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #0d0e12;
    color: #d1d4dc;
    overflow: hidden;
}

/* Navigation Bar Styles */
.nav-bar {
    background: #1a1b1f;
    border-bottom: 1px solid #2b2d35;
    padding: 0;
    display: flex;
    align-items: center;
    height: 40px;
}

.nav-brand {
    padding: 0 12px;
    font-size: 14px;
    font-weight: 600;
    color: #d1d4dc;
    border-right: 1px solid #2b2d35;
    height: 100%;
    display: flex;
    align-items: center;
    min-width: 140px;
}

.nav-items {
    display: flex;
    flex: 1;
    height: 100%;
}

.nav-item {
    padding: 0 12px;
    color: #808080;
    text-decoration: none;
    display: flex;
    align-items: center;
    height: 100%;
    font-size: 11px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    cursor: pointer;
}

.nav-item:hover {
    color: #d1d4dc;
    background: rgba(255, 255, 255, 0.03);
}

.nav-item.active {
    color: #2962ff;
    border-bottom-color: #2962ff;
}

/* Page container - base styles only, display controlled by index.html inline styles */
.page {
    /* Styles managed by index.html inline styles */
}

/* Account Table */
.account-table {
    width: 100%;
    border-collapse: collapse;
    background: #1a1b1f;
    font-size: 12px;
}

.account-table thead {
    background: #2b2d35;
    position: sticky;
    top: 0;
}

.account-table th {
    color: #d1d4dc;
    font-weight: 600;
    text-align: left;
    padding: 10px 15px;
    border: 1px solid #3a3c45;
    white-space: nowrap;
    font-size: 11px;
}

.account-table td {
    color: #d1d4dc;
    padding: 8px 15px;
    border: 1px solid #2b2d35;
    white-space: nowrap;
}

.account-table tbody tr:hover {
    background: #2b2d35;
}

.account-table .positive {
    color: #00e676;
}

.account-table .negative {
    color: #ff1744;
}

.account-table .neutral {
    color: #d1d4dc;
}

/* Order table status classes */
.side-buy {
    color: #00e676;
    font-weight: 600;
}

.side-sell {
    color: #ff1744;
    font-weight: 600;
}

.status-pending {
    color: #ffa500;
}

.status-filled {
    color: #00e676;
}

.status-cancelled {
    color: #808080;
}

.status-rejected {
    color: #ff1744;
}

.status-partial {
    color: #2196f3;
}

/* Execution venue badges */
.venue-sim {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    background: #2b2d35;
    color: #808080;
    border: 1px solid #3a3c45;
}

.venue-live {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    background: rgba(0, 230, 118, 0.15);
    color: #00e676;
    border: 1px solid #00e676;
}

/* Cancel button */
.cancel-btn {
    background: #ff1744;
    border: none;
    color: white;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
}

.cancel-btn:hover {
    background: #ff5252;
}

.connection-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.connection-dot.connected {
    background: #00e676;
    box-shadow: 0 0 4px #00e676;
}

.connection-dot.disconnected {
    background: #808080;
}

/* Info Panel */
.info-panel {
    position: absolute;
    top: 60px;
    left: 20px;
    background: rgba(26, 27, 31, 0.95);
    border: 1px solid #2b2d35;
    border-radius: 8px;
    padding: 15px;
    max-width: 250px;
    display: none;
    z-index: 100;
}

.info-panel.show {
    display: block;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 12px;
}

.info-label {
    color: #808080;
}

.info-value {
    color: #d1d4dc;
    font-weight: 600;
}

.legend {
    position: absolute;
    top: 60px;
    right: 100px;
    background: rgba(26, 27, 31, 0.95);
    border: 1px solid #2b2d35;
    border-radius: 8px;
    padding: 10px;
    font-size: 11px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 0;
}

.legend-color {
    width: 20px;
    height: 2px;
}

.zoom-controls {
    position: absolute;
    bottom: 25%;
    right: 8%;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 20;
}

.zoom-btn {
    background: #2b2d35;
    border: 1px solid #3a3c45;
    color: #d1d4dc;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zoom-btn:hover {
    background: #3a3c45;
}

.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #808080;
    font-size: 18px;
}

.loading.hide {
    display: none;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.2s;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #1a1b1f;
    border: 1px solid #2b2d35;
    border-radius: 8px;
    padding: 0;
    width: 90%;
    max-width: 400px;
    animation: slideDown 0.3s;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #2b2d35;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #d1d4dc;
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: #808080;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #2b2d35;
    color: #d1d4dc;
}

.modal-body {
    padding: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #808080;
    font-size: 13px;
    font-weight: 500;
}

.indicator-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #1e2229;
    border: 1px solid #2b2d35;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.indicator-checkbox-label:hover {
    background: #2b2d35;
    border-color: #3a3c45;
}

.indicator-checkbox-label input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.indicator-checkbox-label span {
    flex: 1;
    color: #d1d4dc;
    font-size: 14px;
}

.indicator-color {
    width: 40px;
    height: 3px;
    border-radius: 2px;
}

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

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

@keyframes slideIn {
    from {
        transform: translateX(100px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100px);
        opacity: 0;
    }
}

/* ============================================
   Copy Trading Page Styles
   ============================================ */

.copy-trading-container {
    display: flex;
    flex-direction: column;
    padding: 20px;
    align-items: stretch;
    justify-content: flex-start;
}

.copy-trading-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.copy-trading-header h1 {
    font-size: 24px;
    font-weight: 600;
    color: #d1d4dc;
    margin: 0;
}

/* Copy Trading Tabs */
.copy-trading-tabs {
    display: flex;
    gap: 4px;
    background: #1a1b1f;
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 20px;
}

.copy-trading-tabs .tab-btn {
    padding: 10px 20px;
    background: transparent;
    border: none;
    color: #808080;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.copy-trading-tabs .tab-btn:hover {
    color: #d1d4dc;
    background: rgba(255, 255, 255, 0.05);
}

.copy-trading-tabs .tab-btn.active {
    color: #fff;
    background: #2962ff;
}

/* Tab Panels */
.tab-panel {
    display: none;
    flex: 1;
    overflow: auto;
}

.tab-panel.active {
    display: block;
}

/* Leaders Grid */
.leaders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.leader-card {
    background: #1a1b1f;
    border: 1px solid #2b2d35;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s;
}

.leader-card:hover {
    border-color: #3a3c45;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.leader-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.leader-name {
    font-size: 18px;
    font-weight: 600;
    color: #d1d4dc;
    margin: 0;
}

.leader-status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.leader-status.active {
    background: rgba(0, 230, 118, 0.15);
    color: #00e676;
}

.leader-status.inactive {
    background: rgba(128, 128, 128, 0.15);
    color: #808080;
}

.leader-description {
    color: #808080;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 16px;
    min-height: 40px;
}

.leader-stats {
    display: flex;
    justify-content: space-between;
    background: #0d0e12;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
}

.leader-stats .stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.leader-stats .stat-value {
    font-size: 16px;
    font-weight: 600;
    color: #d1d4dc;
}

.leader-stats .stat-value.positive {
    color: #00e676;
}

.leader-stats .stat-value.negative {
    color: #ff1744;
}

.leader-stats .stat-label {
    font-size: 11px;
    color: #808080;
    text-transform: uppercase;
}

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

.leader-actions button {
    flex: 1;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

/* Subscriptions List */
.subscriptions-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.subscription-card {
    background: #1a1b1f;
    border: 1px solid #2b2d35;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s;
}

.subscription-card:hover {
    border-color: #3a3c45;
}

.subscription-card.paused {
    opacity: 0.7;
}

.subscription-card.cancelled {
    opacity: 0.5;
}

.subscription-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.subscription-info h3 {
    font-size: 16px;
    font-weight: 600;
    color: #d1d4dc;
    margin: 0 0 8px 0;
}

.subscription-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.subscription-status.active {
    background: rgba(0, 230, 118, 0.15);
    color: #00e676;
}

.subscription-status.paused {
    background: rgba(255, 193, 7, 0.15);
    color: #ffc107;
}

.subscription-status.cancelled {
    background: rgba(255, 23, 68, 0.15);
    color: #ff1744;
}

.subscription-accounts {
    text-align: right;
}

.follower-account {
    font-size: 12px;
    color: #808080;
}

.subscription-settings {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    background: #0d0e12;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
}

.setting-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.setting-label {
    font-size: 11px;
    color: #808080;
    text-transform: uppercase;
}

.setting-value {
    font-size: 13px;
    color: #d1d4dc;
    font-weight: 500;
}

.subscription-performance {
    display: flex;
    gap: 24px;
    margin-bottom: 16px;
}

.perf-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.perf-value {
    font-size: 18px;
    font-weight: 600;
    color: #d1d4dc;
}

.perf-value.positive {
    color: #00e676;
}

.perf-value.negative {
    color: #ff1744;
}

.perf-label {
    font-size: 11px;
    color: #808080;
    text-transform: uppercase;
}

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

.subscription-actions button {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

/* My Leader Cards */
.my-leaders-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.my-leader-card {
    background: #1a1b1f;
    border: 1px solid #2b2d35;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s;
}

.my-leader-card:hover {
    border-color: #3a3c45;
}

/* Button Styles */
.btn-primary {
    background: #2962ff;
    border: none;
    color: #fff;
}

.btn-primary:hover {
    background: #1e4bd8;
}

.btn-secondary {
    background: #2b2d35;
    border: 1px solid #3a3c45;
    color: #d1d4dc;
}

.btn-secondary:hover {
    background: #3a3c45;
}

.btn-success {
    background: rgba(0, 230, 118, 0.15);
    border: 1px solid #00e676;
    color: #00e676;
}

.btn-success:hover {
    background: rgba(0, 230, 118, 0.25);
}

.btn-warning {
    background: rgba(255, 193, 7, 0.15);
    border: 1px solid #ffc107;
    color: #ffc107;
}

.btn-warning:hover {
    background: rgba(255, 193, 7, 0.25);
}

.btn-danger {
    background: rgba(255, 23, 68, 0.15);
    border: 1px solid #ff1744;
    color: #ff1744;
}

.btn-danger:hover {
    background: rgba(255, 23, 68, 0.25);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #808080;
}

.empty-state p {
    margin: 8px 0;
    font-size: 14px;
}

.empty-state button {
    margin-top: 20px;
}

/* Copy Trading Modal Styles */
.copy-trading-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    align-items: center;
    justify-content: center;
}

.copy-trading-modal .modal-content {
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.copy-trading-modal .modal-header {
    position: sticky;
    top: 0;
    background: #1a1b1f;
    z-index: 1;
}

.copy-trading-modal .close-modal {
    background: none;
    border: none;
    color: #808080;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.copy-trading-modal .close-modal:hover {
    color: #d1d4dc;
}

/* Form Styles for Copy Trading */
.copy-trading-modal .form-group {
    margin-bottom: 16px;
}

.copy-trading-modal .form-group label {
    display: block;
    margin-bottom: 6px;
    color: #808080;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.copy-trading-modal .form-group input,
.copy-trading-modal .form-group select,
.copy-trading-modal .form-group textarea {
    width: 100%;
    padding: 10px 12px;
    background: #0d0e12;
    border: 1px solid #2b2d35;
    border-radius: 6px;
    color: #d1d4dc;
    font-size: 14px;
    transition: border-color 0.2s;
}

.copy-trading-modal .form-group input:focus,
.copy-trading-modal .form-group select:focus,
.copy-trading-modal .form-group textarea:focus {
    outline: none;
    border-color: #2962ff;
}

.copy-trading-modal .form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.copy-trading-modal .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.copy-trading-modal .checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.copy-trading-modal .checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #d1d4dc;
}

.copy-trading-modal .checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.copy-trading-modal .form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #2b2d35;
}

.copy-trading-modal .form-actions button {
    flex: 1;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-trading-modal .form-hint {
    font-size: 11px;
    color: #808080;
    margin-top: 4px;
}

/* Loading and Error States */
.loading {
    text-align: center;
    padding: 40px;
    color: #808080;
    font-size: 14px;
}

.error {
    text-align: center;
    padding: 40px;
    color: #ff1744;
    font-size: 14px;
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 24px;
    border-radius: 6px;
    color: #fff;
    font-weight: 500;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.notification-success {
    background: #28a745;
}

.notification-error {
    background: #dc3545;
}

.notification-warning {
    background: #ffc107;
    color: #000;
}

.notification-info {
    background: #17a2b8;
}

/* ========================
   Flatten All Buttons
   ======================== */

/* Main Flatten All button - red/danger style */
.flatten-all-btn {
    padding: 8px 16px;
    background: linear-gradient(180deg, #ff4444 0%, #cc0000 100%);
    border: 1px solid #ff6666;
    border-radius: 4px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(255, 0, 0, 0.2);
}

.flatten-all-btn:hover {
    background: linear-gradient(180deg, #ff5555 0%, #dd1111 100%);
    border-color: #ff7777;
    box-shadow: 0 4px 8px rgba(255, 0, 0, 0.3);
    transform: translateY(-1px);
}

.flatten-all-btn:active {
    background: linear-gradient(180deg, #cc0000 0%, #aa0000 100%);
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(255, 0, 0, 0.2);
}

.flatten-all-btn:disabled {
    background: #3a3c45;
    border-color: #4a4c55;
    color: #666;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Section-specific flatten buttons - subtler orange/warning style */
.flatten-section-btn {
    padding: 5px 12px;
    background: linear-gradient(180deg, #ff8c00 0%, #cc7000 100%);
    border: 1px solid #ffa500;
    border-radius: 4px;
    color: #ffffff;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.flatten-section-btn:hover {
    background: linear-gradient(180deg, #ffa500 0%, #dd8000 100%);
    border-color: #ffb732;
}

.flatten-section-btn:active {
    background: linear-gradient(180deg, #cc7000 0%, #aa5500 100%);
}

.flatten-section-btn:disabled {
    background: #3a3c45;
    border-color: #4a4c55;
    color: #666;
    cursor: not-allowed;
}
