:root {
    --bg-dark: #1e222d;
    --bg-darker: #131722;
    --text-color: #d1d4dc;
    --border-color: #2a2e39;
    --header-height: 48px;
    --footer-height: 40px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-darker);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    max-width: 100vw;
}

.header {
    background-color: var(--bg-dark);
    height: var(--header-height);
    border-bottom: 1px solid var(--border-color);
    padding: 0 20px;
}

.header-content {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.portfolio-balance {
    color: var(--text-color);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.portfolio-label {
    color: #787b86;
}

.portfolio-value {
    color: var(--text-color);
    font-weight: 500;
    cursor: pointer;
}

.portfolio-asset {
    color: var(--text-color);
}

.logout-button {
    color: var(--text-color);
    text-decoration: none;
    font-size: 14px;
    padding: 8px 24px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.logout-button:hover {
    background-color: rgba(42, 46, 57, 0.3);
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-text {
    font-size: 29px;
    font-weight: bold;
}

.strategy-text {
    color: #787b86;
    margin-top:1px;
    margin-left: 28px;
    display: flex;
    align-items: center;
    font-size: 16px;
    cursor: pointer;
}

.strategy-text::before {
    content: '';
    /*width: 16px;*/
    height: 16px;
    /*background-color: #f7525f;
    margin-right: 5px;*/
    border-radius: 2px;
}

.main-container {
    flex: 1;
    padding: 8px;
    background-color: var(--bg-darker);
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-width: 100%;
}

.chart-container {
    height: calc(100vh - var(--header-height) - var(--footer-height) - 140px) !important;
    min-height: 400px;
    border-bottom: 3px solid var(--border-color);
    margin-bottom: 9px;
}

.chart-placeholder {
    flex: 1;
    border: 1px solid var(--border-color);
    background-color: var(--bg-darker);
    max-width: 100%;
    position: relative;
    min-height: 0;
    height: calc(100vh - var(--header-height) - var(--footer-height) - 16px);
}

/* Chart button styles */
.timeframe-button {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    min-width: 32px;
    transition: all 0.2s ease;
    user-select: none;
}

.timeframe-button:hover {
    background-color: rgba(42, 46, 57, 0.5);
}

.timeframe-button.active {
    background-color: var(--border-color);
}

.timeframe-button:active {
    transform: scale(0.95);
}

/* Hide chart container's default center text since we now have the actual chart */
.chart-placeholder::before {
    display: none;
}

.footer {
    height: var(--footer-height);
    background-color: var(--bg-dark);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 16px;
}

.timeline-controls {
    display: flex;
    gap: 8px;
}

.timeline-button {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
}

.timeline-button:hover {
    background-color: var(--border-color);
}

/* Home page */
.intro {
    font-family: BlinkMacSystemFont, Arial, sans-serif, Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', Segoe UI;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px 20px 20px 20px;
}
.intro-one {
    text-align: center;
}

/* Login page styles */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 40px;
    z-index: 1000;
}

.logo-container .logo {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;  /* Align items to the left */
}

.logo-container .logo-text {
    font-size: 35px;
    font-weight: bold;
    color: var(--text-color);
}
.logo-container .subtitle {
    /*color: #787b86;*/
    font-size: 17px;
    margin-left: 2px;
}
.logo-text .caps {
    font-size: 34px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sign-in,
.sign-up {
    color: var(--text-color);
    text-decoration: none;
    font-size: 14px;
    padding: 8px 24px;
    border-radius: 4px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.sign-in {
    background-color: rgba(42, 46, 57, 0.5);
}

.sign-in:hover {
    background-color: rgba(42, 46, 57, 0.8);
}

.sign-up {
    border: 1px solid var(--border-color);
}

.sign-up:hover {
    background-color: rgba(42, 46, 57, 0.3);
}

.language-selector {
    color: var(--text-color);
    font-size: 14px;
    cursor: pointer;
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.language-selector:hover {
    background-color: rgba(42, 46, 57, 0.3);
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 120px 20px 20px 20px;
}

.login-box {
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 32px;
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    color: var(--text-color);
    font-size: 24px;
    margin-bottom: 24px;
    text-align: center;
}

.form-group {
    margin-bottom: 16px;
}

.form-group input {
    width: 100%;
    padding: 12px;
    background-color: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-color);
    font-size: 14px;
}

/* reCAPTCHA styling */
.recaptcha-container {
    display: flex;
    justify-content: center;
    width: 100%;
    overflow: hidden;
    border-radius: 5px;
}
.g-recaptcha {
    transform: scale(1.10);
    transform-origin: center;
    /*margin: 0 auto;*/
    margin-left: 3px;
}
.rc-anchor-checkbox {
    margin: 2px 12px 2px 14px !important;
}  
.recaptcha-checkbox-border {
    height: 20px !important;
    width: 20px !important;
}      
@media screen and (max-width: 400px) {
    .g-recaptcha {
        transform: scale(0.9);
    }
}

.form-group input:focus {
    outline: none;
    border-color: #3a3f4c;
}

.forgot-password {
    color: var(--text-color);
    text-decoration: none;
    font-size: 14px;
    opacity: 0.8;
}

.forgot-password:hover {
    opacity: 1;
}

.sign-in-button {
    width: 100%;
    padding: 12px;
    background-color: #26a69a;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

.sign-in-button:hover {
    background-color: #2bbbad;
}

.error-message {
    color: #ef5350;
    font-size: 14px;
    margin-top: 16px;
    text-align: center;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    width: 90%;
    max-width: 400px;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 24px;
    color: var(--text-color);
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.close-modal:hover {
    opacity: 1;
}

.modal-content p {
    color: var(--text-color);
    margin: 16px 0 24px 0;
    line-height: 1.5;
    font-size: 14px;
}

.modal-button {
    float: right;
    padding: 8px 24px;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-color);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.modal-button:hover {
    background-color: rgba(42, 46, 57, 0.3);
}

/* Portfolio modal styles */
.portfolio-modal {
    position: fixed;
    inset: 0;
    background-color: rgba(19, 23, 34, 0.85);
    display: none;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 24px;
    z-index: 2500;
}

.portfolio-modal.visible {
    display: flex;
}

.portfolio-modal-content {
    background: #1e222d;
    border: 1px solid #2a2e39;
    border-radius: 12px;
    width: min(1100px, 100%);
    min-height: 560px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
}

.portfolio-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid #2a2e39;
    background: #1b1f29;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.portfolio-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #b2b5be;
}

.portfolio-modal-close {
    background: none;
    border: none;
    color: #787b86;
    font-size: 22px;
    cursor: pointer;
    padding: 4px 8px;
}

.portfolio-modal-close:hover {
    color: #b2b5be;
}

.portfolio-modal-body {
    padding: 18px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.portfolio-modal-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    flex-wrap: wrap;
}

.portfolio-modal-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 260px;
}

.portfolio-modal-field label {
    color: #787b86;
    font-size: 12px;
}

.portfolio-modal-field-right {
    align-items: flex-end;
}

.portfolio-select-wrapper {
    background: #1b1f29;
    border: 1px solid #2a2e39;
    border-radius: 6px;
    padding: 4px 8px;
    width: 220px;
}

.portfolio-select {
    width: 100%;
    background: transparent;
    border: none;
    color: #d1d4dc;
    font-size: 13px;
}

.portfolio-select:focus {
    outline: none;
}

.portfolio-estimated-value {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #d1d4dc;
    font-size: 14px;
    font-weight: 600;
}

.portfolio-estimated-asset {
    color: #787b86;
    font-size: 12px;
}

.portfolio-table-wrapper {
    border: 1px solid #2a2e39;
    border-radius: 8px;
    overflow: hidden;
    background: #1b1f29;
}

.portfolio-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    color: #b2b5be;
}

.portfolio-table thead th {
    background: #242833;
    color: #787b86;
    text-align: left;
    padding: 10px 16px;
    font-weight: 500;
    border-bottom: 1px solid #2a2e39;
}

.portfolio-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid #2a2e39;
    color: #d1d4dc;
    font-weight: 500;
}

.portfolio-table tbody tr:last-child td {
    border-bottom: none;
}

.portfolio-table tbody td:first-child {
    font-weight: 600;
}

/* Hamburger menu styles */
.menu-toggle {
    display: none;
    cursor: pointer;
    width: 30px;
    height: 24px;
    position: relative;
    z-index: 1001;
}

.hamburger {
    position: absolute;
    width: 100%;
    height: 2px;
    background-color: var(--text-color);
    top: 50%;
    transform: translateY(-50%);
    transition: background-color 0.3s;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background-color: var(--text-color);
    transition: transform 0.3s;
}

.hamburger::before {
    top: -8px;
}

.hamburger::after {
    bottom: -8px;
}

.menu-toggle.active .hamburger {
    background-color: transparent;
}

.menu-toggle.active .hamburger::before {
    transform: translateY(8px) rotate(45deg);
}

.menu-toggle.active .hamburger::after {
    transform: translateY(-8px) rotate(-45deg);
}

/* Strategy Configuration Popup Styles */
.strategy-config {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #1e222d;
    border: 1px solid #363c4e;
    border-radius: 4px;
    width: 600px;
    height: 500px;
    color: #b2b5be;
    font-size: 12px;
    z-index: 1000;
    display: none;
}

.strategy-config.visible {
    display: block;
}

.strategy-config-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 14px;
    border-bottom: 1px solid #363c4e;
    background: #2a2e39;
    cursor: move;
}

.strategy-config-title {
    font-size: 14px;
    font-weight: 500;
    color: #b2b5be;
}

.strategy-config-close {
    background: none;
    border: none;
    color: #787b86;
    cursor: pointer;
    font-size: 24px;
    padding: 4px;
}

.strategy-config-close:hover {
    color: #b2b5be;
}

.strategy-config-main {
    padding: 12px;
}

.strategy-config-fields {
    display: flex;
    gap: 16px;
    justify-content: space-between;
}

.strategy-config-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.strategy-config-field label {
    color: #787b86;
}

.strategy-config-field input {
    background: #2a2e39;
    border: 1px solid #363c4e;
    border-radius: 4px;
    color: #b2b5be;
    padding: 4px 8px;
    width: 100%;
    font-size: 14px;
}

.strategy-config-field input[readonly] {
    background: #1e222d;
    border-color: #2a2e39;
}
.balance-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.portfolio {
    color: #787b86;
    font-size: 12px;
    margin-top: 4px;
}

.strategy-config-tabs {
    display: flex;
    border-bottom: 1px solid #363c4e;
}

.strategy-config-tab {
    padding: 8px 16px;
    cursor: pointer;
    color: #787b86;
    border-bottom: 2px solid transparent;
}

.strategy-config-tab.active {
    color: #b2b5be;
    border-bottom-color: #2962ff;
}

.strategy-config-content {
    padding: 12px 14px;
    height: calc(100% - 180px); /* Account for header, tabs, and footer */
    overflow-y: auto;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.grid-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    justify-content: space-between;
}

.grid-section {
    flex: 1;
}

.grid-section-title {
    color: #787b86;
    margin-bottom: 8px;
}

.grid-section-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.grid-section input {
    background: #2a2e39;
    border: 1px solid #363c4e;
    border-radius: 4px;
    color: #b2b5be;
    padding: 4px 8px;
    width: 100px;
    font-size: 14px;
}

.grid-section input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

.grid-count-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

#grid-gap-percentage{
    display: block; text-align: center; margin-bottom: 4px; color: #b2b5be; font-size: 12px;
}

.input-error {
    border: 1px solid red !important;
    background-color: #ffe5e5 !important;
}

/* Strategy config error message */
.strategy-config #error-message {
    color: #ffe5e5;
    font-size: 12px;
    font-weight: normal;
    margin-top: 4px;
    display: block;
    min-height: 16px; /* Prevent layout shift */
    padding-right: 5px;
    white-space: pre-line; /* Preserve newlines */
}

