/* Auto Trade System Styles */

/* Auto Trade Button */
.btn-auto-trade {
    display: flex;
    align-items: center;
    gap: 8px;
    height: var(--btn-h, 40px);
    padding: 0 18px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 165, 0, 0.12));
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 20px;
    color: #ffd700;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

/* Mobile Auto Trade button - hidden on desktop */
.btn-auto-trade.mobile-auto-trade {
    display: none;
}

.btn-auto-trade svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.btn-auto-trade:hover {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.25), rgba(255, 165, 0, 0.2));
    border-color: rgba(255, 215, 0, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(255, 215, 0, 0.3);
}

/* Auto Trade Modal */
.auto-trade-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease-out;
}

.auto-trade-modal-overlay.open {
    display: flex;
}

.auto-trade-modal {
    background: linear-gradient(145deg, rgba(26, 31, 58, 0.98), rgba(20, 24, 41, 0.96));
    border: 1px solid rgba(102, 126, 234, 0.25);
    border-radius: 24px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(102, 126, 234, 0.15);
    animation: slideUp 0.4s ease-out;
    position: relative;
}

.auto-trade-modal::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.06) 0%, transparent 50%);
    pointer-events: none;
    border-radius: 24px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.auto-trade-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 28px 32px;
    border-bottom: 1px solid rgba(102, 126, 234, 0.15);
    position: relative;
    z-index: 1;
}

.auto-trade-modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.auto-trade-modal-title svg {
    width: 28px;
    height: 28px;
    color: #ffd700;
}

.auto-trade-modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}

.auto-trade-modal-close:hover {
    background: rgba(255, 77, 77, 0.15);
    border-color: rgba(255, 77, 77, 0.4);
    transform: rotate(90deg);
}

.auto-trade-modal-close svg {
    width: 14px;
    height: 14px;
}

.auto-trade-modal-body {
    padding: 32px;
    overflow-y: auto;
    max-height: calc(90vh - 100px);
    position: relative;
    z-index: 1;
}

.auto-trade-view {
    display: block;
}

.auto-trade-view.hidden {
    display: none;
}

/* Info Section */
.auto-trade-info {
    margin-bottom: 36px;
}

.info-card {
    display: flex;
    gap: 20px;
    padding: 24px;
    background: rgba(102, 126, 234, 0.08);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 16px;
    margin-bottom: 24px;
}

.info-icon {
    font-size: 40px;
    flex-shrink: 0;
}

.info-content h3 {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 8px;
}

.info-content p {
    font-size: 14px;
    color: #b4b9d8;
    line-height: 1.6;
    margin: 0;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.info-item {
    padding: 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    transition: all 0.3s;
}

.info-item:hover {
    background: rgba(102, 126, 234, 0.06);
    border-color: rgba(102, 126, 234, 0.2);
}

.info-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 10px;
}

.info-badge.green {
    background: rgba(56, 239, 125, 0.15);
    color: #38ef7d;
    border: 1px solid rgba(56, 239, 125, 0.3);
}

.info-badge.purple {
    background: rgba(102, 126, 234, 0.15);
    color: #667eea;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.info-badge.blue {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.info-badge.orange {
    background: rgba(251, 146, 60, 0.15);
    color: #fb923c;
    border: 1px solid rgba(251, 146, 60, 0.3);
}

.info-item p {
    font-size: 13px;
    color: #b4b9d8;
    line-height: 1.5;
    margin: 0;
}

/* Accounts Section */
.accounts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.accounts-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.btn-add-account {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    border: none;
    border-radius: 20px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-add-account svg {
    width: 18px;
    height: 18px;
}

.btn-add-account:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(56, 239, 125, 0.4);
}

.accounts-list {
    display: grid;
    gap: 16px;
}

.accounts-loading,
.accounts-empty {
    padding: 60px 20px;
    text-align: center;
    color: #b4b9d8;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    font-size: 14px;
}

/* Demo Account Warning Modal */
.demo-warning-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 20000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.demo-warning-overlay.show {
    display: flex;
}

