/* Global styles */
body {
    background-color: black;
    color: white;
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
}

/* Flex container for top user data */
#totalPaymentContainer,
#tradingBalanceContainer,
#usdtPriceContainer {
    background-color: #0d6efd;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin-right: 10px;
    flex: 1;
    text-align: center;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(13, 110, 253, 0.5);
}

/* RCP Trading Wrap container styles - merged */
#rcpTradingWrap {
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: #1b1e23;
    padding: 20px;
    border-radius: 12px;
    color: #f0f0f0;
    max-width: 700px;
    margin: 0 auto;
    font-family: Arial, sans-serif;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

#rcpTradingWrap p {
    font-size: 16px;
    margin: 10px 0;
}

/* Arrange containers horizontally */
#rcpTradingWrap > .container {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

#totalPaymentContainer, #tradingBalanceContainer, #usdtPriceContainer {
    display: inline-block;
}

/* Trade amount input field */
#tradeAmount {
    padding: 10px;
    font-size: 16px;
    margin-bottom: 15px;
    width: 100%;
    text-align: center;
    border-radius: 8px;
    border: none;
    background-color: #2d3139;
    color: white;
    margin-top: 10px;
    margin-bottom: 20px;
}

/* Trade buttons */
.btn-green, .btn-red,
#upButton, #downButton {
    padding: 12px 25px;
    font-size: 16px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    margin: 10px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    color: white;
}

#upButton, .btn-green {
    background-color: #28a745;
}

#upButton:hover, .btn-green:hover {
    background-color: #218838;
    transform: scale(1.05);
}

#downButton, .btn-red {
    background-color: #dc3545;
}

#downButton:hover, .btn-red:hover {
    background-color: #c82333;
    transform: scale(1.05);
}

/* Spinner styling */
#loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 20px auto;
    text-align: center;
}

.spinner {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #007bff;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite, pulse 1.5s ease-in-out infinite;
    margin-bottom: 10px;
    opacity: 0;
    transform: scale(0.5);
    animation-fill-mode: forwards;
    animation-delay: 0.2s;
}

/* Spin animation */
@keyframes spin {
    0% { transform: rotate(0deg) scale(1); }
    100% { transform: rotate(360deg) scale(1); }
}

/* Pulse animation */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

/* Trade result display */
#tradeResult {
    margin-top: 20px;
    font-size: 18px;
    text-align: center;
    font-weight: bold;
    transition: color 0.4s ease;
}

/* Trade history box */
#tradeHistory {
    margin-top: 30px;
    background: #2b2f38;
    padding: 15px;
    border-radius: 10px;
}

#tradeHistory h3 {
    margin-bottom: 10px;
    font-size: 18px;
    color: #fff;
}

#historyList {
    list-style: none;
    padding-left: 0;
    font-size: 14px;
}

#historyList li {
    padding: 5px 0;
    border-bottom: 1px solid #444;
    color: #ccc;
}

/* Responsive layout */
@media screen and (max-width: 600px) {
    #upButton,
    #downButton,
    .btn-green,
    .btn-red {
        width: 100%;
        margin-bottom: 10px;
    }
}