.grid-count-controls button {
    background: #2a2e39;
    border: none;
    color: #b2b5be;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.grid-count-controls button:hover {
    background: #363c4e;
}

.strategy-config-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 14px;
    border-top: 1px solid #363c4e;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    background: #1e222d;
}

.footer-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.footer-field label {
    color: #787b86;
}

.auto-restart-select {
    background: #2a2e39;
    border: 1px solid #363c4e;
    border-radius: 4px;
    color: #b2b5be;
    padding: 4px 8px;
    width: 150px;
}

.create-button {
    background: #4CAF50; 
    border: none;
    border-radius: 4px;
    color: white;
    padding: 6px 16px;
    cursor: pointer;
}

.create-button:hover {
    background: #6fae68;
}

/* Fibo Strategy Config dialog styles */
.fibo-strategy-config {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #1e222d;
    border: 1px solid #363c4e;
    border-radius: 4px;
    width: 800px;
    height: 600px;
    color: #b2b5be;
    font-size: 12px;
    z-index: 1000;
    display: none;
}

.fibo-strategy-config.visible {
    display: block;
}

.fibo-strategy-config-close {
    background: none;
    border: none;
    color: #787b86;
    cursor: pointer;
    font-size: 24px;
    padding: 4px;
}

.fibo-strategy-config-close:hover {
    color: #b2b5be;
}

