/* Enhanced Order Confirmation Modal Styles */
.enhanced-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(15px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.enhanced-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.enhanced-trade-modal {
    background: linear-gradient(145deg, #1e2329 0%, #2a2f36 100%);
    border-radius: 12px;
    border: 1px solid #00d4aa;
    box-shadow: 
        0 15px 40px rgba(0, 212, 170, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    max-width: 320px;
    width: 90%;
    max-height: 60vh;
    overflow: hidden;
    transform: scale(0.8) translateY(30px) rotateX(10deg);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.enhanced-modal-overlay.active .enhanced-trade-modal {
    transform: scale(1) translateY(0) rotateX(0deg);
}

.enhanced-trade-modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #00d4aa, transparent);
    opacity: 0.6;
}

.enhanced-modal-header {
    background: linear-gradient(135deg, #00d4aa 0%, #00b894 100%);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.enhanced-modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.enhanced-modal-header .header-icon {
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
    backdrop-filter: blur(10px);
}

.enhanced-modal-header .header-content h2 {
    color: white;
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.enhanced-modal-header .header-content p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 11px;
    margin: 1px 0 0 0;
    font-weight: 400;
}

.enhanced-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.enhanced-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.enhanced-modal-body {
    padding: 16px;
    max-height: 45vh;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Custom scrollbar for modal body */
.enhanced-modal-body::-webkit-scrollbar {
    width: 6px;
}

.enhanced-modal-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.enhanced-modal-body::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #00d4aa, #00b894);
    border-radius: 3px;
}

.enhanced-modal-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #00b894, #00a085);
}

.trade-summary-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
}

.trade-type-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.1) 0%, rgba(0, 184, 148, 0.1) 100%);
    border-radius: 8px;
    border: 1px solid rgba(0, 212, 170, 0.3);
}

.trade-type-indicator .type-icon {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #00d4aa, #00b894);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
}

.trade-type-indicator .type-text .type-label {
    display: block;
    color: #9ca3af;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.trade-type-indicator .type-text .type-value {
    display: block;
    color: #00d4aa;
    font-size: 16px;
    font-weight: 700;
}

.trading-pair-section {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.trading-pair-section .pair-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    overflow: hidden;
}

.trading-pair-section .pair-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.trading-pair-section .pair-info .pair-symbol {
    display: block;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
}

.trading-pair-section .pair-info .pair-name {
    display: block;
    color: #9ca3af;
    font-size: 12px;
    margin-top: 2px;
}

.trade-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.detail-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.detail-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(0, 212, 170, 0.3);
    transform: translateY(-2px);
}

/* Touch-friendly interactions for mobile */
@media (hover: none) and (pointer: coarse) {
    .detail-card:hover {
        transform: none;
    }
    
    .enhanced-close-btn:hover {
        transform: none;
    }
    
    .enhanced-cancel-btn:hover,
    .enhanced-confirm-btn:hover {
        transform: none;
    }
}

.detail-card .detail-icon {
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, #00d4aa, #00b894);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 11px;
}

.detail-card .detail-content {
    flex: 1;
}

.detail-card .detail-label {
    display: block;
    color: #9ca3af;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.detail-card .detail-value {
    display: block;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
}

.detail-card .detail-value.profit-highlight {
    color: #00d4aa;
    font-weight: 700;
}


