/**
 * Frontend Styles
 *
 * @package     UrbanThrifterGeoDirectoryAI
 * @subpackage  Assets/CSS
 * @file        wp-content/plugins/urbanthrifter-geodirectory-ai/assets/css/frontend.css
 * @since       1.0.0
 * @version     1.0.0
 * @date        February 13, 2025
 */

.utai-button-wrapper {
    display: block;
    text-align: right; /* Default alignment, can be overridden by JavaScript */
    margin-top: 10px;
    margin-bottom: 10px;
    margin-left: 0;
    margin-right: 0;
    /* JavaScript will apply custom margins from admin settings */
}

/* Legacy inline class - no longer used but kept for compatibility */
.utai-button-inline {
    display: inline-block;
    margin-left: 10px;
    margin-top: 0;
    margin-bottom: 0;
}

.utai-generate-button {
    /* Bootstrap classes handle most styling */
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.utai-generate-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.utai-icon {
    font-size: 16px;
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

.utai-loading-spinner {
    display: inline-block;
    font-size: 18px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Error message */
.utai-error-message {
    display: inline-block;
    padding: 8px 12px;
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 4px;
    color: #c33;
    font-size: 13px;
    margin-top: 8px;
}

/* Success message */
.utai-success-message {
    display: inline-block;
    padding: 8px 12px;
    background: #efe;
    border: 1px solid #cfc;
    border-radius: 4px;
    color: #3c3;
    font-size: 13px;
    margin-top: 8px;
}

/* Loading state for button */
.utai-generate-button.loading {
    background: #999;
    cursor: wait;
}

.utai-generate-button.loading:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(153, 153, 153, 0.3);
}

/* Modal/Popup Styles */
.utai-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999999;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.utai-modal-overlay.active {
    display: flex;
}

.utai-modal {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: utaiModalSlideIn 0.3s ease-out;
}

@keyframes utaiModalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.utai-modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.utai-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;
}

.utai-modal-close:hover {
    color: #333;
}

.utai-modal-body {
    padding: 25px;
}

.utai-modal-intro {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-left: 3px solid #3498db;
    border-radius: 4px;
}

.utai-modal-intro p {
    margin: 0;
    color: #555;
    font-size: 14px;
    line-height: 1.5;
}

.utai-form-group {
    margin-bottom: 20px;
}

.utai-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.utai-form-group label .required {
    color: #e74c3c;
    margin-left: 3px;
}

.utai-form-group label .optional {
    color: #999;
    font-weight: 400;
    font-size: 13px;
    margin-left: 5px;
}

.utai-form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.2s;
}

.utai-form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.utai-form-group textarea.error {
    border-color: #e74c3c;
}

.utai-form-group .helper-text {
    display: block;
    margin-top: 5px;
    font-size: 13px;
    color: #666;
}

.utai-form-group .error-text {
    display: none;
    margin-top: 5px;
    font-size: 13px;
    color: #e74c3c;
}

.utai-form-group textarea.error + .error-text {
    display: block;
}

.utai-modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.utai-modal-button {
    /* Bootstrap .btn classes handle most styling */
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.utai-modal-button .spinner {
    display: none;
}

.utai-modal-button.loading .spinner {
    display: inline-block;
    animation: spin 1s linear infinite;
}

.utai-modal-button.loading .text {
    opacity: 0.7;
}

/* Responsive */
@media (max-width: 600px) {
    /* On mobile, stack button below label */
    .utai-button-inline {
        display: block;
        margin-left: 0;
        margin-top: 8px;
        margin-bottom: 8px;
    }
    
    .utai-generate-button {
        width: auto;
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .utai-button-wrapper {
        display: block;
    }
    
    .utai-modal {
        max-width: 95%;
        margin: 10px;
    }
    
    .utai-modal-header,
    .utai-modal-body,
    .utai-modal-footer {
        padding: 15px;
    }
    
    .utai-modal-footer {
        flex-direction: column;
    }
    
    .utai-modal-button {
        width: 100%;
    }
}

/*END FILE*/
