/**
 * Estilos Frontend - Web to Flutter App
 */

/* === RESET Y BASE === */
.webtoapp-form-container *,
.webtoapp-shortcode-container *,
.webtoapp-status-container * {
    box-sizing: border-box;
}

/* === CONTENEDORES PRINCIPALES === */
.webtoapp-form-container,
.webtoapp-shortcode-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
}

.webtoapp-shortcode-title {
    text-align: center;
    margin-bottom: 10px;
    color: #2196F3;
    font-size: 2em;
    font-weight: 600;
}

.webtoapp-shortcode-description {
    text-align: center;
    margin-bottom: 30px;
    color: #666;
    font-size: 1.1em;
}

/* === FORMULARIO === */
.webtoapp-form {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin-bottom: 20px;
}

.webtoapp-form-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.webtoapp-form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.webtoapp-form-section h3 {
    margin: 0 0 20px 0;
    padding: 0;
    color: #2196F3;
    font-size: 1.3em;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.webtoapp-form-section h3:before {
    content: "📱";
    margin-right: 10px;
    font-size: 1.2em;
}

/* === CAMPOS DEL FORMULARIO === */
.webtoapp-form-row {
    margin-bottom: 20px;
}

.webtoapp-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.webtoapp-label .required {
    color: #e74c3c;
    margin-left: 3px;
}

.webtoapp-input,
.webtoapp-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #fff;
}

.webtoapp-input:focus,
.webtoapp-textarea:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.webtoapp-input:invalid {
    border-color: #e74c3c;
}

.webtoapp-input:valid {
    border-color: #27ae60;
}

.webtoapp-number-input {
    width: 120px;
}

.webtoapp-help-text {
    margin-top: 5px;
    font-size: 0.9em;
    color: #666;
    font-style: italic;
}

/* === CAMPOS ESPECIALES === */
.webtoapp-checkbox-row {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
}

.webtoapp-checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-weight: normal;
    line-height: 1.4;
}

.webtoapp-checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 4px 12px 0 0;
    transform: scale(1.2);
    accent-color: #2196F3;
}

.webtoapp-checkbox-text {
    flex: 1;
}

.webtoapp-color-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.webtoapp-color-row .webtoapp-label {
    margin-bottom: 0;
    flex: 1;
}

.webtoapp-color-input {
    width: 60px;
    height: 40px;
    padding: 4px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    cursor: pointer;
    background: none;
}

.webtoapp-color-input::-webkit-color-swatch-wrapper {
    padding: 0;
}

.webtoapp-color-input::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

/* === BOTONES === */
.webtoapp-button {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    line-height: 1.4;
}

.webtoapp-button-primary {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
}

.webtoapp-button-primary:hover {
    background: linear-gradient(135deg, #1976D2, #1565C0);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.4);
}

.webtoapp-button-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.webtoapp-button-secondary {
    background: #f8f9fa;
    color: #2196F3;
    border: 2px solid #e1e5e9;
    margin-right: 10px;
}

.webtoapp-button-secondary:hover {
    background: #e3f2fd;
    border-color: #2196F3;
}

/* === ACCIONES DEL FORMULARIO === */
.webtoapp-form-actions {
    margin-top: 30px;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.webtoapp-form-actions .webtoapp-button {
    margin: 0 10px 10px 0;
}

/* === VERIFICACIÓN DE URL === */
.webtoapp-verification-result {
    margin-top: 10px;
    padding: 10px;
    border-radius: 6px;
    font-size: 0.9em;
}

.webtoapp-verification-result.webtoapp-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.webtoapp-verification-result.webtoapp-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* === RESULTADOS === */
.webtoapp-result {
    margin-top: 20px;
    padding: 20px;
    border-radius: 8px;
    font-size: 16px;
}

.webtoapp-result.webtoapp-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.webtoapp-result.webtoapp-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.webtoapp-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    padding: 15px;
    border-radius: 6px;
}

.webtoapp-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 15px;
    border-radius: 6px;
}

/* === PROGRESO === */
.webtoapp-progress-container {
    margin-top: 20px;
}

.webtoapp-progress-bar {
    width: 100%;
    height: 12px;
    background: #e9ecef;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.webtoapp-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2196F3, #4CAF50);
    transition: width 0.3s ease;
    border-radius: 6px;
}