.enhanced-modal-footer {
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    gap: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.enhanced-cancel-btn,
.enhanced-confirm-btn {
    flex: 1;
    height: 36px;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    min-height: 36px; /* Minimum touch target size */
}

.enhanced-cancel-btn {
    background: linear-gradient(135deg, #6c757d, #5a6268);
    color: white;
}

.enhanced-cancel-btn:hover {
    background: linear-gradient(135deg, #5a6268, #495057);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.enhanced-confirm-btn {
    background: linear-gradient(135deg, #00d4aa, #00b894);
    color: white;
}

.enhanced-confirm-btn:hover {
    background: linear-gradient(135deg, #00b894, #00a085);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 212, 170, 0.4);
}

/* Mobile Responsive for Enhanced Modal */
@media (max-width: 768px) {
    .enhanced-modal-overlay {
        padding: 15px;
        align-items: flex-start;
        padding-top: 5vh;
    }
    
    .enhanced-trade-modal {
        max-width: 100%;
        width: 100%;
        border-radius: 12px;
        max-height: 85vh;
        margin: 0;
    }
    
    .enhanced-modal-header {
        padding: 12px 16px;
        gap: 8px;
    }
    
    .enhanced-modal-header .header-icon {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    .enhanced-modal-header .header-content h2 {
        font-size: 16px;
    }
    
    .enhanced-modal-header .header-content p {
        font-size: 11px;
    }
    
    .enhanced-close-btn {
        width: 28px;
        height: 28px;
        font-size: 14px;
        top: 10px;
        right: 10px;
    }
    
    .enhanced-modal-body {
        padding: 16px;
        max-height: 50vh;
    }
    
    .trade-summary-section {
        gap: 12px;
        margin-bottom: 12px;
    }
    
    .trade-type-indicator {
        padding: 10px;
        gap: 8px;
    }
    
    .trade-type-indicator .type-icon {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }
    
    .trade-type-indicator .type-text .type-label {
        font-size: 10px;
    }
    
    .trade-type-indicator .type-text .type-value {
        font-size: 14px;
    }
    
    .trading-pair-section {
        padding: 10px;
        gap: 8px;
    }
    
    .trading-pair-section .pair-icon {
        width: 28px;
        height: 28px;
    }
    
    .trading-pair-section .pair-info .pair-symbol {
        font-size: 14px;
    }
    
    .trading-pair-section .pair-info .pair-name {
        font-size: 11px;
    }
    
    .trade-details-grid {
        grid-template-columns: 1fr;
        gap: 8px;
        margin-bottom: 12px;
    }
    
    .detail-card {
        padding: 10px;
        gap: 8px;
    }
    
    .detail-card .detail-icon {
        width: 24px;
        height: 24px;
        font-size: 11px;
    }
    
    .detail-card .detail-label {
        font-size: 9px;
    }
    
    .detail-card .detail-value {
        font-size: 12px;
    }
    
    .enhanced-modal-footer {
        padding: 12px 16px;
        gap: 8px;
        flex-direction: column;
    }
    
    .enhanced-cancel-btn,
    .enhanced-confirm-btn {
        height: 40px;
        font-size: 13px;
        gap: 6px;
    }
}

/* Extra small phones (iPhone SE, etc.) */
@media (max-width: 375px) {
    .enhanced-modal-overlay {
        padding: 10px;
        padding-top: 2vh;
    }
    
    .enhanced-trade-modal {
        max-height: 90vh;
        border-radius: 8px;
    }
    
    .enhanced-modal-header {
        padding: 10px 12px;
    }
    
    .enhanced-modal-header .header-icon {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }
    
    .enhanced-modal-header .header-content h2 {
        font-size: 14px;
    }
    
    .enhanced-modal-header .header-content p {
        font-size: 10px;
    }
    
    .enhanced-close-btn {
        width: 24px;
        height: 24px;
        font-size: 12px;
        top: 8px;
        right: 8px;
    }
    
    .enhanced-modal-body {
        padding: 12px;
        max-height: 45vh;
    }
    
    .trade-summary-section {
        gap: 8px;
        margin-bottom: 8px;
    }
    
    .trade-type-indicator {
        padding: 8px;
        gap: 6px;
    }
    
    .trade-type-indicator .type-icon {
        width: 20px;
        height: 20px;
        font-size: 10px;
    }
    
    .trade-type-indicator .type-text .type-label {
        font-size: 8px;
    }
    
    .trade-type-indicator .type-text .type-value {
        font-size: 12px;
    }
    
    .trading-pair-section {
        padding: 8px;
        gap: 6px;
    }
    
    .trading-pair-section .pair-icon {
        width: 24px;
        height: 24px;
    }
    
    .trading-pair-section .pair-info .pair-symbol {
        font-size: 12px;
    }
    
    .trading-pair-section .pair-info .pair-name {
        font-size: 9px;
    }
    
    .trade-details-grid {
        gap: 6px;
        margin-bottom: 8px;
    }
    
    .detail-card {
        padding: 8px;
        gap: 6px;
    }
    
    .detail-card .detail-icon {
        width: 20px;
        height: 20px;
        font-size: 9px;
    }
    
    .detail-card .detail-label {
        font-size: 8px;
    }
    
    .detail-card .detail-value {
        font-size: 10px;
    }
    
    .enhanced-modal-footer {
        padding: 10px 12px;
        gap: 6px;
    }
    
    .enhanced-cancel-btn,
    .enhanced-confirm-btn {
        height: 36px;
        font-size: 12px;
        gap: 4px;
    }
}

/* Landscape orientation for phones */
@media (max-width: 768px) and (orientation: landscape) {
    .enhanced-modal-overlay {
        padding: 5px;
        align-items: center;
    }
    
    .enhanced-trade-modal {
        max-height: 90vh;
        max-width: 95%;
    }
    
    .enhanced-modal-header {
        padding: 8px 12px;
    }
    
    .enhanced-modal-header .header-icon {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }
    
    .enhanced-modal-header .header-content h2 {
        font-size: 14px;
    }
    
    .enhanced-modal-header .header-content p {
        font-size: 10px;
    }
    
    .enhanced-modal-body {
        max-height: 60vh;
        padding: 12px;
    }
    
    .trade-summary-section {
        gap: 8px;
        margin-bottom: 8px;
    }
    
    .trade-type-indicator {
        padding: 6px;
    }
    
    .trade-type-indicator .type-icon {
        width: 20px;
        height: 20px;
        font-size: 10px;
    }
    
    .trading-pair-section {
        padding: 6px;
    }
    
    .trading-pair-section .pair-icon {
        width: 24px;
        height: 24px;
    }
    
    .trade-details-grid {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        margin-bottom: 8px;
    }
    
    .detail-card {
        padding: 6px;
    }
    
    .detail-card .detail-icon {
        width: 20px;
        height: 20px;
        font-size: 9px;
    }
    
    .enhanced-modal-footer {
        flex-direction: row;
        padding: 8px 12px;
        gap: 6px;
    }
    
    .enhanced-cancel-btn,
    .enhanced-confirm-btn {
        height: 32px;
        font-size: 11px;
    }
}

/* Trading Process Modal Styles */
.trade-process-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.process-detail-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.process-detail-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(0, 212, 170, 0.3);
}

.process-detail-card .detail-icon {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #00d4aa, #00b894);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
}

.process-detail-card .detail-content {
    flex: 1;
}

.process-detail-card .detail-label {
    display: block;
    color: #9ca3af;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.process-detail-card .detail-value {
    display: block;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
}

/* Trading Process Modal Styles */
.trade-process-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.process-detail-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.process-detail-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(0, 212, 170, 0.3);
}

.process-detail-card .detail-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #00d4aa, #00b894);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
    flex-shrink: 0;
}

.process-detail-card .detail-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.process-detail-card .detail-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.process-detail-card .detail-value {
    font-size: 13px;
    color: #ffffff;
    font-weight: 600;
}

.progress-section {
    margin-top: 20px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #00d4aa, #00b894);
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s ease;
    animation: progressPulse 2s infinite;
}

@keyframes progressPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.progress-text {
    text-align: center;
    color: #9ca3af;
    font-size: 12px;
    font-weight: 500;
}

/* Trading Result Modal Styles */
.result-status-section {
    margin-bottom: 20px;
}

.result-status-card {
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.1) 0%, rgba(0, 184, 148, 0.1) 100%);
    border: 1px solid rgba(0, 212, 170, 0.3);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: center;
    justify-content: center;
}

.result-status-card.lose {
    background: linear-gradient(135deg, rgba(246, 70, 93, 0.1) 0%, rgba(220, 53, 69, 0.1) 100%);
    border-color: rgba(246, 70, 93, 0.3);
}

.result-status-card .status-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #00d4aa, #00b894);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
}

