
.right { float: right }
body {
background-color: #1e1e1e;
color: #DDD;
font-family: Arial, sans-serif;
margin: 0;
padding: 20px;
}
#container {
display: flex;
flex-direction: column;
gap: 20px;
max-width: 100%;
height:100%;
margin: 0 auto;
position: relative;
}
#chartArea {
height: auto;
height:calc(100vh - 320px);
width: 100%;
position: relative;
background-color:transparent;
padding:0;

}
.controls {
display: flex;
gap: 10px;
padding: 10px;
background: #2d2d2d;
border-radius: 4px;
}

button {
padding: 8px 16px;
background: #444;
color: #DDD;
border: none;
border-radius: 4px;
cursor: pointer;
}
button:hover {
background: #555;
}
#playActionBtn {
    width:80px;
}
.trading-controls {
    display: flex;
    
    padding: 15px;
    background: #2d2d2d;
    border-radius: 4px;
    align-items: center;
    justify-content: space-between;
}
.position-info {
    white-space: nowrap;
    height: 20px; 
    visibility: hidden;
    min-width: 100px;
}
  
.position-info.visible {
visibility: visible;
}

.position-size, .order-params {
    display: flex;
    gap: 10px;
    align-items: center;
}

button.buy {
    background: #26a69a;
}

button.sell {
    background: #ef5350;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

select, input {
    background: #444;
    color: #DDD;
    border: 1px solid #666;
    padding: 5px;
    border-radius: 4px;
}

.account-info {
    __display: flex;
    __gap: 20px;
    __padding: 10px;
    __background: #333;
    __border-radius: 4px;
}

.stats-container {
    padding: 0;
    margin-top: 10px;
}

.stats-box {
    /*
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    
    */
    flex-grow:1;
    display:flex;
    justify-content: space-around;
    background: #333;
    padding: 10px;
    border-radius: 4px;
}
.game-over-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #2d2d2d;
    padding: 20px;
    border-radius: 8px;
    min-width: 300px;
    z-index:9999;
}
.modal-content h2 { text-align:center }

.modal-content div.lbl {
    margin: 10px 0;
}

.modal-content button {
    margin-top: 20px;
    width: 49%;
}
#playBtn {
    background: #666;
}
#playBtn:hover {
    background: #777;
}
.time-display {
    /* position: absolute;
    top: 10px;
    right: 20px;
    */
    background: rgba(45, 45, 45, 0.8);
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: monospace;
}

.time-display.approaching-event {
    background: rgba(180, 40, 40, 0.8);
}

.event-indicator {
    display: inline-block;
    width: 18px;
    height: 18px;
    background: #ff4d4d;
    color: white;
    text-align: center;
    line-height: 18px;
    border-radius: 50%;
    font-weight: bold;
}

.hidden {
    display: none;
}

.filler {
    font-family: monospace;
    align-self: center;
    flex-grow: 1;
    background: transparent;
    text-align: right;
    font-size:15px;
    font-weight:600;
    }

    .speed-control {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 10px;
}

/* playback */

.speed-control select {
    background: #444;
    color: #DDD;
    border: 1px solid #666;
    padding: 4px 8px;
    border-radius: 4px;
}

.dropdown {
    position: relative;
    display: inline-block;
}


.caret {
    font-size: 10px;
}


.button-group {
    display: flex;
    align-items: center;
    background: #444;
    border-radius: 4px;
    overflow: hidden;
}

.action-button {
    background: transparent;
    color: #DDD;
    border: none;
    padding: 8px 16px;
    cursor: pointer;
    border-radius: 0 0px 0 4px;
}

.action-button:hover {
    background: #555;
}

.divider {
    width: 1px;
    height: 24px;
    background: #666;
}

.dropdown-toggle {
    background: transparent;
    color: #DDD;
    border: none;
    padding: 8px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    border-radius: 0 4px 0 0px;
}

.dropdown-toggle:hover {
    background: #555;
    
}
.dropdown-menu.show {
    display: block;
}