.webtoapp-progress-text {
    display: block;
    text-align: center;
    margin-top: 8px;
    font-size: 0.9em;
    color: #666;
    font-weight: 600;
}

/* === DESCARGAS === */
.webtoapp-downloads {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e1e5e9;
}

.webtoapp-downloads h4 {
    margin: 0 0 15px 0;
    color: #2196F3;
}

.webtoapp-download-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.webtoapp-download-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.webtoapp-download-button:hover {
    background: linear-gradient(135deg, #45a049, #3d8b40);
    transform: translateY(-1px);
    text-decoration: none;
    color: white;
}

.webtoapp-download-icon {
    font-size: 1.2em;
}

/* === WOOCOMMERCE === */
.webtoapp-woocommerce-form {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 30px;
}

.webtoapp-product-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.webtoapp-product-title {
    color: #2196F3;
    margin-bottom: 10px;
    font-size: 2em;
    font-weight: 600;
}

.webtoapp-product-description {
    color: #666;
    font-size: 1.1em;
    margin-bottom: 20px;
}

.webtoapp-product-price {
    font-size: 1.5em;
    font-weight: 700;
}

.webtoapp-price-label {
    color: #666;
    font-weight: 400;
    margin-right: 10px;
}

.webtoapp-price-amount {
    color: #2196F3;
}

/* === ESTADO DEL TRABAJO === */
.webtoapp-status-container {
    max-width: 600px;
    margin: 20px auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 30px;
}

.webtoapp-status-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.webtoapp-status-header h3 {
    color: #2196F3;
    margin-bottom: 10px;
    font-size: 1.5em;
}

.webtoapp-app-name {
    font-size: 1.2em;
    font-weight: 600;
    color: #333;
}

.webtoapp-status-info {
    margin-bottom: 30px;
}

.webtoapp-status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}

.webtoapp-status-row:last-child {
    border-bottom: none;
}

.webtoapp-status-label {
    font-weight: 600;
    color: #666;
}

.webtoapp-status-value {
    font-weight: 600;
}

/* Estados específicos */
.webtoapp-status-pending {
    color: #ffa726;
}

.webtoapp-status-processing {
    color: #42a5f5;
}

.webtoapp-status-building {
    color: #ab47bc;
}

.webtoapp-status-completed {
    color: #66bb6a;
}

.webtoapp-status-failed {
    color: #ef5350;
}

.webtoapp-status-actions {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.webtoapp-error-message {
    background: #ffebee;
    border: 1px solid #ffcdd2;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.webtoapp-error-message h4 {
    margin: 0 0 10px 0;
    color: #c62828;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .webtoapp-form-container,
    .webtoapp-shortcode-container {
        padding: 15px;
    }
    
    .webtoapp-form,
    .webtoapp-woocommerce-form,
    .webtoapp-status-container {
        padding: 20px;
    }
    
    .webtoapp-color-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .webtoapp-form-actions {
        text-align: center;
    }
    
    .webtoapp-form-actions .webtoapp-button {
        display: block;
        width: 100%;
        margin: 0 0 10px 0;
    }
    
    .webtoapp-download-buttons {
        flex-direction: column;
    }
    
    .webtoapp-download-button {
        justify-content: center;
    }
    
    .webtoapp-status-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .webtoapp-status-value {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .webtoapp-shortcode-title {
        font-size: 1.5em;
    }
    
    .webtoapp-product-title {
        font-size: 1.5em;
    }
    
    .webtoapp-checkbox-label {
        font-size: 0.9em;
    }
    
    .webtoapp-button {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* === ANIMACIONES === */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.webtoapp-form-section {
    animation: slideIn 0.3s ease-out;
}

/* === UTILIDADES === */
.webtoapp-text-center {
    text-align: center;
}

.webtoapp-mb-20 {
    margin-bottom: 20px;
}

.webtoapp-mt-20 {
    margin-top: 20px;
}

.webtoapp-hidden {
    display: none;
}

.webtoapp-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.webtoapp-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #2196F3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* === ESTILOS ESPECÍFICOS === */
.webtoapp-style-woocommerce {
    border: 2px solid #2196F3;
}

.webtoapp-style-default .webtoapp-form-section h3:before {
    content: "⚙️";
}

.webtoapp-style-woocommerce .webtoapp-form-section h3:before {
    content: "🛒";
} 