article:has(#bots-main-container){
    padding-left: 10px !important;
    padding-right: 10px !important;
}

.bots-trading-system {
    max-width: 1400px;
    margin: 20px auto;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
}

/* Header Section */
.bots-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

body #bots-main-container h2.bots-title {
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 !important;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.bots-controls {
    display: flex;
    gap: 12px;
}

.bots-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.bots-btn i {
    font-size: 14px;
}

.bots-btn-primary {
    background: #007cba;
    color: white;
}

.bots-btn-primary:hover {
    background: #005a85;
}

.bots-btn-secondary {
    background: #6c757d;
    color: white;
}

.bots-btn-secondary:hover {
    background: #545b62;
}

.bots-btn-link {
    background: transparent;
    color: #007cba;
    text-decoration: underline;
    border: 1px solid transparent;
    text-transform: none;
}

.bots-btn-link:hover {
    background: #f8f9fa;
    border-color: #dee2e6;
}

/* Main Grid Layout */
.bots-main-grid {
    display: grid;
    grid-template-columns: 290px 1fr 280px;
    gap: 20px;
}

/* Left Column */
.bots-left-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Panel Styles with Icon Support */
.bots-panel {
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 20px;
}

#bots-main-container div.bots-panel h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 20px 0;
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 8px;
}

div.bots-panel h3 i {
    color: #007cba;
    font-size: 18px;
}

/* Field Groups with Icon Support */
.bots-field-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}

.bots-field-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    color: #4b5563;
    font-size: 13px;
}

.bots-field-group label i {
    color: #6b7280;
    font-size: 16px;
    width: 18px;
    text-align: center;
}

/* Input Styling */
.bots-session-overview input,
.bots-strategy-section input {
    width: 105px;
    padding: 4px 8px;
    border: 1px solid #d1d5db;
    border-radius: 3px;
    font-size: 13px;
    text-align: right;
    font-weight: 600;
}

.bots-session-overview input:focus,
.bots-strategy-section input:focus {
    border-color: #3b82f6;
    outline: none;
    box-shadow: 0 0 0 2px rgba( 59, 130, 246, 0.1 );
}

.bots-calculated-field {
    width: 105px;
    padding: 4px 8px;
    background: #f9fafb;
    border: 1px solid #f9fafb;
    border-radius: 3px;
    font-size: 13px;
    text-align: right;
    font-weight: 600;
    color: #1f2937;
}

.bots-performance-panel .bots-calculated-field {
    width: 90px;
}

/* Indicators */
#bots-main-container .bots-indicator-good,
#bots-main-container .bots-indicator-green {
    background: #d1fae5;
    color: #065f46;
    border-color: #10b981;
}

#bots-main-container .bots-indicator-bad,
#bots-main-container .bots-indicator-red {
    background: #fee2e2;
    color: #991b1b;
    border-color: #ef4444;
}

#bots-main-container .bots-indicator-neutral {
    background: #f3f4f6;
    color: #6b7280;
    border-color: #9ca3af;
}

#bots-main-container .bots-indicator-warning,
#bots-main-container .bots-indicator-yellow {
    background: #fff2cc;
    color: #a47900;
    border-color: #ffd14f;
}

/* Trade Log Panel */
.bots-trade-log {
    min-height: 500px;
}

.bots-trade-headers {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr 2fr 2fr;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 2px solid #374151;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    color: #374151;
}

.bots-trade-rows {
    max-height: 430px;
    overflow-y: auto;
}

.bots-trade-row {
    display: grid;
    grid-template-columns: minmax( 40px, 65px ) minmax( 70px, 2fr ) minmax( 60px, 1fr ) minmax( 65px, 2fr ) 2fr;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid #f3f4f6;
    align-items: center;
}

.bots-trade-row:hover {
    background: #f8fafc;
}

/* Current trade highlighting - background only, no row glow */
.bots-trade-row.current-trade {
    background: #fffbeb;
    border-left: 4px solid #f59e0b;
}

.bots-trade-row.trade-pending {
    background: #f0f9ff;
    border-left: 2px solid #0ea5e9;
}

.bots-trade-no {
    font-weight: 600;
    color: #6b7280;
    font-size: 12px;
    text-align: center;
}

/* Trade Amount - Display only */
.bots-amount-display {
    display: block;
    padding: 4px 6px;
    background: #fef3c7;
    border: 1px solid #fbbf24;
    border-radius: 3px;
    font-size: 12px;
    text-align: right;
    font-weight: 700;
    color: #92400e;
}

.bots-calculated-value {
    display: block;
    padding: 4px 6px;
    background: #f9fafb;
    border: 1px solid #f9fafb;
    border-radius: 3px;
    font-size: 12px;
    text-align: right;
    font-weight: 600;
}

/* Trade Result Select - Enhanced with glow animation */
.bots-result-select {
    width: 100%;
    min-width: 45px;
    padding: 4px;
    border: 2px solid #d1d5db;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.bots-result-select:focus {
    border-color: #3b82f6;
    outline: none;
    box-shadow: 0 0 0 2px rgba( 59, 130, 246, 0.1 );
}

