/* Estilos para el frontend del plugin */

.ace-high-form {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 25px;
    margin: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.ace-high-form-title {
    color: #333;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #0073aa;
}

.ace-high-form-description {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.ace-high-form-description p {
    margin-bottom: 0;
}

/* Campos del formulario */
.ace-high-field {
    margin-bottom: 20px;
}

.ace-high-field label {
    display: block;
    color: #333;
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 14px;
}

.ace-high-field .required {
    color: #dc3545;
    font-weight: 600;
}

.ace-high-input,
.ace-high-textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.4;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.ace-high-input:focus,
.ace-high-textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0,115,170,0.1);
}

.ace-high-input.error,
.ace-high-textarea.error {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220,53,69,0.1);
}

.ace-high-textarea {
    resize: vertical;
    min-height: 100px;
}

/* Checkbox */
.ace-high-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
}

.ace-high-checkbox-label input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    border: 2px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
}

.ace-high-checkbox-label input[type="checkbox"]:checked {
    background-color: #0073aa;
    border-color: #0073aa;
}

.ace-high-checkbox-label input[type="checkbox"]:checked::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* Descripción de campo */
.ace-high-field-description {
    display: block;
    color: #666;
    font-size: 12px;
    margin-top: 5px;
    font-style: italic;
}

/* Acciones del formulario */
.ace-high-form-actions {
    margin-top: 25px;
    text-align: center;
}

.ace-high-submit-btn {
    background: #0073aa;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ace-high-submit-btn:hover {
    background: #005a87;
    transform: translateY(-1px);
}

.ace-high-submit-btn:active {
    transform: translateY(0);
}

.ace-high-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.ace-high-submit-btn.loading {
    position: relative;
    color: transparent;
}

.ace-high-submit-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: ace-high-spin 1s linear infinite;
}

@keyframes ace-high-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Mensajes del formulario */
.ace-high-form-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 6px;
    font-weight: 500;
}

.ace-high-form-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.ace-high-form-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.ace-high-form-message.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Validación */
.ace-high-field-error {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

/* Vista previa del formulario */
.ace-high-form-preview {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border: 2px dashed #0073aa;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
}

.ace-high-preview-content {
    background: white;
    padding: 15px;
    border-radius: 4px;
    min-height: 100px;
    position: relative;
}

.ace-high-preview-content[style*="background-image"] {
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ace-high-preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    padding: 15px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.ace-high-preview-fields {
    line-height: 1.6;
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 600px;
    text-align: center;
}

.ace-high-preview-field p {
    margin: 0 0 10px 0;
    padding: 5px 0;
    color: #333;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    min-height: 20px;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
    text-align: center;
}

.ace-high-custom-dropdown {
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    position: relative;
}

.ace-high-custom-dropdown.collapsed .ace-high-dropdown-options {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    background: white;
    max-height: 200px;
    overflow-y: auto;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.ace-high-custom-dropdown.expanded .ace-high-dropdown-options {
    display: block;
    max-height: 200px;
    overflow-y: auto;
}

.ace-high-dropdown-selected {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    min-height: 40px;
}

.ace-high-dropdown-options {
    border-top: 1px solid #eee;
}

.ace-high-dropdown-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
}

.ace-high-dropdown-option:last-child {
    border-bottom: none;
}

.ace-high-dropdown-option:hover {
    background-color: #f5f5f5;
}

.ace-high-dropdown-option.selected {
    background-color: #e9ecef;
    font-weight: 500;
}

.ace-high-option-image {
    width: 24px;
    height: 24px;
    object-fit: cover;
    border-radius: 3px;
    border: 1px solid #ddd;
    flex-shrink: 0;
}

.ace-high-option-label {
    flex: 1;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .ace-high-form {
        padding: 20px;
        margin: 15px 0;
    }
    
    .ace-high-form-title {
        font-size: 20px;
    }
    
    .ace-high-input,
    .ace-high-textarea {
        padding: 10px 12px;
    }
    
    .ace-high-submit-btn {
        width: 100%;
        padding: 14px;
    }
}

@media screen and (max-width: 480px) {
    .ace-high-form {
        padding: 15px;
    }
    
    .ace-high-form-title {
        font-size: 18px;
    }
    
    .ace-high-input,
    .ace-high-textarea {
        padding: 8px 10px;
        font-size: 13px;
    }
}

/* Tema oscuro (si el sitio lo soporta) */
@media (prefers-color-scheme: dark) {
    .ace-high-form {
        background: #2d2d2d;
        border-color: #444;
        color: #fff;
    }
    
    .ace-high-form-title {
        color: #fff;
        border-bottom-color: #0073aa;
    }
    
    .ace-high-form-description {
        color: #ccc;
    }
    
    .ace-high-field label {
        color: #fff;
    }
    
    .ace-high-input,
    .ace-high-textarea {
        background: #333;
        border-color: #555;
        color: #fff;
    }
    
    .ace-high-input:focus,
    .ace-high-textarea:focus {
        border-color: #0073aa;
    }
    
    .ace-high-field-description {
        color: #aaa;
    }
}

/* Variaciones de color personalizables */
.ace-high-form.style-modern .ace-high-form-title {
    color: var(--ace-high-title-color, #333);
    border-bottom-color: var(--ace-high-accent-color, #0073aa);
}

.ace-high-form.style-modern .ace-high-input,
.ace-high-form.style-modern .ace-high-textarea {
    border-color: var(--ace-high-border-color, #ddd);
}

.ace-high-form.style-modern .ace-high-input:focus,
.ace-high-form.style-modern .ace-high-textarea:focus {
    border-color: var(--ace-high-accent-color, #0073aa);
}

.ace-high-form.style-modern .ace-high-submit-btn {
    background: var(--ace-high-button-color, #0073aa);
}

.ace-high-form.style-modern .ace-high-submit-btn:hover {
    background: var(--ace-high-button-hover-color, #005a87);
}

.ace-high-form.style-minimal {
    border: none;
    box-shadow: none;
    padding: 0;
}

.ace-high-form.style-minimal .ace-high-form-title {
    border-bottom: 1px solid #eee;
    font-size: 20px;
}

.ace-high-form.style-minimal .ace-high-input,
.ace-high-form.style-minimal .ace-high-textarea {
    border: none;
    border-bottom: 2px solid #ddd;
    border-radius: 0;
    padding: 8px 0;
}

.ace-high-form.style-minimal .ace-high-input:focus,
.ace-high-form.style-minimal .ace-high-textarea:focus {
    border-bottom-color: #0073aa;
    box-shadow: none;
}
