/* AgenWebsite Payment Confirmation Modal Styles */

/* Modal Overlay */
.aw-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 20px;
    box-sizing: border-box;
}

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

/* Modal Container */
.aw-modal-container {
    background: #fff;
    border-radius: 8px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s ease;
}

.aw-modal-overlay.active .aw-modal-container {
    transform: translateY(0) scale(1);
}

/* Modal Header */
.aw-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e5e5;
    background: #f9f9f9;
}

.aw-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.aw-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s ease, color 0.2s ease;
}

.aw-modal-close:hover {
    background: #e0e0e0;
    color: #333;
}

.aw-modal-close:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Modal Body */
.aw-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.aw-modal-body .order-info {
    margin: 0 0 20px 0;
    padding: 12px 16px;
    background: #f0f8ff;
    border-left: 4px solid #0073aa;
    border-radius: 4px;
    font-size: 15px;
    color: #333;
}

/* Modal Upload Area */
.aw-modal-body .aw-upload-area {
    position: relative;
    padding: 40px 20px;
    margin-bottom: 20px;
    border: 2px dashed #ccc;
    border-radius: 8px;
    background: #fafafa;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.aw-modal-body .aw-upload-area:hover {
    border-color: #0073aa;
    background: #f0f8ff;
}

.aw-modal-body .aw-upload-area.drag-over {
    border-color: #0073aa;
    background: #e3f2fd;
}

.aw-modal-body .upload-content {
    pointer-events: none;
}

.aw-modal-body .upload-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.aw-modal-body .aw-upload-area p {
    margin: 5px 0;
    color: #666;
    font-size: 14px;
}

.aw-modal-body .aw-upload-area small {
    color: #999;
    font-size: 12px;
}

/* Modal File Input (Hidden) */
.aw-modal-body #aw-modal-payment-file {
    position: absolute;
    left: -9999px;
}

/* Modal File Preview */
.aw-modal-body .file-preview {
    display: none;
    margin-bottom: 20px;
}

.aw-modal-body .file-info {
    display: flex;
    align-items: center;
    padding: 12px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    position: relative;
}

.aw-modal-body .file-info img {
    max-width: 60px;
    max-height: 60px;
    margin-right: 12px;
    border-radius: 4px;
    object-fit: cover;
}

.aw-modal-body .file-icon {
    width: 60px;
    height: 60px;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    background: #f5f5f5;
    border-radius: 4px;
}

.aw-modal-body .file-details {
    flex: 1;
    min-width: 0;
}

.aw-modal-body .file-name {
    margin: 0 0 4px 0;
    font-weight: 600;
    color: #333;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.aw-modal-body .file-size {
    margin: 0;
    color: #666;
    font-size: 12px;
}

.aw-modal-body .remove-file {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    background: #f44336;
    color: #fff;
    font-size: 16px;
    line-height: 1;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s ease;
}

.aw-modal-body .remove-file:hover {
    background: #d32f2f;
}

/* Modal Notes Field */
.aw-modal-body .additional-notes {
    margin-bottom: 20px;
}

.aw-modal-body .additional-notes label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.aw-modal-body .additional-notes textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    box-sizing: border-box;
}

.aw-modal-body .additional-notes textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

/* Modal Form Actions */
.aw-modal-body .form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.aw-modal-body .form-actions button {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.aw-modal-body .form-actions button[type="submit"] {
    background: #0073aa;
    color: #fff;
    flex: 1;
}

.aw-modal-body .form-actions button[type="submit"]:hover {
    background: #005a87;
}

.aw-modal-body .form-actions button[type="submit"]:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.aw-modal-body .form-actions button[type="button"] {
    background: #f0f0f0;
    color: #333;
}

.aw-modal-body .form-actions button[type="button"]:hover {
    background: #e0e0e0;
}

/* Modal Upload Progress */
.aw-modal-body .upload-progress {
    margin: 20px 0;
}

.aw-modal-body .progress-bar {
    width: 100%;
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
}

.aw-modal-body .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0073aa, #00a0d2);
    width: 0;
    transition: width 0.3s ease;
}

.aw-modal-body .progress-text {
    margin-top: 8px;
    text-align: center;
    color: #666;
    font-size: 13px;
}

/* Modal Alerts */
.aw-modal-body .aw-alert {
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 6px;
    border: 1px solid;
    font-size: 14px;
}

.aw-modal-body .aw-alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.aw-modal-body .aw-alert-error {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

/* Modal Success State */
.aw-modal-body .aw-confirmation-uploaded {
    text-align: center;
    padding: 20px 0;
}

.aw-modal-body .aw-confirmation-uploaded .success-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.aw-modal-body .aw-confirmation-uploaded h4 {
    margin: 0 0 12px 0;
    font-size: 20px;
    color: #2e7d32;
}

.aw-modal-body .aw-confirmation-uploaded p {
    margin: 0 0 20px 0;
    color: #666;
}

/* Upload Button Styles */
.aw-open-payment-modal {
    display: inline-block;
    padding: 10px 20px;
    background: #0073aa;
    color: #fff !important;
    text-decoration: none !important;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.aw-open-payment-modal:hover {
    background: #005a87;
    color: #fff !important;
}

.aw-open-payment-modal:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Button in WooCommerce Orders Table */
.woocommerce-orders-table__cell-order-actions .aw-open-payment-modal {
    padding: 6px 12px;
    font-size: 12px;
    margin: 2px;
}

/* Button Container on Order Detail Page */
.aw-payment-confirmation-button-container {
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border-left: 4px solid #0073aa;
    border-radius: 4px;
}

.aw-payment-confirmation-button-container h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #0073aa;
}

.aw-payment-confirmation-button-container p {
    margin: 0 0 15px 0;
    color: #666;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .aw-modal-overlay {
        padding: 10px;
    }

    .aw-modal-container {
        max-height: 95vh;
        border-radius: 12px 12px 0 0;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        max-width: 100%;
        transform: translateY(100%);
    }

    .aw-modal-overlay.active .aw-modal-container {
        transform: translateY(0);
    }

    .aw-modal-header {
        padding: 16px 20px;
    }

    .aw-modal-header h3 {
        font-size: 18px;
    }

    .aw-modal-body {
        padding: 20px;
    }

    .aw-modal-body .aw-upload-area {
        padding: 30px 15px;
    }

    .aw-modal-body .upload-icon {
        font-size: 36px;
    }

    .aw-modal-body .file-info {
        flex-direction: column;
        text-align: center;
    }

    .aw-modal-body .file-info img,
    .aw-modal-body .file-icon {
        margin: 0 0 10px 0;
    }

    .aw-modal-body .form-actions {
        flex-direction: column;
    }

    .aw-modal-body .form-actions button {
        width: 100%;
    }
}

/* Body scroll lock when modal is open */
body.aw-modal-open {
    overflow: hidden;
}

/* Accessibility - Focus visible styles */
.aw-modal-container:focus {
    outline: none;
}

/* Animation for alerts */
@keyframes awModalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.aw-modal-body .aw-alert {
    animation: awModalFadeIn 0.3s ease;
}
