/* ========================================
   CHAT ACTION MODALS
   Ping modals and complete order modal
   Matches the new design system (dropdown/delete style)
   ======================================== */

/* ==================== BASE MODAL STYLES ==================== */

/* Remove Bootstrap modal backdrop in favor of our own */
#chatRequestBoosterModal .modal-backdrop,
#chatRequestClientModal .modal-backdrop,
#chatCompleteOrderModal .modal-backdrop {
    display: none !important;
}

/* Override Bootstrap modal positioning */
#chatRequestBoosterModal.show,
#chatRequestClientModal.show,
#chatCompleteOrderModal.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    z-index: 9999;
}

/* Modal Dialog */
.chat-action-modal-dialog {
    width: 100%;
    max-width: 480px;
    margin: 0;
    pointer-events: auto;
}

/* Modal Content */
.chat-action-modal-content {
    background: #2a2e3a;
    border-radius: 18px;
    border: none;
    box-shadow: 
        0 10px 50px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    overflow: hidden;
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#chatRequestBoosterModal.show .chat-action-modal-content,
#chatRequestClientModal.show .chat-action-modal-content,
#chatCompleteOrderModal.show .chat-action-modal-content {
    transform: scale(1);
    opacity: 1;
}

/* ==================== MODAL HEADER ==================== */

.chat-action-modal-header {
    padding: 24px 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-action-modal-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    background: rgba(74, 158, 255, 0.15);
    color: #4a9eff;
}

.chat-action-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #e4e6eb;
    margin: 0;
    letter-spacing: -0.02em;
    flex: 1;
}

/* ==================== MODAL BODY ==================== */

.chat-action-modal-body {
    padding: 24px;
}

.chat-action-description {
    margin-bottom: 20px;
}

.chat-action-description-title {
    font-size: 15px;
    font-weight: 600;
    color: #e4e6eb;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.chat-action-description-text {
    font-size: 14px;
    color: #b0b3b8;
    line-height: 1.5;
    margin: 0;
}

.chat-action-info-box {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 16px;
}

.chat-action-info-title {
    font-size: 14px;
    font-weight: 600;
    color: #e4e6eb;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-action-info-title i {
    font-size: 16px;
    color: #4a9eff;
}

.chat-action-info-text {
    font-size: 13px;
    color: #b0b3b8;
    line-height: 1.5;
    margin-bottom: 8px;
}

.chat-action-info-list {
    margin: 0;
    padding-left: 20px;
    font-size: 13px;
    color: #b0b3b8;
    line-height: 1.6;
}

.chat-action-info-list li {
    margin-bottom: 6px;
}

.chat-action-info-list li:last-child {
    margin-bottom: 0;
}

/* ==================== MODAL FOOTER ==================== */

.chat-action-modal-footer {
    padding: 16px 24px 24px;
    border-top: none;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.chat-action-btn {
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.chat-action-btn i {
    font-size: 14px;
}

/* Cancel Button */
.chat-action-btn-cancel {
    background: rgba(255, 255, 255, 0.08);
    color: #e4e6eb;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.chat-action-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}

.chat-action-btn-cancel:active {
    transform: translateY(0);
}

/* Primary Action Button */
.chat-action-btn-primary {
    background: linear-gradient(135deg, #4a9eff, #3b82f6);
    color: white;
    box-shadow: 0 4px 12px rgba(74, 158, 255, 0.3);
    min-width: 160px;
    justify-content: center;
}

.chat-action-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(74, 158, 255, 0.4);
}

.chat-action-btn-primary:active {
    transform: translateY(0);
}

/* Ripple Effect */
.chat-action-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.chat-action-btn:active::after {
    width: 200px;
    height: 200px;
    opacity: 0;
}

/* ==================== LIGHT THEME ==================== */

html[data-theme='light'] .chat-action-modal-content {
    background: #ffffff;
    box-shadow: 
        0 10px 50px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(0, 0, 0, 0.05) inset;
}

html[data-theme='light'] .chat-action-modal-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

html[data-theme='light'] .chat-action-modal-icon {
    background: rgba(74, 158, 255, 0.1);
}

html[data-theme='light'] .chat-action-modal-title {
    color: #1c1e21;
}

html[data-theme='light'] .chat-action-description-title {
    color: #1c1e21;
}

html[data-theme='light'] .chat-action-description-text {
    color: #65676b;
}

html[data-theme='light'] .chat-action-info-box {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

html[data-theme='light'] .chat-action-info-title {
    color: #1c1e21;
}

html[data-theme='light'] .chat-action-info-text,
html[data-theme='light'] .chat-action-info-list {
    color: #65676b;
}

html[data-theme='light'] .chat-action-btn-cancel {
    background: rgba(0, 0, 0, 0.05);
    color: #1c1e21;
    border: 1px solid rgba(0, 0, 0, 0.12);
}

html[data-theme='light'] .chat-action-btn-cancel:hover {
    background: rgba(0, 0, 0, 0.08);
}

/* ==================== MOBILE RESPONSIVE ==================== */

@media (max-width: 768px) {
    /* Ensure modal fits on screen */
    #chatRequestBoosterModal.show,
    #chatRequestClientModal.show,
    #chatCompleteOrderModal.show {
        padding: 16px;
    }
    
    .chat-action-modal-dialog {
        max-width: 100%;
        width: 100%;
    }
    
    .chat-action-modal-content {
        max-height: calc(100vh - 32px);
        overflow-y: auto;
    }
    
    .chat-action-modal-header {
        padding: 20px 20px 16px;
    }
    
    .chat-action-modal-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .chat-action-modal-title {
        font-size: 17px;
    }
    
    .chat-action-modal-body {
        padding: 20px;
    }
    
    .chat-action-description-title {
        font-size: 14px;
    }
    
    .chat-action-description-text {
        font-size: 13px;
    }
    
    .chat-action-info-box {
        padding: 14px;
    }
    
    .chat-action-info-title {
        font-size: 13px;
    }
    
    .chat-action-info-text,
    .chat-action-info-list {
        font-size: 12px;
    }
    
    .chat-action-modal-footer {
        padding: 12px 20px 20px;
        flex-direction: column-reverse;
        gap: 10px;
    }
    
    .chat-action-btn {
        width: 100%;
        justify-content: center;
        padding: 14px 20px; /* Larger touch targets */
        font-size: 14px;
    }
    
    .chat-action-btn-primary {
        min-width: auto;
    }
}

/* ==================== ANIMATION ENTRANCE ==================== */

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.chat-action-modal-content {
    animation: modalSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

