/**
 * Witness Select Field Styles
 */

.itnj-witness-select-wrapper {
    position: relative;
}

.itnj-witness-select-field {
    width: 100%;
    min-height: 32px;
    font-size: 13px;
    line-height: 1.4;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background-color: #fff;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.07);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.itnj-witness-select-field:focus {
    border-color: #007cba;
    box-shadow: 0 0 0 1px #007cba;
    outline: none;
}

.itnj-witness-select-field:disabled {
    background-color: #f7f7f7;
    color: #666;
    cursor: not-allowed;
}

.itnj-field-notice {
    margin: 4px 0 0 0;
    padding: 4px 8px;
    font-size: 11px;
    color: #666;
    background-color: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 3px;
    font-style: italic;
}

.itnj-field-notice.loading {
    color: #007cba;
    background-color: #e7f3ff;
    border-color: #007cba;
}

.itnj-field-notice.error {
    color: #d63384;
    background-color: #f8d7da;
    border-color: #d63384;
}

.itnj-field-notice.success {
    color: #198754;
    background-color: #d1e7dd;
    border-color: #198754;
}

/* Commission dependency indicator */
.itnj-witness-select-wrapper.no-commission {
    opacity: 0.6;
}

.itnj-witness-select-wrapper.no-commission .itnj-witness-select-field {
    cursor: not-allowed;
    background-color: #f7f7f7;
}

/* Loading state */
.itnj-witness-select-wrapper.loading .itnj-witness-select-field {
    background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12a9 9 0 11-6.219-8.56"/></svg>');
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    animation: itnj-spin 1s linear infinite;
    padding-right: 32px;
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
    .itnj-witness-select-field {
        font-size: 16px; /* Prevents zoom on iOS */
        min-height: 36px;
    }
    
    .itnj-field-notice {
        font-size: 12px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .itnj-witness-select-field {
        background-color: #1e1e1e;
        border-color: #444;
        color: #fff;
    }
    
    .itnj-witness-select-field:focus {
        border-color: #0073aa;
        box-shadow: 0 0 0 1px #0073aa;
    }
    
    .itnj-field-notice {
        background-color: #2a2a2a;
        border-color: #444;
        color: #ccc;
    }
}

/* ACF integration styles */
.acf-field-itnj-witness-select .acf-label {
    margin-bottom: 8px;
}

.acf-field-itnj-witness-select .acf-input {
    position: relative;
}

/* Field group integration */
.acf-fields .acf-field-itnj-witness-select {
    margin-bottom: 20px;
}

.acf-fields .acf-field-itnj-witness-select:last-child {
    margin-bottom: 0;
}

/* Error state styles */
.acf-field-itnj-witness-select.acf-error .itnj-witness-select-field {
    border-color: #d63384;
}

.acf-field-itnj-witness-select.acf-error .acf-error-message {
    color: #d63384;
    font-size: 11px;
    margin-top: 4px;
}

/* Field settings styles (for ACF field group editor) */
.acf-field-setting-commission-field input {
    width: 100%;
}

.acf-field-setting-status-filter select,
.acf-field-setting-witness-types select {
    width: 100%;
}