/* Glow animation - ON SELECT ONLY, not the row */
.bots-result-select.select-glow {
    border-color: #f59e0b;
    animation: select-glow 2s ease-in-out infinite alternate;
}

@keyframes select-glow {
    0% { 
        box-shadow: 0 0 5px rgba( 245, 158, 11, 0.5 );
        border-color: #f59e0b;
    }
    100% { 
        box-shadow: 0 0 15px rgba( 245, 158, 11, 0.8 );
        border-color: #d97706;
    }
}

.bots-result-select option[value="WON"] {
    color: #059669;
}

.bots-result-select option[value="LOST"] {
    color: #dc2626;
}

/* Select Result Animations - New animations for select fields */
.bots-result-select.select-result-animation.won {
    animation: select-success-glow 1s ease-out;
}

.bots-result-select.select-result-animation.lost {
    animation: select-failure-glow 1s ease-out;
}

@keyframes select-success-glow {
    0% { box-shadow: 0 0 0 rgba( 16, 185, 129, 0.8 ); }
    50% { box-shadow: 0 0 15px rgba( 16, 185, 129, 0.8 ); }
    100% { box-shadow: 0 0 0 rgba( 16, 185, 129, 0 ); }
}

@keyframes select-failure-glow {
    0% { box-shadow: 0 0 0 rgba( 239, 68, 68, 0.8 ); }
    50% { box-shadow: 0 0 15px rgba( 239, 68, 68, 0.8 ); }
    100% { box-shadow: 0 0 0 rgba( 239, 68, 68, 0 ); }
}

/* Trading Instructions */
.bots-trading-instructions {
    margin-top: 20px;
    padding: 15px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 4px;
}

.bots-trading-instructions h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px 0;
    color: #0c4a6e;
    font-size: 14px;
}

.bots-trading-instructions h4 i {
    color: #0369a1;
}

.bots-trading-instructions ol {
    margin: 0;
    padding-left: 20px;
    color: #0369a1;
    font-size: 12px;
}

.bots-trading-instructions li {
    margin-bottom: 5px;
}

/* Performance Panel */
.bots-performance-panel {
    min-height: 300px;
}

.bots-performance-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.bots-perf-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}

.bots-perf-item label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    color: #4b5563;
    font-size: 13px;
}

.bots-perf-item label i {
    color: #6b7280;
    font-size: 16px;
    width: 18px;
    text-align: center;
}

.bots-trend-indicator {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 12px;
    padding: 4px 12px;
}

.bots-perf-counters {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 10px;
}

.bots-counter {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px;
    border-radius: 6px;
    gap: 4px;
}

.bots-counter i {
    font-size: 20px;
    margin-bottom: 2px;
}

.bots-counter.bots-won {
    background: #d1fae5;
    color: #065f46;
}

.bots-counter.bots-lost {
    background: #fee2e2;
    color: #991b1b;
}

.bots-counter label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.bots-counter span {
    font-size: 18px;
    font-weight: 700;
}

/* Complete Session Section */
.bots-complete-section {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px solid #e5e7eb;
    text-align: center;
}

#bots-complete-session {
    width: auto;
    margin: 0.6em auto;
    padding: 12px 20px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

#bots-complete-session:hover {
    transform: translateY( -1px );
    box-shadow: 0 4px 12px rgba( 0, 124, 186, 0.3 );
}

#bots-complete-session:active {
    transform: translateY( 0 );
}

/* Modal Styling */
.bots-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba( 0, 0, 0, 0.6 );
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur( 2px );
}

.bots-modal {
    background: white;
    border-radius: 12px;
    box-shadow: 0 25px 50px rgba( 0, 0, 0, 0.3 );
    max-width: 600px;
    width: 90vw;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.bots-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: #f8f9fa;
}

#bots-main-container div.bots-modal-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

div.bots-modal-header h3 i {
    color: #007cba;
    font-size: 20px;
}

.bots-modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #6b7280;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.bots-modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.bots-modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.bots-modal-section {
    margin-bottom: 24px;
}

.bots-modal-section:last-child {
    margin-bottom: 0;
}

.bots-modal-section h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: #374151;
}

.bots-modal-section h4 i {
    color: #007cba;
}

.bots-modal-section p {
    color: #6b7280;
    margin-bottom: 16px;
    line-height: 1.5;
}

/* File Upload Area */
.bots-file-upload-area {
    margin: 16px 0;
}

.bots-upload-zone {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    background: #f9fafb;
    cursor: pointer;
    transition: all 0.3s ease;
}

.bots-upload-zone:hover,
.bots-upload-zone.drag-over {
    border-color: #007cba;
    background: #f0f9ff;
}

.bots-upload-zone i {
    font-size: 48px;
    color: #9ca3af;
    margin-bottom: 12px;
    display: block;
}

.bots-upload-zone:hover i,
.bots-upload-zone.drag-over i {
    color: #007cba;
}

.bots-upload-zone p {
    margin: 8px 0 4px 0;
    font-weight: 500;
    color: #374151;
}

.bots-upload-zone small {
    color: #6b7280;
    font-size: 12px;
}