.demo-warning-modal {
    background: linear-gradient(145deg, rgba(26, 31, 58, 0.98), rgba(20, 24, 41, 0.96));
    border: 2px solid rgba(255, 77, 77, 0.4);
    border-radius: 20px;
    max-width: 440px;
    width: 90%;
    padding: 32px;
    box-shadow: 0 24px 60px rgba(255, 77, 77, 0.3), 0 0 0 1px rgba(255, 77, 77, 0.2);
    animation: modalBounce 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    text-align: center;
}

@keyframes modalBounce {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.demo-warning-icon {
    font-size: 64px;
    margin-bottom: 20px;
    display: block;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.demo-warning-title {
    font-size: 22px;
    font-weight: 700;
    color: #ff6b6b;
    margin: 0 0 16px;
    line-height: 1.3;
}

.demo-warning-message {
    font-size: 15px;
    color: #b4b9d8;
    line-height: 1.6;
    margin: 0 0 28px;
}

.demo-warning-btn {
    width: 100%;
    padding: 14px 32px;
    background: linear-gradient(135deg, #ff4d4d 0%, #ff6b6b 100%);
    border: none;
    border-radius: 16px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 16px rgba(255, 77, 77, 0.3);
}

.demo-warning-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 77, 77, 0.5);
}

/* Auth Prompt (non-authenticated users) */
.auth-prompt {
    padding: 60px 40px;
    text-align: center;
    background: linear-gradient(145deg, rgba(102, 126, 234, 0.08), rgba(118, 75, 162, 0.06));
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 20px;
}

.auth-prompt-icon {
    font-size: 56px;
    margin-bottom: 20px;
}

.auth-prompt h3 {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 12px;
}

.auth-prompt p {
    font-size: 15px;
    color: #b4b9d8;
    line-height: 1.6;
    margin-bottom: 28px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.btn-signin-prompt {
    padding: 14px 32px;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    border: none;
    border-radius: 20px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-signin-prompt:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(56, 239, 125, 0.4);
}

/* Account Card */
.account-card {
    padding: 20px 24px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    transition: all 0.3s;
    position: relative;
}

.account-card:hover {
    background: rgba(102, 126, 234, 0.08);
    border-color: rgba(102, 126, 234, 0.25);
}

.account-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.account-card-name {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}

.account-card-actions {
    display: flex;
    gap: 8px;
}

.btn-info,
.btn-delete {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.2s;
    padding: 0;
}

.btn-info svg,
.btn-delete svg {
    width: 16px;
    height: 16px;
}

.btn-info:hover {
    background: rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.4);
}

.btn-delete:hover {
    background: rgba(255, 77, 77, 0.15);
    border-color: rgba(255, 77, 77, 0.4);
}

.account-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.account-status.pending {
    background: rgba(251, 146, 60, 0.15);
    color: #fb923c;
    border: 1px solid rgba(251, 146, 60, 0.3);
}

.account-status.error {
    background: rgba(255, 77, 77, 0.15);
    color: #ff4d4d;
    border: 1px solid rgba(255, 77, 77, 0.3);
}

.account-status.success {
    background: rgba(56, 239, 125, 0.15);
    color: #38ef7d;
    border: 1px solid rgba(56, 239, 125, 0.3);
}

.account-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Platform Badge */
.platform-badge {
    display: inline-flex !important;
    align-items: center !important;
    padding: 3px 8px !important;
    border-radius: 12px !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin-left: 6px !important;
    vertical-align: middle !important;
}

.platform-badge.platform-mt4 {
    background: rgba(102, 126, 234, 0.15) !important;
    color: #667eea !important;
    border: 1px solid rgba(102, 126, 234, 0.3) !important;
}

.platform-badge.platform-mt5 {
    background: rgba(56, 239, 125, 0.15) !important;
    color: #38ef7d !important;
    border: 1px solid rgba(56, 239, 125, 0.3) !important;
}

.account-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 12px;
}

.account-detail-item {
    font-size: 13px;
}

.account-detail-label {
    color: #b4b9d8;
    margin-bottom: 4px;
}