.fibo-levels-content {
    padding: 12px 14px;
    height: calc(100% - 140px); /* Account for header and footer */
    overflow-y: auto;
}

/* Column Headers */
.fibo-headers-row {
    display: grid;
    grid-template-columns: 80px 100px 100px 100px 1fr;
    gap: 8px;
    margin-bottom: 12px;
    padding: 4px 0;
    border-bottom: 1px solid #363c4e;
}

.fibo-header-level,
.fibo-header-buy,
.fibo-header-fibo,
.fibo-header-sell {
    color: #787b86;
    font-size: 11px;
    font-weight: 500;
    text-align: left;
}

.fibo-header-fibo {
    text-align: center;
}

.fibo-header-spacer {
    /* Empty spacer for extra column */
}

/* Data Rows */
.fibo-level-row {
    display: grid;
    grid-template-columns: 80px 100px 100px 100px 1fr;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
    padding: 4px 0;
}

.fibo-col-level {
    color: #b2b5be;
    font-size: 12px;
    font-weight: 500;
    text-align: left;
}

.fibo-col-buy,
.fibo-col-sell {
    display: flex;
    align-items: center;
}

.fibo-col-fibo {
    display: flex;
    justify-content: center;
}

.fibo-col-extra {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Input Styling */
.fibo-buy-input,
.fibo-sell-input,
.fibo-col-fibo input {
    background: #2a2e39;
    border: 1px solid #363c4e;
    border-radius: 4px;
    color: #b2b5be;
    padding: 4px 8px;
    font-size: 12px;
    width: 100%;
}

.fibo-buy-input {
    color: #4CAF50;
}

.fibo-sell-input {
    color: #FF5252;
}

.fibo-col-fibo input {
    background: #1e222d;
    border-color: #2a2e39;
    text-align: center;
}

.fibo-vol-input {
    background: #2a2e39;
    border: 1px solid #363c4e;
    border-radius: 4px;
    color: #b2b5be;
    padding: 4px 8px;
    font-size: 12px;
    width: 50px;
}

/* Level column with checkbox */
.level-text {
    color: #b2b5be;
    font-size: 12px;
    font-weight: 500;
    margin-right: 6px;
}

.fibo-level-checkbox {
    width: 14px;
    height: 12px;
    accent-color: #4CAF50;
    cursor: pointer;
}

/* Toggle Switch Labels */
.toggle-label-left,
.toggle-label-right {
    color: #787b86;
    font-size: 12px;
    font-weight: 500;
    transition: color 0.2s ease;
}

/* Toggle Switch Slider */
.toggle-slider {
    position: relative;
    width: 40px;
    height: 20px;
    cursor: pointer;
    margin-left: 4px;
    float: right;
}

.toggle-slider-track {
    width: 100%;
    height: 100%;
    background-color: #363c4e;
    border-radius: 10px;
    border: 1px solid #4a4e5a;
    transition: background-color 0.2s ease;
}

.toggle-slider-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background-color: #b2b5be;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Default state: 0.786 is active (left side) */
.toggle-label-left {
    color: #b2b5be;
}

.toggle-label-right {
    color: #787b86;
}

/* Toggled state: 0.702 is active (right side) */
.toggle-slider.toggled .toggle-slider-thumb {
    transform: translateX(20px);
}

.toggle-slider.toggled ~ .fibo-col-buy .toggle-label-right {
    color: #b2b5be;
}

.fibo-level-row:has(.toggle-slider.toggled) .toggle-label-left {
    color: #787b86;
}

.fibo-level-row:has(.toggle-slider.toggled) .toggle-label-right {
    color: #b2b5be;
}

.fibo-level-row:has(.toggle-slider:not(.toggled)) .toggle-label-left {
    color: #b2b5be;
}

.fibo-level-row:has(.toggle-slider:not(.toggled)) .toggle-label-right {
    color: #787b86;
}

/* Extra Column Elements */
.fibo-percentage {
    color: #787b86;
    font-size: 11px;
    width: 40px;
    text-align: center;
}

.fibo-percent-symbol {
    color: #787b86;
    font-size: 11px;
}

.fibo-quoteAsset {
    color: #787b86;
    font-size: 11px;
}

.fibo-portfolio-value,
.fibo-portfolio-asset {
    color: #b2b5be;
}

/* Fibo strategy error message */
.fibo-strategy-config #fibo-error-message {
    color: #ffe5e5;
    font-size: 12px;
    font-weight: normal;
    margin-top: 4px;
    display: block;
    min-height: 16px; /* Prevent layout shift */
    padding-right: 5px;
    white-space: pre-line; /* Preserve newlines */
}

