/* trading-widget.css */
.trading-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: rgba(26, 26, 26, 0.95);
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.button-container {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    justify-content: center;
}

.trade-button {
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

#buyButton {
    background: linear-gradient(135deg, #00C853, #00E676);
}

#buyButton:hover {
    background: linear-gradient(135deg, #00E676, #00C853);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 200, 83, 0.3);
}

#sellButton {
    background: linear-gradient(135deg, #FF1744, #D50000);
}

#sellButton:hover {
    background: linear-gradient(135deg, #D50000, #FF1744);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(213, 0, 0, 0.3);
}

.trade-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Balance Container */
.balance-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(42, 42, 42, 0.8);
    border-radius: 10px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

#demoBalance {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

#refillButton {
    padding: 8px 16px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

#refillButton:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

/* Trade Form */
.trade-form {
    background: rgba(42, 42, 42, 0.8);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    color: #fff;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid rgba(58, 58, 58, 0.8);
    border-radius: 8px;
    background: rgba(51, 51, 51, 0.8);
    color: #fff;
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

/* Trade Timer and Counter */
.trade-timers,
#tradeCounter {
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(42, 42, 42, 0.8);
    border-radius: 8px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Trade History */
.trade-history-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background: rgba(26, 26, 26, 0.95);
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.trade-history-container h3 {
    color: #fff;
    margin-bottom: 20px;
    font-size: 24px;
}

.trade-history-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.trade-history-item {
    display: flex;
    padding: 15px;
    background: rgba(42, 42, 42, 0.8);
    border-radius: 10px;
    align-items: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.trade-amount {
    font-size: 18px;
    font-weight: 600;
    min-width: 120px;
    text-align: left;
}

.trade-amount.profit {
    color: #00E676;
}

.trade-amount.loss {
    color: #FF1744;
}

.trade-details {
    flex-grow: 1;
    margin-left: 20px;
}

.trade-id {
    color: rgba(136, 136, 136, 0.9);
    font-size: 14px;
    margin-bottom: 5px;
}

.trade-type {
    color: #fff;
    font-weight: 500;
    margin-bottom: 5px;
}

.trade-date {
    color: rgba(136, 136, 136, 0.9);
    font-size: 14px;
}

/* Alert System */
.alert-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}


.alert {
    background: rgba(42, 42, 42, 0.95);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 10px;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    position: fixed; /* Changed from relative */
    bottom: 20px; /* Added */
    right: 20px; /* Added */
    overflow: hidden;
    max-width: 400px;
    z-index: 1000;
}

.alert.profit {
    background: linear-gradient(135deg, rgba(0, 150, 63, 0.95), rgba(0, 180, 98, 0.95)); /* Darker green */
}

.alert.loss {
    background: linear-gradient(135deg, rgba(200, 23, 68, 0.95), rgba(170, 0, 0, 0.95)); /* Darker red */
}

.alert-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.alert-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.alert-amount {
    font-size: 24px;
    font-weight: 700;
    margin: 4px 0;
}

.alert-message {
    font-size: 14px;
    opacity: 0.9;
}

.close-alert {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.close-alert:hover {
    opacity: 1;
}

.no-trades {
    color: rgba(136, 136, 136, 0.9);
    text-align: center;
    padding: 20px;
    background: rgba(42, 42, 42, 0.8);
    border-radius: 8px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Animations */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* TradingView Widget Container */
#tradingview_f933e {
    background: transparent !important;
}


.submit-trade,
.cancel-trade {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: white;
}

.submit-trade {
    background: linear-gradient(135deg, #00C853, #00E676);
    box-shadow: 0 4px 6px rgba(0, 200, 83, 0.2);
}

.submit-trade:hover {
    background: linear-gradient(135deg, #00E676, #00C853);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 200, 83, 0.3);
}

.cancel-trade {
    background: linear-gradient(135deg, #FF1744, #D50000);
    box-shadow: 0 4px 6px rgba(213, 0, 0, 0.2);
}

.cancel-trade:hover {
    background: linear-gradient(135deg, #D50000, #FF1744);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(213, 0, 0, 0.3);
}

.trade-pnl {
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    margin: 20px 0;
    padding: 10px;
    background: rgba(42, 42, 42, 0.8);
    border-radius: 8px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: color 0.3s ease;
}

.trade-pnl.profit {
    color: #00E676;
    animation: profitPulse 2s infinite;
}

.trade-pnl.loss {
    color: #FF1744;
    animation: lossPulse 2s infinite;
}

@keyframes profitPulse {
    0% { color: #00E676; }
    50% { color: #00C853; }
    100% { color: #00E676; }
}

@keyframes lossPulse {
    0% { color: #FF1744; }
    50% { color: #D50000; }
    100% { color: #FF1744; }
}


.form-buttons {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    margin-top: 20px;
}


.trade-history-pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    padding: 15px;
    background: rgba(42, 42, 42, 0.8);
    border-radius: 10px;
}



.page-number {
    padding: 8px 16px;
    background: rgba(58, 58, 58, 0.8);
    border-radius: 6px;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

.page-number:hover {
    background: rgba(76, 175, 80, 0.8);
}

.page-number.current {
    background: #4CAF50;
    pointer-events: none;
}

.alert a {
    display: inline-block;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: white;
    text-decoration: none;
    margin-top: 8px;
    transition: background 0.3s ease;
}

.alert a:hover {
    background: rgba(255, 255, 255, 0.3);
}

.trading-chart-container {
    height: 600px;
    margin: 20px 0;
    background: rgba(26, 26, 26, 0.95);
    border-radius: 15px;
    overflow: hidden;
}





/* Previous CSS remains the same, updating and adding these sections: */

.form-buttons {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    margin-top: 20px;
}

/* Mobile Responsiveness */
@media screen and (max-width: 768px) {
    .form-buttons {
        flex-direction: row; /* Ensure buttons stay side by side */
        gap: 8px; /* Slightly reduce gap on mobile */
    }

    .submit-trade,
    .cancel-trade {
        flex: 1; /* Make buttons take equal width */
        min-width: 0; /* Override min-width to allow proper scaling */
        padding: 12px 16px; /* Slightly adjust padding for better touch targets */
        font-size: 14px; /* Slightly smaller font for mobile */
    }

    .trading-container {
        padding: 15px; /* Reduce padding on mobile */
    }

    .button-container {
        flex-direction: row; /* Ensure buy/sell buttons stay side by side */
        gap: 10px;
    }

    .trade-button {
        flex: 1;
        min-width: 0;
        padding: 12px 16px;
    }

    /* Ensure notification stays visible on mobile */
    .alert-container {
        bottom: 10px;
        right: 10px;
        left: 10px; /* Add left constraint for better mobile layout */
    }

    .alert {
        width: auto; /* Allow alert to be responsive */
        max-width: none; /* Remove max-width constraint on mobile */
        margin: 0 10px; /* Add some margin from edges */
    }
}

/* Ensure form inputs are properly sized on mobile */
.form-group input,
.form-group select {
    width: 100%;
    box-sizing: border-box;
    -webkit-appearance: none; /* Fix for iOS input styling */
    appearance: none;
}



/* Previous CSS remains the same, updating alert sections: */

.alert-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    width: auto;
    max-width: 400px;
}

.alert {
    background: rgba(42, 42, 42, 0.95);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 10px;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    width: 100%;
    position: relative;
    overflow: hidden;
}

/* Mobile Styles */
@media screen and (max-width: 768px) {
    .alert-container {
        left: 10px;
        right: 10px;
        bottom: 10px;
        max-width: none;
    }

    .alert {
        margin: 0 0 10px 0;
        padding: 12px;
        font-size: 14px;
        width: auto;
    }

    .alert-title {
        font-size: 16px;
        margin-bottom: 8px;
    }

    .alert-amount {
        font-size: 20px;
        margin: 8px 0;
    }

    .alert-message {
        font-size: 14px;
        line-height: 1.4;
    }

    /* Ensure alerts stack properly on mobile */
    .alert + .alert {
        margin-top: 8px;
    }

    /* Make close button more touch-friendly */
    .close-alert {
        padding: 8px;
        font-size: 18px;
    }
}

/* Animation keyframes remain the same */