/**
 * Listing Data Form Styles
 * Using ldf-* prefix to avoid conflicts with UiCore Elements (ui-e-*)
 */

.ldf-form-wrapper {
    width: 100%;
}

.ldf-form {
    width: 100%;
}

.ldf-form-fields {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -8px; /* Negative margin for gap compensation */
    padding: 0;
}

.ldf-field-group {
    margin-bottom: 16px;
    box-sizing: border-box;
    padding: 0 8px; /* Half of gap for proper spacing */
}

.ldf-field-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
}

.ldf-field-label .ldf-required {
    color: #e74c3c;
    margin-left: 3px;
}

.ldf-field,
.ldf-field-textarea,
.ldf-field-select {
    width: 100%;
    padding: 12px 15px;
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.ldf-field:focus,
.ldf-field-textarea:focus,
.ldf-field-select:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.ldf-field-textarea {
    resize: vertical;
    min-height: 100px;
}

.ldf-field-checkbox-group,
.ldf-field-radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ldf-field-checkbox-group.ldf-inline-list,
.ldf-field-radio-group.ldf-inline-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 15px;
}

.ldf-checkbox-label,
.ldf-radio-label,
.ldf-acceptance-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

.ldf-field-checkbox,
.ldf-field-radio {
    width: auto;
    margin: 0;
    cursor: pointer;
}

.ldf-form-messages {
    margin: 20px 0;
}

.ldf-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
}

.ldf-alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.ldf-alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.ldf-alert-icon {
    font-weight: bold;
    font-size: 18px;
}

.ldf-form-submit {
    margin-top: 20px;
}

.ldf-submit-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.5;
    color: #fff;
    background-color: #0066cc;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease;
    min-width: 120px;
}

.ldf-submit-button:hover {
    background-color: #0052a3;
}

.ldf-submit-button:active {
    transform: translateY(1px);
}

.ldf-submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ldf-button-spinner {
    display: inline-flex;
    animation: ldf-spin 1s linear infinite;
}

.ldf-button-spinner svg {
    animation: ldf-spin 1s linear infinite;
}

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

/* Acceptance field specific styling */
.ldf-field-acceptance {
    display: block;
}

.ldf-acceptance-text {
    user-select: none;
}

/* Responsive */
@media (max-width: 768px) {
    .ldf-field-group {
        width: 100% !important;
        flex: 0 0 100% !important;
    }
    
    .ldf-field-checkbox-group.ldf-inline-list,
    .ldf-field-radio-group.ldf-inline-list {
        flex-direction: column;
    }
}