.dropdown-menu {
    display: none;
    position: absolute;
    background-color: #333;
    min-width: 120px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 9999;
    border-radius: 4px;
    margin-top: 4px;
}



.dropdown-menu a {
    color: #DDD;
    padding: 8px 12px;
    text-decoration: none;
    display: block;
}

.dropdown-menu a:hover {
    background-color: #444;
}

.dropdown-menu a.active {
    background-color: #9598a1;
}

/* settings */

.settings-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 18px;
    margin-left: 10px;
    padding: 4px 8px;
    border-radius: 4px;
}

#settingBtn { cursor: pointer; }

.settings-btn:hover {
    background: #444;
}

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

.settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.form-group {
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-group label {
    margin-right: 10px;
    width: 120px;
}

.form-group input {
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #666;
    background: #333;
    color: #DDD;
    width: 150px;
}

.setting-button-group {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* drawing ui */

.drawing-tools {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 100;
    background: rgba(45, 45, 45, 0.8);
    padding: 0;
    border-radius: 0;
}

.tool-btn {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 8px;
}

.tool-btn:hover {
    background: #555;
}

.tool-btn.active {
    background: #007bff;
    color: white;
}

/* limit orders */
.limit-controls {
    /*
    margin-top: 10px;
    padding: 10px;
    background: #333;
    border-radius: 4px;
    */
}

.order-type-selector {
    display: flex;
    gap: 15px;
    __margin-bottom: 10px;
}

.limit-price-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.pending-orders {
    display: flex;
    flex-direction: column;
    gap: 5px;
    max-height: 150px;
    overflow-y: auto;
    position:absolute;
    top:10px;
    left:40px;
    z-index:9999;
}

.order-item {
    __display: flex;
    justify-content: space-between;
    padding: 5px 10px;
    border-radius: 4px;
    background: #444;
    font-size:13px;
}

.order-item.buy {
    border-left: 3px solid #26a69a;
}

.order-item.sell {
    border-left: 3px solid #ef5350;
}

.cancel-btn {
    background: transparent;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 4px 8px;
    
}

.cancel-btn:hover {
    color: #fff;
}
/* take 2 */
.limit-price-indicator {
    position: absolute;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    pointer-events: none;
    z-index: 100;
    font-size: 12px;
    white-space: nowrap;

    position: absolute;
    top: 20px;
    left: 20%;
}

.limit-price-indicator.buy {
    border-left: 3px solid #26a69a;
}

.limit-price-indicator.sell {
    border-left: 3px solid #ef5350;
}

/* logo */
.logo {
    background-image:url('/static/logo.png');
    position:absolute;
    bottom:40px;
    left:10px;
    z-index:9999;
    width:60px;
    height:60px;
    background-size: cover;
    opacity:0.2;
}

/* trade log */
.trade-log {
    display:none;
    margin-top: 15px;
    padding: 10px;
    background: #333;
    border-radius: 4px;
}

.trade-log h3 {
    margin-top: 0;
    margin-bottom: 10px;
    cursor:pointer;
}

.log-entries {
    __max-height: 200px;
    ___overflow-y: auto;
}

.log-entry {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr 1.5fr 1fr;
    gap: 10px;
    padding: 8px;
    margin-bottom: 5px;
    border-radius: 4px;
    font-size: 12px;
    transition: all 0.2s ease;
}

.log-entry:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.1);
}

.log-entry.win {
    background: rgba(46, 204, 113, 0.2);
    border-left: 3px solid #2ecc71;
}

.log-entry.win:hover {
    background: rgba(46, 204, 113, 0.3);
    border-left: 3px solid #27ae60;
}

.log-entry.loss {
    background: rgba(231, 76, 60, 0.2);
    border-left: 3px solid #e74c3c;
}

.log-entry.loss:hover {
    background: rgba(231, 76, 60, 0.3);
    border-left: 3px solid #c0392b;
}

