/* Review Form Block - Frontend Styles pre ADMR plugin */

.review-form-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    position: relative;
}

/* Loading State */
.review-form-container.form-submitting {
    opacity: 0.7;
    pointer-events: none;
}

.review-form-container.form-submitting::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* Form Elements */
.review-form-container .acf-field {
    margin-bottom: 1.5rem;
}

.review-form-container .acf-label label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: inherit;
}

.review-form-container .acf-input input,
.review-form-container .acf-input textarea,
.review-form-container .acf-input select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.review-form-container .acf-input input:focus,
.review-form-container .acf-input textarea:focus,
.review-form-container .acf-input select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

/* Submit Button */
.review-form-container .acf-form-submit input[type="submit"] {
    background: #0073aa;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.review-form-container .acf-form-submit input[type="submit"]:hover {
    background: #005a87;
}

.review-form-container .acf-form-submit input[type="submit"]:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Debug Mode */
.review-form-debug {
    font-family: 'Courier New', monospace;
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding: 10px;
    margin-bottom: 20px;
    font-size: 12px;
}

.review-form-debug strong {
    color: #1976d2;
}

/* Error Messages */
.acf-error-message {
    color: #d32f2f;
    font-size: 12px;
    margin-top: 5px;
}

.acf-field.acf-error .acf-input input,
.acf-field.acf-error .acf-input textarea,
.acf-field.acf-error .acf-input select {
    border-color: #d32f2f;
}

/* Success Messages */
.acf-notice {
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.acf-notice.-success {
    background: #e8f5e8;
    border: 1px solid #4caf50;
    color: #2e7d2e;
}

.acf-notice.-error {
    background: #ffebee;
    border: 1px solid #f44336;
    color: #c62828;
}

/* File Upload Fields */
.review-form-container .acf-field-image,
.review-form-container .acf-field-file {
    position: relative;
}

.review-form-container .acf-image-uploader,
.review-form-container .acf-file-uploader {
    border: 2px dashed #ddd;
    border-radius: 4px;
    padding: 20px;
    text-align: center;
    transition: border-color 0.3s ease;
}

.review-form-container .acf-image-uploader:hover,
.review-form-container .acf-file-uploader:hover {
    border-color: #0073aa;
}

.review-form-container .acf-image-uploader .acf-button,
.review-form-container .acf-file-uploader .acf-button {
    background: #0073aa;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.review-form-container .acf-image-uploader .acf-button:hover,
.review-form-container .acf-file-uploader .acf-button:hover {
    background: #005a87;
}

/* Gallery Field Integration */
.review-form-container .cgu-uploader-container {
    margin-bottom: 1.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .review-form-container {
        padding: 20px;
    }
    
    .review-form-container .acf-form-submit input[type="submit"] {
        width: 100%;
        padding: 15px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .review-form-container {
        padding: 15px;
    }
    
    .review-form-container .acf-input input,
    .review-form-container .acf-input textarea,
    .review-form-container .acf-input select {
        font-size: 16px; /* Prevents zoom on mobile */
    }
}

/* Custom Title Field */
.review-form-container .acf-field-text input[name="custom_post_title"] {
    border: 2px solid #0073aa;
    background: #f9f9f9;
}

.review-form-container .acf-field-text input[name="custom_post_title"]:focus {
    background: white;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

/* Form Animations */
.review-form-container .acf-field {
    animation: fadeInUp 0.3s ease-out;
    animation-fill-mode: both;
}

.review-form-container .acf-field:nth-child(1) { animation-delay: 0.1s; }
.review-form-container .acf-field:nth-child(2) { animation-delay: 0.2s; }
.review-form-container .acf-field:nth-child(3) { animation-delay: 0.3s; }
.review-form-container .acf-field:nth-child(4) { animation-delay: 0.4s; }
.review-form-container .acf-field:nth-child(5) { animation-delay: 0.5s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Honeypot field (hidden spam protection) */
.review-form-container .acf-field.acf-field-honeypot {
    display: none !important;
}

/* Loading Spinner */
.review-form-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

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

/* Focus Management */
.review-form-container *:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.review-form-container .acf-input input:focus,
.review-form-container .acf-input textarea:focus,
.review-form-container .acf-input select:focus {
    outline: none; /* Custom focus styles already applied above */
}

/* Print Styles */
@media print {
    .review-form-container {
        background: none !important;
        box-shadow: none !important;
    }
    
    .review-form-debug {
        display: none;
    }
}
