* {
    box-sizing: border-width;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #121212;
    color: #e0e0e0;
    overflow-x: hidden;
}

.top-bar {
    background-color: #1a1a1a;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
}

.top-bar .logo {
    font-size: 1.2rem;
    font-weight: 700;
    color: #4caf50;
}

.btn-tour {
    background-color: #1565c0;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-tour:hover { background-color: #1976d2; }

.app-container {
    display: flex;
    height: calc(100vh - 65px);
    padding: 20px;
    gap: 20px;
    background-color: #1e1e1e;
    overflow: hidden;
}

/* LEFT PANEL */
.left-panel {
    width: 340px;
    background-color: #2b2b2b;
    border-radius: 10px;
    padding: 15px;
    overflow-y: auto;
    border: 1px solid #3d3d3d;
}

.panel-header h2 {
    font-size: 1.1rem;
    color: #fff;
    margin-bottom: 5px;
}
.panel-header p {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 15px;
}

.section {
    border-top: 1px solid #444;
    padding-top: 15px;
    margin-bottom: 15px;
}
.section-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #b3b3b3;
    margin-bottom: 10px;
}

.row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.85rem;
}
.row input, .row select {
    background-color: #3d3d3d;
    border: 1px solid #555;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    width: 100px;
    text-align: right;
    font-family: inherit;
}
.row .toggle {
    width: 36px;
    height: 20px;
    background-color: #555;
    border-radius: 10px;
    position: relative;
}
.row .toggle::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background-color: #aaa;
    border-radius: 50%;
    top: 2px;
    left: 2px;
}

.actions {
    border-top: 1px solid #444;
    padding-top: 15px;
}
.row-btns {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}
button {
    cursor: pointer;
    font-family: inherit;
    border-radius: 6px;
    border: none;
    padding: 8px;
    font-size: 0.85rem;
}
.btn-primary { background-color: #1565c0; color: #fff; width: 100%; font-weight: bold; margin-bottom: 10px; padding: 12px;}
.btn-secondary { background-color: #4527a0; color: #fff; flex: 1;}
.btn-danger { background-color: #c62828; color: #fff; width: 100%; padding: 10px;}
.btn-success { background-color: #1b5e20; color: #fff; }
.btn-warning { background-color: #e65100; color: #fff; }

.progress-bar {
    height: 6px;
    background-color: #111;
    border-radius: 3px;
    margin: 15px 0 5px 0;
}
.status-text {
    font-size: 0.75rem;
    color: #888;
    text-align: center;
}

/* RIGHT PANEL */
.right-panel {
    flex: 1;
    background-color: #2b2b2b;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    border: 1px solid #3d3d3d;
}

.tabs {
    display: flex;
    background-color: #333;
    border-radius: 10px 10px 0 0;
    padding: 10px 10px 0 10px;
    flex-wrap: wrap;
}
.tab {
    padding: 10px 15px;
    font-size: 0.9rem;
    cursor: pointer;
    color: #aaa;
    border-radius: 6px 6px 0 0;
    white-space: nowrap;
}
.tab.active {
    background-color: #2b2b2b;
    color: #fff;
    font-weight: 600;
}

.tab-content {
    padding: 20px;
    flex: 1;
    display: none;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
}
.tab-content.active {
    display: flex;
}

.connection-bar {
    background-color: #333;
    padding: 15px;
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}
.connection-bar label { font-size: 0.85rem; color: #bbb;}
.mt5-select {
    flex: 1;
    background-color: #222;
    border: 1px solid #444;
    color: #fff;
    padding: 6px;
    border-radius: 4px;
}
.conn-status {
    width: 100%;
    margin-top: 10px;
    font-size: 0.8rem;
    color: #66bb6a;
}

.instances-header {
    display: flex;
    align-items: center;
}
.table-header {
    flex: 1;
    display: flex;
    font-family: monospace;
    font-size: 0.85rem;
    color: #90caf9;
    padding: 0 10px;
}
.table-header span { flex: 1; }
.table-header span:nth-child(1) { flex: 0.3; }
.table-header span:nth-child(2) { flex: 0.8; }
.table-header span:nth-child(3) { flex: 0.5; }
.table-header span:nth-child(7) { flex: 2; }

.instances-body {
    background-color: #264d26;
    border-radius: 6px;
    padding: 10px;
}
.instance-row {
    display: flex;
    align-items: center;
    font-family: monospace;
    font-size: 0.85rem;
}
.inst-info {
    flex: 1;
    display: flex;
}
.inst-info span { flex: 1; }
.inst-info span:nth-child(1) { flex: 0.3; }
.inst-info span:nth-child(2) { flex: 0.8; }
.inst-info span:nth-child(3) { flex: 0.5; }
.inst-info span:nth-child(7) { flex: 2; }
.status-running { color: #fff; }

.inst-actions {
    display: flex;
    gap: 5px;
}
.btn-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.log-panel {
    flex: 1;
    background-color: #1e1e1e;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    border: 1px solid #333;
}
.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid #333;
}
.log-header h3 { font-size: 0.9rem; color: #fff; }
.log-box {
    padding: 15px;
    font-family: monospace;
    font-size: 0.85rem;
    color: #ccc;
    white-space: pre-wrap;
    overflow-y: auto;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}
.metric-card {
    background-color: #1e1e1e;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #333;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.met-label {
    font-size: 0.8rem;
    color: #888;
}
.met-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}
.met-value.green { color: #4caf50; }
.met-value.red { color: #ef5350; }

.trade-table-wrap {
    overflow-x: auto;
    background-color: #1e1e1e;
    border-radius: 8px;
    border: 1px solid #333;
}
.trade-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.trade-table th, .trade-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #333;
}
.trade-table th {
    background-color: #252525;
    color: #aaa;
    font-weight: 500;
}
.trade-table tr:last-child td { border-bottom: none; }
.trade-table td.green { color: #4caf50; }
.trade-table td.red { color: #ef5350; }
.badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge.tp { background-color: rgba(76, 175, 80, 0.2); color: #4caf50; }
.badge.sl { background-color: rgba(239, 83, 80, 0.2); color: #ef5350; }

/* Custom IntroJS theme overrides */
.introjs-tooltip {
    background-color: #ffffff !important;
    color: #111111 !important;
    border: 1px solid #ccc !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5) !important;
}
.introjs-tooltiptext {
    color: #111111 !important;
    font-size: 0.95rem;
    line-height: 1.5;
}
.introjs-tooltip-title {
    color: #1565c0 !important;
    font-family: 'Inter', sans-serif !important;
    font-weight: 700 !important;
}
.introjs-button {
    background-color: #1565c0 !important;
    color: white !important;
    text-shadow: none !important;
    border: none !important;
}
.introjs-button:hover { background-color: #1976d2 !important; color: white !important;}
.introjs-arrow.top { border-bottom-color: #ffffff !important; }
.introjs-arrow.bottom { border-top-color: #ffffff !important; }
.introjs-arrow.left { border-right-color: #ffffff !important; }
.introjs-arrow.right { border-left-color: #ffffff !important; }
