<?php
/**
 * Author: Rymera Web Co.
 *
 * @package SAAI\Templates\Admin
 */

if ( ! defined( 'ABSPATH' ) ) {
    exit;
}
?>

<style>
/* Modal Styles */
.saai-image-alt-tags-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.saai-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.saai-modal-content {
    position: relative;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.saai-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #ddd;
    flex-shrink: 0;
}

.saai-modal-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.saai-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    color: #666;
    line-height: 1;
}

.saai-modal-close:hover {
    color: #000;
}

.saai-modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1 1 auto;
}

.saai-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid #ddd;
    background-color: #f8f9fa;
    flex-shrink: 0;
}

.saai-image-preview img {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px;
}

.saai-form-section {
    margin-bottom: 24px;
}

.saai-form-section h3 {
    margin: 0 0 16px 0;
    font-size: 14px;
    font-weight: 600;
    color: #23282d;
}

.saai-checkbox-group {
    display: grid;
    gap: 12px;
}

.saai-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
}

.saai-checkbox-label input[type="checkbox"] {
    margin-right: 8px;
}

.saai-current-values {
    margin-bottom: 24px;
    padding: 16px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e2e4e7;
}

.saai-current-values h3 {
    margin: 0 0 12px 0;
    font-size: 13px;
    font-weight: 600;
    color: #23282d;
}

.saai-current-values-empty {
    display: none;
    font-size: 12px;
    color: #666;
    font-style: italic;
}

.saai-current-values.empty .saai-current-values-empty {
    display: block;
}

.saai-current-field {
    margin-bottom: 8px;
    display: none;
    gap: 8px;
}

.saai-current-field.show {
    display: flex;
}

.saai-current-field:last-child {
    margin-bottom: 0;
}

.saai-current-field label {
    font-weight: 500;
    font-size: 12px;
    color: #666;
    min-width: 100px;
}

.saai-current-value {
    font-size: 12px;
    color: #23282d;
}

.saai-loading {
    text-align: center;
    padding: 40px 0;
}

.saai-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007cba;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.saai-results {
    margin-bottom: 24px;
    padding: 16px;
    background-color: #f0f8ff;
    border-radius: 4px;
    border: 1px solid #bee5eb;
}

.saai-results h3 {
    margin: 0 0 12px 0;
    font-size: 13px;
    font-weight: 600;
    color: #0c5460;
}

.saai-result-field {
    margin-bottom: 12px;
    display: none;
    gap: 8px;
}

.saai-result-field.show {
    display: flex;
}

.saai-result-field:last-child {
    margin-bottom: 0;
}

.saai-result-field label {
    font-weight: 500;
    font-size: 12px;
    color: #0c5460;
    min-width: 80px;
}

.saai-result-value {
    font-size: 12px;
    color: #0c5460;
    line-height: 1.4;
}

.saai-error {
    margin-bottom: 24px;
    padding: 12px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    color: #721c24;
    font-size: 13px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .saai-modal-content {
        width: 95%;
        margin: 20px;
    }

    .saai-modal-header,
    .saai-modal-body,
    .saai-modal-footer {
        padding: 16px 20px;
    }

    .saai-current-field {
        flex-direction: column;
        gap: 4px;
    }

    .saai-current-field label {
        min-width: auto;
    }

    .saai-result-field {
        flex-direction: column;
        gap: 4px;
    }

    .saai-result-field label {
        min-width: auto;
    }
}
</style>
