/**
 * Payment Help Modal Styles
 * 
 * Responsive and accessible modal styles for WooCommerce Payment Help plugin
 */

/* Modal Overlay */
.payment-help-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.payment-help-modal.show {
    opacity: 1;
    visibility: visible;
}

.payment-help-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

/* Modal Content */
.payment-help-modal-content {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.payment-help-modal.show .payment-help-modal-content {
    transform: scale(1);
}

/* Modal Header */
.payment-help-modal-header {
    padding: 20px 20px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.payment-help-modal-title {
    margin: 0 0 20px 0;
    font-size: 24px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

.payment-help-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease, color 0.2s ease;
    position: absolute;
    top: 15px;
    right: 15px;
}

.payment-help-modal-close:hover,
.payment-help-modal-close:focus {
    background-color: #f5f5f5;
    color: #333;
    outline: none;
}

/* Modal Body */
.payment-help-modal-body {
    padding: 20px;
}

.payment-help-instruction-message {
    font-size: 16px;
    line-height: 1.6;
    color: #555;
    margin-bottom: 20px;
}

.payment-help-instruction-message p {
    margin: 0 0 15px 0;
}

.payment-help-instruction-message p:last-child {
    margin-bottom: 0;
}

.payment-help-instruction-message ul,
.payment-help-instruction-message ol {
    margin: 15px 0;
    padding-left: 20px;
}

.payment-help-instruction-message li {
    margin-bottom: 8px;
}

.payment-help-instruction-message a {
    color: #007cba;
    text-decoration: underline;
}

.payment-help-instruction-message a:hover {
    text-decoration: none;
}

.payment-help-loading {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
}

/* Modal Footer */
.payment-help-modal-footer {
    padding: 0 20px 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.payment-help-retry-btn,
.payment-help-cancel-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: background-color 0.2s ease, transform 0.1s ease;
    min-width: 120px;
}

.payment-help-retry-btn {
    background-color: #007cba;
    color: #fff;
}

.payment-help-retry-btn:hover,
.payment-help-retry-btn:focus {
    background-color: #005a87;
    transform: translateY(-1px);
    outline: none;
    box-shadow: 0 2px 8px rgba(0, 124, 186, 0.3);
}

.payment-help-retry-btn:active {
    transform: translateY(0);
}

.payment-help-retry-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.payment-help-cancel-btn {
    background-color: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
}

.payment-help-cancel-btn:hover,
.payment-help-cancel-btn:focus {
    background-color: #e5e5e5;
    outline: none;
}

/* Error and Success Messages */
.payment-help-message {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 14px;
}

.payment-help-message.error {
    background-color: #ffeaea;
    border: 1px solid #e74c3c;
    color: #c0392b;
}

.payment-help-message.success {
    background-color: #eafaf1;
    border: 1px solid #27ae60;
    color: #1e8449;
}

/* Responsive Design */
@media (max-width: 768px) {
    .payment-help-modal-overlay {
        padding: 10px;
    }
    
    .payment-help-modal-content {
        max-height: 95vh;
    }
    
    .payment-help-modal-header {
        padding: 15px 15px 0;
    }
    
    .payment-help-modal-title {
        font-size: 20px;
        margin-bottom: 15px;
    }
    
    .payment-help-modal-close {
        top: 10px;
        right: 10px;
    }
    
    .payment-help-modal-body {
        padding: 15px;
    }
    
    .payment-help-modal-footer {
        padding: 0 15px 15px;
        flex-direction: column;
    }
    
    .payment-help-retry-btn,
    .payment-help-cancel-btn {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .payment-help-cancel-btn {
        margin-bottom: 0;
    }
}

@media (max-width: 480px) {
    .payment-help-modal-overlay {
        padding: 5px;
    }
    
    .payment-help-modal-title {
        font-size: 18px;
    }
    
    .payment-help-instruction-message {
        font-size: 14px;
    }
    
    .payment-help-retry-btn,
    .payment-help-cancel-btn {
        font-size: 14px;
        padding: 10px 20px;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .payment-help-modal-overlay {
        background-color: rgba(0, 0, 0, 0.8);
    }
    
    .payment-help-modal-content {
        border: 2px solid #000;
    }
    
    .payment-help-retry-btn {
        border: 2px solid #007cba;
    }
    
    .payment-help-cancel-btn {
        border: 2px solid #333;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .payment-help-modal,
    .payment-help-modal-content,
    .payment-help-retry-btn,
    .payment-help-cancel-btn,
    .payment-help-modal-close {
        transition: none;
    }
}

/* Focus Styles for Accessibility */
.payment-help-modal-close:focus,
.payment-help-retry-btn:focus,
.payment-help-cancel-btn:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Auto-popup specific styles */
.payment-help-auto-popup .payment-help-modal {
    animation: paymentHelpFadeIn 0.5s ease-out;
}

@keyframes paymentHelpFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Print styles */
@media print {
    .payment-help-modal {
        display: none !important;
    }
}