body{
    margin:0;
    font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background:#0b1220;
    color:white;
}

/* ===== LAYOUT ===== */

.app{
    display:flex;
    min-height:100vh;
    flex-direction: row;
}

.sidebar{
    width:230px;
    background:#0f172a;
    padding:25px;
    border-right:1px solid #1e293b;
    flex-shrink: 0;
}

.sidebar h2{
    margin-top:0;
    color:#00ffc8;
    font-size: 24px;
}

.sidebar .menu-list {
    display: flex;
    flex-direction: column;
}

.sidebar button{
    background:none;
    color:#ccc;
    text-align:left;
    width:100%;
    padding:12px;
    margin:5px 0;
    border:0;
    cursor:pointer;
    border-radius:6px;
    font-size: 16px;
    transition: 0.3s;
}

.sidebar button:hover{
    background:#1e293b;
    color:white;
}

.main{
    flex:1;
    padding:30px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* ===== CARD ===== */

.card{
    background:#111827;
    border:1px solid #1f2937;
    border-radius:12px;
    padding:25px;
    margin-bottom:20px;
    width: 100%;
    max-width: 550px;
    box-sizing: border-box;
}

/* ===== RESPONSIVE FOR MOBILE ===== */

@media (max-width: 768px) {
    .app {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        box-sizing: border-box;
        border-right: none;
        border-bottom: 1px solid #1e293b;
        padding: 15px;
    }

    .sidebar h2 {
        text-align: center;
        margin-bottom: 15px;
    }

    .sidebar .menu-list {
        flex-direction: row;
        overflow-x: auto;
        gap: 5px;
    }

    .sidebar button {
        text-align: center;
        white-space: nowrap;
        padding: 8px 15px;
        width: auto;
        flex: 1;
    }

    .main {
        padding: 15px;
        align-items: stretch;
    }
    
    .card {
        max-width: 100%;
    }
}

/* ===== FORM ===== */

input, select{
    width:100%;
    padding:12px;
    margin:10px 0;
    border-radius:8px;
    border:1px solid #334155;
    background:#0f172a;
    color:white;
    box-sizing: border-box;
}

#pairSearch{
    width:100%;
    padding:12px;
    margin:10px 0;
    border-radius:8px;
    border:1px solid #334155;
    background:#0f172a;
    color:white;
    box-sizing:border-box;
}

button.primary{
    padding:12px 15px;
    border:none;
    border-radius:8px;
    background:linear-gradient(45deg,#00ffc8,#00b8ff);
    font-weight:bold;
    cursor:pointer;
    color:black;
    width:100%;
    margin-top: 10px;
    font-size: 16px;
}

/* สไตล์เพิ่มเติมสำหรับปุ่ม Wallet */
.wallet-btn {
    padding: 8px 12px;
    border: 1px solid #334155;
    border-radius: 6px;
    background: #1e293b;
    color: #00ffc8;
    cursor: pointer;
    font-size: 13px;
    margin-top: 10px;
    margin-right: 5px;
    transition: 0.3s;
}

.wallet-btn:hover {
    background: #334155;
    border-color: #00ffc8;
}

.success{ color:#00ff88; }
.error{ color:#ff4d4d; }

.hidden{ display:none !important; }

pre{
    background:#000;
    padding:15px;
    border-radius:8px;
    overflow:auto;
    font-size: 13px;
    color: #00ffc8;
}

label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
    cursor: pointer;
    font-size: 14px;
}

input[type="checkbox"] {
    width: auto;
}

/* ===== TABLE & ACTIONS ===== */

.table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 10px;
}

#botTable {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px; 
}

#botTable td, #botTable th {
    padding: 12px 10px;
    text-align: left;
    border-top: 1px solid #1f2937;
    white-space: nowrap; 
}
#dealHistoryTable{
    width:100%;
    border-collapse:collapse;
}

#dealHistoryTable td,
#dealHistoryTable th{
    padding:10px;
    border-top:1px solid #1f2937;
}

.status-running{ color:#22c55e; font-weight:bold; }
.status-stopped{ color:#9ca3af; }
.status-error{ color:#ef4444; font-weight:bold; }

.action-btn{
    padding: 6px 12px;
    border:none;
    border-radius:6px;
    cursor:pointer;
    font-size:12px;
    font-weight: bold;
    margin-right:4px;
}

.start-btn{ background:#22c55e; color:black; }
.stop-btn{ background:#f59e0b; color:black; }
.delete-btn{ background:#ef4444; color:white; }
.btn-cancel{ background:#6b7280; color:white; }

/* ===== FLOATING CREATE SECTION (NEW) ===== */

.floating-create-section {
    position: absolute;
    top: 50px;
    left: 250px;
    z-index: 10000;
    background: #111827 !important;
    padding: 20px;
    border: 2px solid #00ffc8;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    display: block !important;
}

@media (max-width: 768px) {
    .floating-create-section {
        left: 10px;
        right: 10px;
        top: 10px;
        width: auto;
        position: relative; /* ปรับเป็น relative บนมือถือเพื่อให้เลื่อนตามหน้าจอได้ */
    }
}

/* ===== MODAL STYLE ===== */

.modal-overlay{
    position:fixed;
    top:0;
    left:0;
    width:100%;
    height:100%;
    background:rgba(0,0,0,0.7);
    display:flex;
    align-items:center;
    justify-content:center;
    z-index: 999;
}

.modal-box{
    background:#111827;
    padding:25px;
    border-radius:12px;
    width:400px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid #1f2937;
}

.text-right{
    text-align:right;
}

/* ===== SUMMARY TABLE (ADD HERE) ===== */

#summaryTable {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

#summaryTable th {
    text-align: left;
    padding: 10px;
    color: #94a3b8;
    font-size: 13px;
}

#summaryTable td {
    padding: 10px;
    border-top: 1px solid #1e293b;
}

#summaryTable tr:hover {
    background: #0f172a;
}