.trade-mae-mfe {
    font-size: 11px;
    opacity: 0.8;
}

.trade-mae-mfe .mae {
    color: #e74c3c;
}

.trade-mae-mfe .mfe {
    color: #2ecc71;
}

.footer a, .footer a:visited {
    color: #999;
    padding: 8px 12px;
    text-decoration: none;
}

/* report */

.thank-you-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.small-modal {
    width: 300px;
    text-align: center;
    padding: 20px;
}

.small-modal button {
    margin-top: 15px;
}

/* algo */
#algoState { display: flex; justify-content: space-around;}

/* Authentication Modal */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.auth-content {
    background: #2d2d2d;
    border-radius: 8px;
    padding: 30px;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.auth-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #444;
}

.auth-tab {
    flex: 1;
    padding: 10px;
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.auth-tab.active {
    color: #26a69a;
    border-bottom: 2px solid #26a69a;
}

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

.auth-form.hidden {
    display: none;
}

.auth-form h3 {
    margin-bottom: 20px;
    color: #fff;
    text-align: center;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #ccc;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #444;
    border-radius: 4px;
    background: #1a1a1a;
    color: #fff;
    font-size: 14px;
}

.form-group input:focus {
    outline: none;
    border-color: #26a69a;
}

.auth-btn {
    width: 100%;
    padding: 12px;
    background: #26a69a;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
}

.auth-error {
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
    display: none;
    text-align: center;
}

.auth-error.error {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    border: 1px solid #e74c3c;
}

.auth-error.success {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
    border: 1px solid #2ecc71;
}

/* User Info */
.user-info {
    display: flex;
    align-items: center;
    
}

.user-info span {
    color: #26a69a;
    font-weight: 200;
}

.logout-btn {
    padding: 5px 10px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 3px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.logout-btn:hover {
    background: #c0392b;
}

/* Demo Login */
.demo-login {
    margin-top: 20px;
    text-align: center;
}

.demo-divider {
    position: relative;
    margin: 20px 0;
    text-align: center;
}

.demo-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #444;
}

.demo-divider span {
    background: #2d2d2d;
    padding: 0 15px;
    color: #999;
    font-size: 12px;
}

.demo-btn {
    width: 100%;
    padding: 12px;
    background: #ff9800;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s ease;
    margin-bottom: 10px;
}

.demo-btn:hover {
    background: #f57c00;
}

.demo-info {
    color: #999;
    font-size: 11px;
    line-height: 1.4;
}

/* Demo Welcome Message */
.demo-welcome {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001;
}

.demo-welcome-content {
    background: #2d2d2d;
    border-radius: 8px;
    padding: 30px;
    width: 500px;
    max-width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.demo-welcome-content h3 {
    color: #ff9800;
    margin-bottom: 15px;
    font-size: 20px;
}

.demo-welcome-content p {
    color: #ccc;
    margin-bottom: 20px;
    line-height: 1.5;
}

.demo-welcome-content ul {
    text-align: left;
    color: #ccc;
    margin-bottom: 20px;
    padding-left: 20px;
}

.demo-welcome-content li {
    margin-bottom: 8px;
    line-height: 1.4;
}

.demo-welcome-close {
    padding: 10px 20px;
    background: #26a69a;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.demo-welcome-close:hover {
    background: #1e8a7a;
}

/* User Dashboard Button */
.user-dashboard-btn {
    background: #555;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 32px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* User Dashboard Modal */
.user-dashboard-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.user-dashboard-content {
    background: #2d2d2d;
    border-radius: 8px;
    width: 900px;
    height: 600px;
    max-width: 95%;
    max-height: 95%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dashboard-header {
    background: #333;
    padding: 20px;
    border-bottom: 1px solid #444;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-header h2 {
    color: #fff;
    margin: 0;
    font-size: 20px;
}

.dashboard-header h2 i {
    color: #26a69a;
    margin-right: 10px;
}

.dashboard-close {
    background: transparent;
    color: #ccc;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.dashboard-close:hover {
    background: #555;
    color: #fff;
}

.dashboard-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Update dashboard sidebar to use flexbox for bottom alignment */
.dashboard-sidebar {
    width: 250px;
    background: #333;
    border-right: 1px solid #444;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.dashboard-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.menu-item {
    padding: 15px 20px;
    color: #ccc;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 1px solid #444;
    display: flex;
    align-items: center;
    font-size: 14px;
}

.menu-item i {
    margin-right: 10px;
    width: 16px;
    text-align: center;
}

.menu-item:hover {
    background: #444;
    color: #fff;
}

.menu-item.active {
    background: #26a69a;
    color: #fff;
}

.dashboard-main {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    background: #2d2d2d;
}

.dashboard-section {
    display: none;
}

.dashboard-section.active {
    display: block;
}

.dashboard-section h3 {
    color: #fff;
    margin: 0 0 20px 0;
    font-size: 18px;
    border-bottom: 2px solid #26a69a;
    padding-bottom: 10px;
}

/* Trades Header */
.trades-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.trades-header h3 {
    margin: 0;
}

.delete-all-trades-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background-color 0.2s;
}

.delete-all-trades-btn:hover {
    background: #c82333;
}

.delete-all-trades-btn i {
    font-size: 12px;
}

/* Trades List */
.trades-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Dashboard Trade Items */

.trade-mae-mfe-row .mae {
    color: #e74c3c;
    font-weight: 500;
}

.trade-mae-mfe-row .mfe {
    color: #2ecc71;
    font-weight: 500;
}

/* Update trade item to accommodate new row */
.trade-item {
    background: #333;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    border-left: 4px solid transparent;
    transition: all 0.3s ease;
}

.trade-item.profit {
    border-left-color: #2ecc71;
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.1) 0%, rgba(46, 204, 113, 0.05) 100%);
}

.trade-item.loss {
    border-left-color: #e74c3c;
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.1) 0%, rgba(231, 76, 60, 0.05) 100%);
}

