/* Enhanced swing_trader.css */
body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    font-family: 'Special Elite', monospace;
    background: url('/images/mainBackground.png') no-repeat center center fixed;
    background-size: cover;
    color: #ffffff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    padding-top: 80px; /* Adjust based on your header height */
}

h1, h2, h3 {
    margin-top: 20px;
    margin-bottom: 15px;
    border-bottom: 2px solid #4CAF50;
    padding-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.dashboard-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.section-background {
    background-color: rgba(0, 0, 0, 0.7);
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.automated-mode-section {
    margin-bottom: 20px;
}

.main-controls {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

#manual-trade, #wallet-management {
    flex: 1;
    min-width: 300px;
}

.wallet-balances {
    margin-top: 20px;

}

.table-container {
    max-height: 300px;
    overflow-y: auto;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    color: #ffffff;
}

thead {
    position: sticky;
    top: 0;
    z-index: 1;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    word-wrap: break-word;
}

th {
    background-color: rgba(76, 175, 80, 0.8);
    color: white;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

tbody tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.05);
}

tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transition: background-color 0.3s ease;
}

#manualTradeForm, #walletManagementForm {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#manualTradeForm select,
#manualTradeForm input,
#manualTradeForm button,
#walletManagementForm select,
#walletManagementForm input,
#walletManagementForm button,
#toggleAutomatedMode,
#refreshBalances {
    padding: 10px;
    border: none;
    border-radius: 5px;
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    transition: background-color 0.3s, transform 0.2s;
}

#manualTradeForm select:hover,
#manualTradeForm input:hover,
#walletManagementForm select:hover,
#walletManagementForm input:hover,
#refreshBalances:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

#manualTradeForm button,
#walletManagementForm button,
#toggleAutomatedMode,
#refreshBalances {
    background-color: #4CAF50;
    cursor: pointer;
}

#manualTradeForm button:hover,
#walletManagementForm button:hover,
#toggleAutomatedMode:hover,
#refreshBalances:hover {
    background-color: #45a049;
    transform: scale(1.05);
}

#currentMode {
    font-weight: bold;
    margin-left: 10px;
}

/* --- Responsive Design --- */

/* Up to 1200px */
@media screen and (max-width: 1200px) {
    .main-controls {
        flex-direction: column;
    }
    #manual-trade,
    #wallet-management {
        width: 100%;
    }
}

/* Up to 768px */
@media screen and (max-width: 768px) {
    /* Keep background fixed or remove - your choice */
    body, html {
        background-attachment: fixed; 
    }
    .container {
        padding: 10px;
        padding-top: 60px;
        max-width: 350px;
    }
    .dashboard-container {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }
    .automated-mode-section {
        margin-bottom: 20px;
        
    }

    .trade-actions {
        margin-bottom: 160px;
    }
    

    .table-container {
        max-height: 300px;
        overflow-y: auto;
    }
    table {
        font-size: 14px;
    }

    
    th, td {
        padding: 8px;
    }
    #manual-trade, 
    #wallet-management {
        min-width: auto;
        width: 375px;
    }
    h1 {
        font-size: 1.5rem;
    }
    h2 {
        font-size: 1.25rem;
    }
    h3 {
        font-size: 1rem;
    }
}

/* Up to 480px (mobile) */
@media screen and (max-width: 480px) {
    .container {
        padding: 5px;
        padding-top: 50px;
        /* Center text-based content on very small screens */
        text-align: center;
    }
    .main-controls {
        /* For flex items, ensure they center horizontally */
        align-items: center;
        justify-content: center;
        flex-direction: column;
    }
    table {
        font-size: 12px;
    }
    th, td {
        padding: 6px;
        text-align: center; /* Center table data too */
    }
}

/* Animation for new trades */
@keyframes newTrade {
    0% {
        background-color: rgba(76, 175, 80, 0.5);
    }
    100% {
        background-color: transparent;
    }
}

.new-trade {
    animation: newTrade 2s ease-out;
}
