/* ========================================
   SI2 API Single Meta Widget Styles
   ======================================== */

.si2-api-single-meta-widget {
    width: 100%;
    max-width: 100%;
}

/* Loading & Error States */
.si2-loading-state,
.si2-error-state {
    padding: 40px 20px;
    text-align: center;
    color: #666;
}

.si2-error-state {
    color: #f44336;
}

/* Form Container */
.si2-form-container {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Form Fields Grid */
.si2-form-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 24px;
}

/* Field Widths */
.si2-form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.si2-field-large {
    flex: 0 0 100%;
}

.si2-field-medium {
    flex: 0 0 calc(50% - 10px);
}

.si2-field-small {
    flex: 0 0 calc(33.333% - 14px);
}

/* Field Header (tipo header) */
.si2-field-header {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

/* Field Label */
.si2-field-label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin: 0;
}

/* Field Input (edit mode) */
.si2-field-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd !important;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
    background: #fff;
    transition: border-color 0.2s;
}

.si2-field-input:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

/* Readonly/Disabled Fields */
.si2-field-input[readonly],
.si2-field-input[disabled] {
    background-color: #f5f5f5;
    color: #666;
    cursor: not-allowed;
    border-color: #e0e0e0;
}

.si2-field-input[readonly]:focus,
.si2-field-input[disabled]:focus {
    border-color: #e0e0e0;
    box-shadow: none;
}

select.si2-field-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23666' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

textarea.si2-field-input {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

/* Field Value (read-only mode) */
.si2-field-value {
    padding: 10px 12px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
    min-height: 42px;
    display: flex;
    align-items: center;
}

/* Form Actions */
.si2-form-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.si2-save-button {
    padding: 12px 32px;
    background: #2196F3;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.si2-save-button:hover {
    background: #1976D2;
}

.si2-save-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.si2-save-message {
    font-size: 14px;
    font-weight: 500;
}

/* Responsive: Tablet */
@media (max-width: 768px) {
    .si2-field-medium,
    .si2-field-small {
        flex: 0 0 100%;
    }
    
    .si2-form-container {
        padding: 20px;
    }
    
    .si2-form-fields {
        gap: 16px;
    }
}

/* Responsive: Mobile */
@media (max-width: 480px) {
    .si2-form-container {
        padding: 16px;
        border-radius: 0;
    }
    
    .si2-form-fields {
        gap: 12px;
    }
    
    .si2-field-label {
        font-size: 13px;
    }
    
    .si2-field-input,
    .si2-field-value {
        font-size: 13px;
        padding: 8px 10px;
    }
    
    .si2-save-button {
        width: 100%;
        padding: 10px;
    }
    
    .si2-form-actions {
        flex-direction: column;
        gap: 12px;
    }
}