.result-status-card.lose .status-icon {
    background: linear-gradient(135deg, #f6465d, #dc3545);
}

.result-status-card .status-content {
    flex: 1;
}

.result-status-card .status-label {
    display: block;
    color: #9ca3af;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.result-status-card .status-value {
    display: block;
    color: #00d4aa;
    font-size: 18px;
    font-weight: 700;
}

.result-status-card.lose .status-value {
    color: #f6465d;
}

.result-details-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.result-detail-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.result-detail-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(0, 212, 170, 0.3);
}

.result-detail-card .detail-icon {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #00d4aa, #00b894);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
}

.result-detail-card .detail-content {
    flex: 1;
}

.result-detail-card .detail-label {
    display: block;
    color: #9ca3af;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.result-detail-card .detail-value {
    display: block;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
}

/* Mobile Responsive for Trading Process and Result Modals */
@media (max-width: 768px) {
    .trade-process-section,
    .result-details-section {
        gap: 10px;
    }
    
    .process-detail-card,
    .result-detail-card {
        padding: 10px;
        gap: 8px;
    }
    
    .process-detail-card .detail-icon,
    .result-detail-card .detail-icon {
        width: 20px;
        height: 20px;
        font-size: 10px;
    }
    
    .process-detail-card .detail-label,
    .result-detail-card .detail-label {
        font-size: 10px;
    }
    
    .process-detail-card .detail-value,
    .result-detail-card .detail-value {
        font-size: 12px;
    }
    
    .result-status-card {
        padding: 12px;
        gap: 10px;
    }
    
    .result-status-card .status-icon {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    .result-status-card .status-value {
        font-size: 16px;
    }
    
    .progress-bar {
        height: 4px;
    }
    
    .progress-text {
        font-size: 11px;
    }
}
