/* Modern Message Box Styles - Global Version for All Modules */
.modern-msgbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.15s ease-out;
    padding: 15px;
    transition: opacity 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.modern-msgbox {
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    max-width: 420px;
    width: 100%;
    animation: slideDown 0.2s ease-out;
    overflow: hidden;
}

.modern-msgbox.shake {
    animation: shake 0.3s ease-in-out;
}

.modern-msgbox-header {
    padding: 12px 16px 10px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.modern-msgbox-header.success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.modern-msgbox-header.error {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
}

.modern-msgbox-header.warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.modern-msgbox-header.info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.modern-msgbox-store-logo {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: white;
    padding: 3px;
    object-fit: contain;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.modern-msgbox-store-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #667eea;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.modern-msgbox-header.success .modern-msgbox-store-icon {
    color: #11998e;
}

.modern-msgbox-header.error .modern-msgbox-store-icon {
    color: #eb3349;
}

.modern-msgbox-header.warning .modern-msgbox-store-icon {
    color: #f5576c;
}

.modern-msgbox-header.info .modern-msgbox-store-icon {
    color: #4facfe;
}

.modern-msgbox-store-info {
    flex: 1;
    min-width: 0;
}

.modern-msgbox-store-name {
    font-size: 13px;
    font-weight: 700;
    color: white;
    margin: 0;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.modern-msgbox-store-location {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modern-msgbox-type-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.modern-msgbox-type-icon.success {
    color: #11998e;
}

.modern-msgbox-type-icon.error {
    color: #eb3349;
}

.modern-msgbox-type-icon.warning {
    color: #f5576c;
}

.modern-msgbox-type-icon.info {
    color: #4facfe;
}

.modern-msgbox-type-icon.confirm {
    color: #667eea;
}

.modern-msgbox-body {
    padding: 16px 18px;
}

.modern-msgbox-message {
    font-size: 13px;
    color: #2d3748;
    line-height: 1.5;
    margin: 0;
    white-space: pre-line;
    word-wrap: break-word;
}

.modern-msgbox-footer {
    padding: 10px 18px;
    background: #f8f9fa;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.modern-msgbox-btn {
    padding: 8px 18px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    outline: none;
    min-width: 70px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.modern-msgbox-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.modern-msgbox-btn:active:not(:disabled) {
    transform: translateY(0);
}

.modern-msgbox-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.modern-msgbox-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.modern-msgbox-btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.modern-msgbox-btn-danger {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    color: white;
}

.modern-msgbox-btn-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.modern-msgbox-btn-secondary {
    background: #e9ecef;
    color: #495057;
}

.modern-msgbox-btn-secondary:hover:not(:disabled) {
    background: #dee2e6;
}

/* Input field for prompts */
.modern-msgbox-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 13px;
    margin-top: 12px;
    outline: none;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.modern-msgbox-input:focus {
    border-color: #667eea;
}

/* Loading spinner for async operations */
.modern-msgbox-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Mobile Responsive */
@media (max-width: 576px) {
    .modern-msgbox {
        max-width: 95%;
        margin: 8px;
    }
    
    .modern-msgbox-header {
        padding: 10px 14px 8px;
    }
    
    .modern-msgbox-store-logo,
    .modern-msgbox-store-icon {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    .modern-msgbox-store-name {
        font-size: 12px;
    }
    
    .modern-msgbox-store-location {
        font-size: 9px;
    }
    
    .modern-msgbox-type-icon {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .modern-msgbox-body {
        padding: 14px 16px;
    }
    
    .modern-msgbox-message {
        font-size: 12px;
    }
    
    .modern-msgbox-footer {
        padding: 10px 16px;
        flex-direction: column-reverse;
    }
    
    .modern-msgbox-btn {
        width: 100%;
        padding: 10px 16px;
    }
}

/* Print - Hide message boxes */
@media print {
    .modern-msgbox-overlay {
        display: none !important;
    }
}