.account-detail-value {
    color: #fff;
    font-weight: 600;
}

/* Account Stats */
.account-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-box {
    text-align: center;
}

.stat-box-label {
    font-size: 11px;
    color: #b4b9d8;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.stat-box-value {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}

.stat-box-value.positive {
    color: #38ef7d;
}

.stat-box-value.negative {
    color: #ff4d4d;
}

/* Add Account Form */
.btn-back {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-back svg {
    width: 18px;
    height: 18px;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.add-account-form {
    max-width: 500px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
}

.form-group .required {
    color: #ff4d4d;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: #fff;
    font-size: 14px;
    transition: all 0.3s;
}

.form-group input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.field-hint {
    display: block;
    font-size: 12px;
    color: #b4b9d8;
    margin-top: 6px;
}

.field-error {
    display: block;
    font-size: 12px;
    color: #ff4d4d;
    margin-top: 6px;
    min-height: 18px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
}

.btn-secondary {
    flex: 1;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
}

.btn-primary-submit {
    flex: 2;
    padding: 12px 24px;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    border: none;
    border-radius: 20px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.btn-primary-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(56, 239, 125, 0.4);
}

.btn-primary-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-loading,
.btn-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-loading.hidden,
.btn-text.hidden {
    display: none;
}

.spinner {
    width: 18px;
    height: 18px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.form-note {
    display: flex;
    gap: 12px;
    padding: 16px;
    margin-top: 24px;
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 12px;
}

.form-note svg {
    width: 20px;
    height: 20px;
    color: #38bdf8;
    flex-shrink: 0;
}

.form-note p {
    font-size: 13px;
    color: #b4b9d8;
    line-height: 1.5;
    margin: 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    /* Hide desktop Auto Trade button in header-buttons-group */
    .header-buttons-group .btn-auto-trade {
        display: none !important;
    }

    .btn-auto-trade .btn-text {
        display: none;
    }

    .btn-auto-trade {
        padding: 0 10px;
        gap: 0;
    }

    /* Mobile Auto Trade button - rectangle shape to fit header */
    .btn-auto-trade.mobile-auto-trade {
        display: flex !important;
        align-items: center;
        justify-content: center;
        height: 32px;
        min-height: 32px;
        max-height: 32px;
        width: 40px;
        padding: 0 10px;
        border-radius: 8px; /* Rectangle shape with subtle rounding */
        margin-left: 8px;
        flex-shrink: 0;
    }

    .btn-auto-trade.mobile-auto-trade svg {
        width: 16px;
        height: 16px;
        flex-shrink: 0;
    }

    .auto-trade-modal {
        max-width: 100%;
        border-radius: 20px 20px 0 0;
        margin-top: auto;
        max-height: 95vh;
    }

    .auto-trade-modal-header {
        padding: 20px;
    }

    .auto-trade-modal-title {
        font-size: 20px;
    }

    .auto-trade-modal-title svg {
        width: 24px;
        height: 24px;
    }

    .auto-trade-modal-body {
        padding: 20px;
    }

    .info-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .account-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-box-value {
        font-size: 14px;
    }

    .account-details {
        grid-template-columns: 1fr;
    }

    .btn-back {
        font-size: 13px;
        padding: 6px 12px;
    }

    .btn-back svg {
        width: 16px;
        height: 16px;
    }

    .auth-prompt {
        padding: 40px 20px;
    }

    .auth-prompt-icon {
        font-size: 48px;
    }

    .auth-prompt h3 {
        font-size: 20px;
    }

    .auth-prompt p {
        font-size: 14px;
    }

    /* Demo Warning Modal Mobile */
    .demo-warning-modal {
        padding: 24px;
        max-width: 90%;
    }

    .demo-warning-icon {
        font-size: 52px;
        margin-bottom: 16px;
    }

    .demo-warning-title {
        font-size: 18px;
        margin-bottom: 12px;
    }

    .demo-warning-message {
        font-size: 14px;
        margin-bottom: 24px;
    }

    .demo-warning-btn {
        padding: 12px 24px;
        font-size: 14px;
    }
}