/* Conditional Formatting */
.balance-positive {
    color: #059669 !important;
    font-weight: 600;
}

.balance-negative {
    color: #dc2626 !important;
    font-weight: 600;
}

.balance-warning {
    color: #d97706 !important;
    font-weight: 700;
    animation: pulse 2s infinite;
}

.profit-positive {
    background: #d1fae5;
    color: #065f46;
}

.profit-negative {
    background: #fee2e2;
    color: #991b1b;
}

.trade-hide {
    display: none !important;
}

.trade-won .bots-calculated-value:not(.bots-trade-negative-balance),
.trade-lost .bots-calculated-value.bots-trade-positive-balance{
    background: #d1fae5;
    color: #065f46;
    border-color: #10b981;
}

.trade-lost .bots-calculated-value.bots-amount-display,
.trade-lost .bots-trade-balance .bots-calculated-value.bots-trade-balance-loss {
    background: #fee2e2;
    color: #991b1b;
    border-color: #ef4444;
}

/* Warning Messages */
.bots-warnings {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    padding: 16px;
    margin-top: 20px;
}

.bots-warning-message {
    color: #991b1b;
    font-weight: 600;
    text-align: center;
    font-size: 14px;
    text-transform: uppercase;
    animation: pulse 2s infinite;
}

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    margin: -6px 0 0 -6px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Notifications */
.bots-notification {
    display: flex;
    align-items: center;
    gap: 8px;
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 6px;
    z-index: 100001;
    font-size: 14px;
    font-weight: 500;
    max-width: 350px;
    box-shadow: 0 4px 12px rgba( 0, 0, 0, 0.15 );
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX( 100% );
        opacity: 0;
    }
    to {
        transform: translateX( 0 );
        opacity: 1;
    }
}

.bots-notification-success {
    background: #10b981;
    color: white;
}

.bots-notification-error {
    background: #ef4444;
    color: white;
}

.bots-notification-warning {
    background: #f59e0b;
    color: white;
}

.bots-notification-info {
    background: #3b82f6;
    color: white;
}

/* Responsive Design */
@media ( max-width: 1200px ) {
    
    .bots-main-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .bots-left-column {
        flex-direction: row;
        justify-content: space-between;
    }
    
    .bots-left-column > * {
        flex: 1 1 auto;
    }
    
    .bots-left-column,
    .bots-panel.bots-trade-log,
    .bots-panel.bots-performance-panel {
        width: 100%;
        max-width: 700px;
        margin: 0 auto;
    }
    
    .bots-perf-item {
        justify-content: flex-end;
        gap: 10px;
    }
    
    .bots-modal {
        max-width: 500px;
    }
}

@media ( max-width: 768px ) {
    
    .bots-trading-system {
        padding: 15px;
        margin: 10px;
    }
    
    .bots-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .bots-trade-headers,
    .bots-trade-row {
        font-size: 11px;
        gap: 4px;
    }
    
    body #bots-main-container h2.bots-title {
        font-size: 18px;
    }
    
    .bots-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .bots-left-column {
        gap: 15px;
    }
    
    .bots-modal {
        width: 95vw;
        max-height: 90vh;
    }
    
    .bots-modal-header,
    .bots-modal-content {
        padding: 16px;
    }
}

@media ( max-width: 660px ) {
    
    .bots-session-overview input,
    .bots-strategy-section input,
    .bots-session-overview .bots-calculated-field,
    .bots-calculated-field {
        width: 85px;
    }
}

@media ( max-width: 520px ) {
    
    .bots-left-column {
        flex-direction: column;
        justify-content: flex-start;
    }
    
    .bots-perf-counters {
        flex-direction: column;
        gap: 12px;
    }
    
    .bots-counter {
        flex-direction: row;
        justify-content: space-between;
        padding: 8px 16px;
    }
    
    #bots-complete-session {
        padding: 10px 16px;
        font-size: 12px;
    }
}

@media ( max-width: 379px ) {
    
    .bots-trade-headers, 
    .bots-trade-row {
        gap: 2px;
    }
    
    .bots-trade-headers > *:first-child, 
    .bots-trade-row > *:first-child {
        display: none;
    }
}

/* Animations */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes spin {
    0% { transform: rotate( 0deg ); }
    100% { transform: rotate( 360deg ); }
}

/* High contrast mode support */
@media ( prefers-contrast: high ) {
    
    .bots-trading-system {
        border: 2px solid #000000;
    }
    
    .bots-panel {
        border: 1px solid #000000;
    }
    
    .bots-calculated-field {
        border: 1px solid #000000;
    }
    
    .bots-result-select.select-glow {
        border-color: #000000;
        box-shadow: 0 0 10px #000000;
    }
}

/* Print styles */
@media print {
    
    .bots-header,
    .bots-modal-overlay,
    .bots-notification,
    .bots-complete-section {
        display: none;
    }
    
    .bots-trading-system {
        box-shadow: none;
        background: white;
    }
    
    .bots-main-grid {
        grid-template-columns: 1fr 2fr 1fr;
    }
    
    .bots-result-select.select-glow {
        animation: none;
        border-color: #d1d5db;
        box-shadow: none;
    }
}