.trade-item:hover {
    /*
    background: #3a3a3a;
    
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    */
}

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

.trade-direction {
    font-weight: bold;
    font-size: 14px;
}

.trade-pnl {
    font-weight: bold;
    font-size: 16px;
}

.trade-details, .trade-mae-mfe-row, .trade-times  {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
    color: #ccc;
}



/* Trade Actions Container */
.trade-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #444;
}

.trade-action {
    flex: 1;
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.trade-action.view-trade {
    background: #26a69a;
    color: white;
}

.trade-action.view-trade:hover {
    background: #2bbbad;
    transform: translateY(-1px);
}

.trade-action.delete-trade {
    background: #e74c3c;
    color: white;
}

.trade-action.delete-trade:hover {
    background: #c0392b;
    transform: translateY(-1px);
}

/* Trades Header with Delete All Button */
.trades-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #444;
}

.trades-header h3 {
    margin: 0;
    color: #fff;
}

.delete-all-trades-btn {
    padding: 8px 16px;
    background: #c0392b;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.delete-all-trades-btn:hover {
    background: #a93226;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Loading and error states */
.loading, .error, .no-trades {
    text-align: center;
    padding: 40px;
    color: #ccc;
    font-style: italic;
}

.error {
    color: #f44336;
}

.no-trades {
    color: #999;
}

/* Settings and Account content */
.settings-content, .account-content {
    color: #ccc;
    line-height: 1.6;
}

.account-content p {
    margin-bottom: 10px;
    padding: 10px;
    background: #333;
    border-radius: 4px;
    border-left: 3px solid #26a69a;
}

/* Logout menu item styling */
.logout-menu-item {
    margin-top: auto; /* Push to bottom */
    border-top: 1px solid #444 !important;
    border-bottom: none !important;
    color: #e74c3c !important;
}

.logout-menu-item:hover {
    background: #e74c3c !important;
    color: #fff !important;
}

.logout-menu-item i {
    color: inherit;
}