/* Responsive adjustments */
@media (min-width: 769px) {
    .nav-menu {
        display: flex !important;  /* Always show menu on desktop */
        position: static;
        width: auto;
        height: auto;
        padding: 0;
        background: none;
        border: none;
    }
}

@media (max-width: 768px) {
    body {
        overflow-y: auto;
    }

    .menu-toggle {
        display: block;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -250px;
        width: 250px;
        height: 100vh;
        background-color: var(--bg-dark);
        padding: 80px 20px 20px;
        transition: right 0.3s;
        flex-direction: column;
        gap: 16px;
        border-left: 1px solid var(--border-color);
        display: flex;
    }

    .nav-menu.active {
        right: 0;
    }

    .top-nav {
        padding: 20px;
    }

    .login-container {
        min-height: calc(100vh - var(--header-height));
        /*padding: 80px 20px 20px;*/
        align-items: flex-start;
    }

    .login-box {
        margin-top: 20px;
        padding: 24px;
    }

    /* Do not remove */
    .logo-container .logo-text {
        font-size: 32px;
    }
    .footer {
        display: none;
    }

    /* Adjust mobile menu items */
    .nav-menu .sign-in,
    .nav-menu .sign-up,
    .nav-menu .language-selector {
        width: 100%;
        text-align: center;
    }
}

/* Landscape mode adjustments */
@media (max-height: 600px) and (orientation: landscape) {
    body {
        overflow-y: auto;
        height: auto;
        min-height: 100vh;
    }

    .login-container {
        padding: 100px 20px 40px;
        min-height: 100vh;
        height: auto;
    }

    .login-box {
        margin: 0 auto;
    }

    .top-nav {
        background-color: var(--bg-darker);
        padding: 20px;
    }
}

/* Bots and Orders Regions */
.bots-region,
.orders-region {
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    margin: 9px;
    margin-top: 0;
    min-height: 220px;
    max-height: 296px;
    display: flex;
    flex-direction: column;
}

.bots-table-container,
.orders-table-container {
    overflow-x: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.bots-table,
.orders-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    color: var(--text-color);
}

.bots-table th,
.orders-table th {
    background-color: var(--bg-darker);
    color: #787b86;
    padding: 8px 12px;
    text-align: left;
    font-weight: normal;
    border-bottom: 1px solid var(--border-color);
    font-size: 12px;
}

.bots-table td,
.orders-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
    font-size: 12px;
}

.bots-table tbody tr:hover,
.orders-table tbody tr:hover {
    background-color: rgba(42, 46, 57, 0.3);
}

.bots-table tbody tr.selected {
    background-color: rgba(41, 98, 255, 0.2);
}

/* Fixed header table styling */
.bots-table-header {
    flex-shrink: 0;
}

.bots-table-header thead tr th {
    border-bottom: 1px solid var(--border-color);
}

/* Scrollable body container */
.bots-table-scrollable-body {
    flex: 1;
    overflow-y: auto;
    max-height: 190px;
}

/* Body table styling */
.bots-table-body {
    margin-top: 0;
}

.bots-table-body tbody tr:first-child td {
    border-top: none;
}

/* Ensure column widths match between header and body tables */
.bots-table-header th:nth-child(1),
.bots-table-body td:nth-child(1) { width: 8%; }

.bots-table-header th:nth-child(2),
.bots-table-body td:nth-child(2) { width: 6%; }

.bots-table-header th:nth-child(3),
.bots-table-body td:nth-child(3) { width: 8%; }

.bots-table-header th:nth-child(4),
.bots-table-body td:nth-child(4) { width: 20%; }

.bots-table-header th:nth-child(5),
.bots-table-body td:nth-child(5) { width: 8%; }

.bots-table-header th:nth-child(6),
.bots-table-body td:nth-child(6) { width: 12%; }

.bots-table-header th:nth-child(7),
.bots-table-body td:nth-child(7) { width: 8%; }

.bots-table-header th:nth-child(8),
.bots-table-body td:nth-child(8) { width: 8%; }

.bots-table-header th:nth-child(9),
.bots-table-body td:nth-child(9) { width: 10%; }

.bots-table-header th:nth-child(10),
.bots-table-body td:nth-child(10) { width: 12%; }

.bots-table-header th:nth-child(11),
.bots-table-body td:nth-child(11) { width: 6%; }

.bots-table-header th:nth-child(12),
.bots-table-body td:nth-child(12) { width: 4%; }

.orders-table-header th:nth-child(12),
.orders-table-body td:nth-child(12) { width: 2%; }

.orders-table-header th:nth-child(13),
.orders-table-body td:nth-child(13) { width: 4%; }

/* Status switch styling */
.status-switch {
    position: relative;
    width: 40px;
    height: 20px;
    cursor: pointer;
}

.status-switch-track {
    width: 100%;
    height: 100%;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

.status-switch-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Status colors */
.status-switch.active .status-switch-track {
    background-color: #4CAF50;
}

.status-switch.active .status-switch-thumb {
    background-color: white;
    transform: translateX(20px);
}

.status-switch.on-hold .status-switch-track {
    background-color: #FFC107;
}

.status-switch.on-hold .status-switch-thumb {
    background-color: white;
    transform: translateX(20px);
}

.status-switch.inactive .status-switch-track {
    background-color: #f44336;
}

.status-switch.inactive .status-switch-thumb {
    background-color: white;
}

/* Settings icons */
.settings-icon {
    color: #787b86;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
}
.settings-icon:hover {
    color: var(--text-color);
}

/* Orders tabs */
.orders-tabs {
    display: flex;
    background-color: var(--bg-darker);
    border-bottom: 1px solid var(--border-color);
    align-items: center;
}

.orders-tab {
    padding: 8px 16px;
    cursor: pointer;
    color: #787b86;
    font-size: 12px;
    border-bottom: 2px solid transparent;
    display: flex;
    align-items: center;
    gap: 4px;
}

.orders-tab.active {
    color: var(--text-color);
    border-bottom-color: #2962ff;
}

.orders-tab:hover:not(.active) {
    color: var(--text-color);
}

.tab-count,
.tab-count-history {
    background-color: #2962ff;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 10px;
    min-width: 16px;
    text-align: center;
}

/* Orders refresh button */
.orders-refresh {
    margin-left: auto;
    margin-right: 1%;
    display: flex;
    align-items: center;
    gap: 6px;
    /*padding: 8px 12px;*/
    padding: 8px 20px;
    cursor: pointer;
    color: #787b86;
    font-size: 12px;
    border-radius: 4px;
    transition: all 0.2s ease;
    user-select: none;
}

.orders-refresh:hover {
    color: var(--text-color);
    background-color: rgba(42, 46, 57, 0.3);
}

.orders-refresh.syncing {
    color: #2962ff;
}

.orders-refresh.syncing .refresh-icon {
    animation: spin 1s linear infinite;
}

.refresh-icon {
    font-size: 16px;
    transition: transform 0.2s ease;
}

.refresh-label {
    font-weight: 500;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.orders-tab-content {
    display: none;
}

.orders-tab-content.active {
    display: block;
}

.tab-placeholder {
    padding: 20px;
    text-align: center;
    color: #787b86;
    font-size: 12px;
}

/* Order type colors */
.order-type-buy {
    color: #4CAF50;
}

.order-type-sell {
    color: #f44336;
}

/* Settings icon */
.order-settings-icon {
    color: #787b86;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
}
.order-settings-icon:hover {
    color: var(--text-color);
}

/* Cancel icon */
.cancel-icon {
    color: #787b86;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
}

.cancel-icon:hover {
    color: #f44336;
}

/* Status Filter Styles */
.status-filter-container {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
    margin-right: 20px;
}

.status-filter-btn {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    position: relative;
}

.status-filter-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

/* Status filter colors */
.status-filter-btn.status-active {
    background-color: #4CAF50;
    border-color: #4CAF50;
}

.status-filter-btn.status-on-hold {
    background-color: #FFC107;
    border-color: #FFC107;
}

.status-filter-btn.status-completed {
    background-color: #f44336;
    border-color: #f44336;
}

/* Selected state */
.status-filter-btn.selected {
    border-color: #ffffff;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
}

.status-filter-btn.selected::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
}

/* Filter Bar Styles */
.bots-filter-bar {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 8px 12px;
    background-color: var(--bg-darker);
    border-bottom: 1px solid var(--border-color);
    font-size: 12px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-group label {
    color: #787b86;
    font-size: 12px;
    white-space: nowrap;
}

.filter-select {
    background: #2a2e39;
    border: 1px solid #363c4e;
    border-radius: 4px;
    color: #b2b5be;
    padding: 4px 8px;
    font-size: 11px;
    min-width: 80px;
}

.filter-select:focus {
    outline: none;
    border-color: #4a4e5a;
}

.filter-date {
    background: #2a2e39;
    border: 1px solid #363c4e;
    border-radius: 4px;
    color: #b2b5be;
    padding: 4px 8px;
    font-size: 11px;
    width: 120px;
}

.filter-date:focus {
    outline: none;
    border-color: #4a4e5a;
}

/* Date input styling for dark theme */
.filter-date::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

.date-reset-btn {
    background: none;
    border: none;
    color: #787b86;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    margin-left: 4px;
    border-radius: 3px;
    transition: all 0.2s ease;
    line-height: 1;
}

.date-reset-btn:hover {
    color: #b2b5be;
    background-color: rgba(42, 46, 57, 0.3);
}

.date-reset-btn:active {
    transform: scale(0.95);
}

/* Total Row Footer Styles */
.bots-table-footer {
    flex-shrink: 0;
    border-top: 1px solid var(--border-color);
}

.total-row {
    background-color: rgba(42, 46, 57, 0.5);
    font-weight: bold;
}

.total-row td {
    padding: 6px 40px;
    font-size: 12px;
    color: var(--text-color);
    border-bottom: none;
}

/* Ensure footer table column widths match header and body */
.bots-table-footer td:nth-child(1) { width: 8%; }
.bots-table-footer td:nth-child(2) { width: 6%; }
.bots-table-footer td:nth-child(3) { width: 8%; }
.bots-table-footer td:nth-child(4) { width: 20%; }
.bots-table-footer td:nth-child(5) { width: 8%; }
.bots-table-footer td:nth-child(6) { width: 12%; }
.bots-table-footer td:nth-child(7) { width: 8%; }
.bots-table-footer td:nth-child(8) { width: 8%; }
.bots-table-footer td:nth-child(9) { width: 10%; }
.bots-table-footer td:nth-child(10) { width: 12%; }
.bots-table-footer td:nth-child(11) { width: 6%; }
.bots-table-footer td:nth-child(12) { width: 4%; }

/* Responsive adjustments for regions */
@media (max-width: 768px) {
    .bots-table,
    .orders-table {
        font-size: 11px;
    }
    
    .bots-table th,
    .orders-table th,
    .bots-table td,
    .orders-table td {
        padding: 6px 8px;
    }
    
    .status-filter-btn {
        width: 14px;
        height: 14px;
    }
    
    .status-filter-container {
        gap: 4px;
    }
    
    .bots-filter-bar {
        flex-wrap: wrap;
        gap: 12px;
        padding: 6px 8px;
    }
    
    .filter-date {
        width: 100px;
    }
}

/* Trade filter checkbox styling */
.trade-filter-container {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    margin-left: 8px;
    font-size: 12px;
}

.trade-filter-container input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: #2962ff;
    cursor: pointer;
}

.trade-filter-container label {
    color: #787b86;
    cursor: pointer;
    user-select: none;
    font-size: 11px;
}

.trade-filter-container:hover label {
    color: var(--text-color);
}
