/* Settings Dashboard Styles */

/* Container */
.ldr-settings-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
}

.ldr-settings-header {
    margin-bottom: 1.5rem;
}

.ldr-settings-header h1 {
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
    font-weight: 600;
}

.ldr-settings-description {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.ldr-support-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.ldr-support-label {
    color: var(--text-secondary);
    margin-right: 0.5rem;
}

.ldr-support-note i {
    margin-right: 0.2rem;
}

.ldr-support-note a {
    color: var(--text-muted);
    text-decoration: none;
}

.ldr-support-note a:hover {
    color: var(--accent-tertiary);
    text-decoration: underline;
}

.ldr-community-note {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background-color: rgba(var(--accent-primary-rgb), 0.08);
    border-radius: 0.5rem;
    border-left: 3px solid var(--accent-primary);
}

.ldr-community-note i {
    color: var(--accent-primary);
    margin-right: 0.5rem;
}

.ldr-community-note a {
    color: var(--accent-tertiary);
    text-decoration: none;
    font-weight: 500;
}

.ldr-community-note a:hover {
    text-decoration: underline;
}

/* Card styling improvements */
.ldr-card {
    background-color: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    margin-bottom: 1.5rem;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.ldr-card-content {
    padding: 1.75rem;
}

/* Form */
.ldr-settings-form {
    margin-top: 1rem;
}

/* Tabs */
.ldr-settings-tabs {
    display: flex;
    margin: 0 0 1.5rem 0;
    overflow-x: auto;
    white-space: nowrap;
    gap: 0.75rem;
}

.ldr-settings-tab {
    padding: 0.6rem 1.2rem;
    cursor: pointer;
    color: var(--text-secondary);
    font-weight: 500;
    background-color: var(--bg-tertiary);
    border-radius: 2rem;
    transition: all 0.2s;
    text-align: center;
    border: 1px solid var(--border-color);
}

.ldr-settings-tab:hover {
    color: var(--text-primary);
    background-color: rgba(var(--accent-primary-rgb), 0.1);
}

.ldr-settings-tab.active {
    color: var(--text-primary);
    background-color: var(--accent-primary);
    box-shadow: 0 0 10px rgba(var(--accent-primary-rgb), 0.3);
    border-color: var(--accent-primary);
}

/* Remove the underline since we're using background color */
.ldr-settings-tab.active::after {
    display: none;
}

/* Cards */
.ldr-settings-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.ldr-settings-card {
    background-color: var(--bg-tertiary);
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

.ldr-settings-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(var(--shadow-color-rgb), 0.2);
    border-color: rgba(var(--accent-primary-rgb), 0.3);
}

.ldr-settings-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    color: var(--text-primary);
    background-color: rgba(var(--accent-primary-rgb), 0.1);
}

.ldr-settings-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.ldr-settings-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.ldr-settings-card-footer {
    margin-top: auto;
    display: flex;
    justify-content: flex-end;
}

/* Sections */
.ldr-settings-section {
    margin-bottom: 1.5rem;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(var(--shadow-color-rgb), 0.1);
}

.ldr-settings-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    cursor: pointer;
    background-color: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
}

.ldr-settings-section-header:hover {
    background-color: rgba(var(--accent-primary-rgb), 0.1);
}

.ldr-settings-section-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    max-width: 80%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ldr-settings-section-title i {
    margin-right: 0.5rem;
    color: var(--accent-primary);
    opacity: 0.8;
}

.ldr-settings-toggle-icon {
    transition: transform 0.3s;
    color: var(--accent-primary);
}

.ldr-settings-section-header.collapsed .ldr-settings-toggle-icon {
    transform: rotate(-90deg);
}

.ldr-settings-section-body.collapsed {
    display: none;
}

.ldr-settings-section-body {
    padding: 1.25rem;
    border-top: none;
}

.ldr-settings-group {
    margin-bottom: 1.5rem;
}

.ldr-settings-group-title {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
}

.ldr-settings-group-title i {
    margin-right: 8px;
}

.ldr-settings-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.ldr-settings-item {
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.ldr-settings-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.ldr-settings-item-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    min-height: 28px;
}

.ldr-settings-item-header label {
    font-weight: 600;
    margin-right: 0.5rem;
    color: var(--text-primary);
    max-width: 400px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ldr-settings-item-header label[title] {
    cursor: help;
}

.ldr-settings-item label {
    font-weight: 600;
    margin-right: 0.5rem;
    color: var(--text-primary);
}

.ldr-settings-tooltip {
    color: var(--text-secondary);
    cursor: help;
}

.ldr-settings-tooltip:hover::after {
    content: attr(title);
    position: absolute;
    top: 100%;
    right: 0;
    background-color: rgba(var(--shadow-color-rgb), 0.9);
    color: var(--text-primary);
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    max-width: 300px;
    white-space: normal;
    z-index: 10;
    margin-top: 5px;
}

.ldr-settings-tooltip:hover::before {
    content: '';
    position: absolute;
    top: 100%;
    right: 5px;
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent rgba(var(--shadow-color-rgb), 0.9) transparent;
    z-index: 10;
}

/* Inputs */
.ldr-settings-input,
.ldr-settings-textarea,
.ldr-settings-select {
    width: 100%;
    padding: 0.75rem;
    font-size: 0.9rem;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ldr-settings-textarea {
    min-height: 120px;
    font-family: monospace;
    white-space: pre;
}

.ldr-settings-textarea.ldr-json-content {
    font-family: 'Courier New', Courier, monospace;
}

.ldr-settings-input:focus,
.ldr-settings-textarea:focus,
.ldr-settings-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(var(--accent-primary-rgb), 0.3);
}

.ldr-settings-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M8 11l-6-6 1.5-1.5L8 8l4.5-4.5L14 5l-6 6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    padding-right: 2.5rem;
}

.ldr-settings-checkbox-container {
    margin: 0.5rem 0;
}

.ldr-settings-checkbox-container .ldr-checkbox-label {
    margin-bottom: 0.25rem;
}

.ldr-json-property-item .ldr-checkbox-label {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
}

.ldr-settings-checkbox {
    width: 18px;
    height: 18px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
}

.ldr-settings-range {
    flex: 1;
}

.ldr-settings-range-container {
    display: flex;
    align-items: center;
}

.ldr-settings-range-value {
    min-width: 40px;
    margin-left: 1rem;
    padding: 0.25rem 0.5rem;
    background-color: var(--accent-primary);
    color: white;
    border-radius: 0.25rem;
    text-align: center;
    font-size: 0.85rem;
}

.ldr-settings-help {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding-left: 24px;
}

.ldr-settings-error {
    border-color: var(--error-color) !important;
}

.ldr-settings-error-message {
    color: var(--error-color);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

/* Form Actions */
.ldr-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.ldr-settings-actions {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
    gap: 1.5rem;
}

.ldr-settings-modified {
    position: relative;
}

.ldr-json-content {
    font-family: monospace;
    white-space: pre-wrap;
    overflow-x: auto;
    font-size: 0.9rem;
    background-color: var(--bg-primary);
}

.ldr-settings-json-editor {
    position: relative;
    display: flex;
    flex-direction: column;
}

.ldr-settings-json-toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 5px;
    margin-bottom: 5px;
    background-color: var(--bg-tertiary);
    padding: 5px;
    border-radius: 4px;
}

.ldr-json-toolbar-btn {
    background-color: var(--bg-secondary);
    border: none;
    color: var(--text-primary);
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}

.ldr-json-toolbar-btn:hover {
    background-color: rgba(var(--accent-primary-rgb), 0.2);
}

/* Alert Messages */
.ldr-alert {
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
}

.ldr-alert i {
    margin-right: 0.75rem;
}

.ldr-alert-success {
    background-color: rgba(var(--success-color-rgb), 0.2);
    color: var(--success-color);
    border-left: 4px solid var(--success-color);
}

.ldr-alert-danger {
    background-color: rgba(var(--error-color-rgb), 0.2);
    color: var(--error-color);
    border-left: 4px solid var(--error-color);
}

.ldr-alert-info {
    background-color: rgba(var(--accent-tertiary-rgb), 0.2);
    color: var(--accent-tertiary);
    border-left: 4px solid var(--accent-tertiary);
}

.ldr-alert-warning {
    background-color: rgba(var(--warning-color-rgb), 0.2);
    color: var(--warning-color);
    border-left: 4px solid var(--warning-color);
}

/* Misc */
.ldr-empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

/* Loading indicator */
.ldr-loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
}

.ldr-loading-spinner.ldr-centered {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
}

.ldr-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(var(--highlight-color-rgb), 0.1);
    border-radius: 50%;
    border-top-color: var(--accent-primary);
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 1rem;
    position: relative;
    left: 0;
    top: 0;
}

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

/* Additional styles for main settings page */
.ldr-settings-section h2 {
    margin-bottom: 1rem;
    color: var(--accent-primary);
    font-size: 1.3rem;
}

.ldr-form-group {
    margin-bottom: 1rem;
}

.ldr-form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.ldr-form-control {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.ldr-form-row {
    display: flex;
    gap: 1rem;
}

.ldr-form-group.ldr-half {
    flex: 1;
}

.ldr-input-help {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.3rem;
    line-height: 1.3;
}

.ldr-input-warning {
    display: block;
    font-size: 0.85rem;
    color: var(--warning-color);
    margin-top: 0.3rem;
    line-height: 1.3;
}

.ldr-input-warning i {
    margin-right: 0.4rem;
}

.ldr-checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ldr-checkbox-group input {
    margin: 0;
}

.ldr-checkbox-group label {
    margin: 0;
}

.ldr-range-value {
    display: inline-block;
    margin-left: 0.5rem;
}

.ldr-editor-lang {
    background-color: var(--accent-primary);
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* Search controls */
.ldr-search-controls {
    margin-bottom: 1.5rem;
}

.ldr-search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.2s;
}

.ldr-search-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(var(--accent-primary-rgb), 0.2);
    outline: none;
}

/* Settings-specific colorful info boxes */
.ldr-provider-info,
.ldr-search-info,
.ldr-report-info,
.ldr-app-info {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border-radius: 0.375rem;
    border-left-width: 4px;
    border-left-style: solid;
}

.ldr-provider-info {
    background-color: rgba(var(--accent-primary-rgb), 0.1);
    border-left-color: var(--accent-primary);
}

.ldr-provider-info h3 {
    color: var(--accent-primary);
}

.ldr-search-info {
    background-color: rgba(var(--warning-color-rgb), 0.1);
    border-left-color: var(--warning-color);
}

.ldr-search-info h3 {
    color: var(--warning-color);
}

.ldr-report-info {
    background-color: rgba(var(--success-color-rgb), 0.1);
    border-left-color: var(--success-color);
}

.ldr-report-info h3 {
    color: var(--success-color);
}

.ldr-app-info {
    background-color: rgba(var(--accent-secondary-rgb), 0.15);
    border-left-color: var(--accent-secondary);
}

.ldr-app-info h3 {
    color: var(--accent-secondary);
}

.ldr-provider-info h3,
.ldr-search-info h3,
.ldr-report-info h3,
.ldr-app-info h3 {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.ldr-provider-info p,
.ldr-search-info p,
.ldr-report-info p,
.ldr-app-info p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.ldr-provider-info ul,
.ldr-search-info ul,
.ldr-report-info ul,
.ldr-app-info ul {
    margin-bottom: 0;
    padding-left: 1.5rem;
}

.ldr-provider-info li,
.ldr-search-info li,
.ldr-report-info li,
.ldr-app-info li {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

/* Collections config specific */
.ldr-file-path {
    background-color: var(--bg-secondary);
    padding: 0.75rem;
    border-radius: 4px;
    font-family: monospace;
    margin: 1rem 0;
    word-break: break-all;
    color: var(--text-primary);
}

.ldr-config-example {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    font-family: monospace;
    font-size: 0.9rem;
    padding: 1rem;
    border-radius: 4px;
    overflow: auto;
    white-space: pre;
    margin: 1rem 0;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 2rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    gap: 0.5rem;
}

.btn i {
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--accent-primary);
    color: var(--text-primary);
    box-shadow: 0 0 10px rgba(var(--accent-primary-rgb), 0.3);
}

.btn-primary:hover {
    background-color: var(--accent-secondary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--accent-primary-rgb), 0.4);
}

.ldr-btn-outline {
    background-color: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.ldr-btn-outline:hover {
    color: var(--text-primary);
    border-color: var(--accent-primary);
    background-color: rgba(var(--accent-primary-rgb), 0.1);
}

/* Raw JSON Configuration */
.ldr-raw-config-section {
    margin-top: 2rem;
    border-top: 1px solid rgba(var(--highlight-color-rgb), 0.05);
    padding-top: 1.5rem;
}

.ldr-section-header {
    margin-bottom: 1.5rem;
}

.ldr-section-header h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
}

.ldr-section-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.ldr-json-editor {
    width: 100%;
    min-height: 300px;
    padding: 1rem;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    resize: vertical;
    white-space: pre;
    overflow-x: auto;
}

.ldr-json-editor:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(var(--accent-primary-rgb), 0.2);
}

.ldr-toggle-raw-config {
    display: inline-flex;
    align-items: center;
    padding: 0.6rem 1.2rem;
    margin-top: 2rem;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 2rem;
    cursor: pointer;
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.2s;
    gap: 0.5rem;
}

.ldr-toggle-raw-config:hover {
    color: var(--text-primary);
    background-color: rgba(var(--accent-primary-rgb), 0.1);
    border-color: var(--accent-primary);
}

/* JSON Expanded Controls */
.ldr-json-expanded-controls {
    background-color: var(--bg-tertiary);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
}

.ldr-json-property-controls {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.ldr-json-property-item {
    margin-bottom: 0.5rem;
    padding: 1rem;
    background-color: var(--bg-secondary);
    border-radius: 6px;
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.ldr-json-property-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(var(--shadow-color-rgb), 0.2);
    border-color: rgba(var(--accent-primary-rgb), 0.4);
}

/* Property label with ellipsis for long text */
.ldr-json-property-item .ldr-property-label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    cursor: pointer;
}

/* Add explicit title for hover tooltip on long labels */
.ldr-json-property-item .ldr-property-label:hover {
    color: var(--accent-primary);
}

/* Checkbox wrapper for clickable area */
.ldr-checkbox-wrapper {
    cursor: pointer;
    padding: 0.5rem;
    margin: -0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.ldr-checkbox-wrapper:hover {
    background-color: rgba(var(--accent-primary-rgb), 0.1);
}

.ldr-json-property-item .ldr-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
    cursor: pointer;
}

.ldr-json-property-item .ldr-checkbox-text {
    font-size: 0.9rem;
    color: var(--text-primary);
    cursor: pointer;
}

.ldr-json-property-item .ldr-settings-input,
.ldr-json-property-item .ldr-settings-select {
    width: 100%;
    padding: 0.7rem;
    font-size: 0.9rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 4px;
}

.ldr-json-property-item .ldr-settings-input:focus,
.ldr-json-property-item .ldr-settings-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(var(--accent-primary-rgb), 0.3);
}

.ldr-json-property-item .ldr-settings-help {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-top: 0.5rem;
    opacity: 0.8;
}

/* Animations for expanded controls */
.ldr-json-expanded-controls {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Checkbox styling */
.ldr-checkbox-label {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    padding-left: 0;
    cursor: pointer;
    position: relative;
}

.ldr-checkbox-label input[type="checkbox"] {
    position: relative;
    width: 18px;
    height: 18px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    border: 2px solid var(--accent-primary);
    border-radius: 3px;
    background-color: var(--bg-secondary);
    cursor: pointer;
    margin: 0 8px 0 0;
    padding: 0;
    vertical-align: middle;
    transition: all 0.2s;
}

.ldr-checkbox-label input[type="checkbox"]:checked {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.ldr-checkbox-label input[type="checkbox"]:checked::after {
    content: '✓';
    color: white;
    font-size: 12px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.ldr-checkbox-label input[type="checkbox"]:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(var(--accent-primary-rgb), 0.3);
}

.ldr-checkbox-text {
    margin-left: 0;
    color: var(--text-primary);
    font-size: 14px;
    vertical-align: middle;
}

/* Boolean property items */
.ldr-json-property-item.ldr-boolean-property {
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    position: relative;
}

.ldr-json-property-item.ldr-boolean-property:hover {
    background-color: rgba(var(--accent-primary-rgb), 0.1);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(var(--shadow-color-rgb), 0.25);
}

.ldr-json-property-item.ldr-boolean-property:active {
    transform: translateY(0px);
    box-shadow: 0 2px 4px rgba(var(--shadow-color-rgb), 0.25);
}

.ldr-json-property-item.ldr-boolean-property:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    cursor: pointer;
}

.ldr-json-property-item.ldr-boolean-property .ldr-checkbox-wrapper,
.ldr-json-property-item.ldr-boolean-property .ldr-checkbox-label {
    background-color: transparent;
    cursor: pointer;
    padding: 0;
    margin: 0;
    position: relative;
    z-index: 2;
}

.ldr-json-property-item.ldr-boolean-property .ldr-checkbox-wrapper:hover {
    background-color: transparent;
}

.ldr-json-property-item.ldr-boolean-property .ldr-checkbox-text {
    cursor: pointer;
    position: relative;
    z-index: 2;
}

.ldr-json-property-item.ldr-boolean-property .ldr-property-label {
    cursor: pointer;
    position: relative;
    z-index: 2;
}

.ldr-json-property-item.ldr-boolean-property input[type="checkbox"] {
    cursor: pointer;
    margin-right: 8px;
    position: relative;
    z-index: 3;
}

/* Add styling for Reset to Defaults button */
#reset-to-defaults-button {
    margin-left: 10px;
    background-color: var(--error-color);
    color: var(--bg-primary);
    border: none;
}

#reset-to-defaults-button:hover {
    filter: brightness(0.85);
}

/* Add styling for Fix Corrupted Settings button */
#fix-corrupted-button {
    margin-left: 10px;
    background-color: var(--accent-primary);
    color: var(--bg-primary);
    border: none;
}

#fix-corrupted-button:hover {
    background-color: var(--accent-secondary);
}

.ldr-settings-item .ldr-checkbox-label {
    margin-top: 8px;
    padding-left: 0;
}

/* Saving indicator styles */
.ldr-saving {
    position: relative;
}

.ldr-saving:before {
    content: '';
    position: absolute;
    left: -20px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    border: 2px solid rgba(var(--accent-primary-rgb), 0.3);
    border-radius: 50%;
    border-top-color: var(--accent-primary);
    animation: spinner 0.8s linear infinite;
    z-index: 10;
}

.ldr-checkbox-label.ldr-saving:before {
    left: -20px;
    top: 50%;
}

.ldr-settings-item.ldr-saving:before {
    left: -20px;
}

.ldr-form-group.ldr-saving:before {
    left: -20px;
}

@keyframes spinner {
    to {transform: translateY(-50%) rotate(360deg);}
}

/* Add styles for alert container and close button */
.ldr-settings-alert-container {
    margin-bottom: 1rem;
    width: 100%;
}

.ldr-settings-alert-container .alert {
    position: relative;
    padding-right: 30px;
}

.ldr-alert-close {
    position: absolute;
    right: 10px;
    top: 8px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    opacity: 0.7;
    background: transparent;
    border: none;
    padding: 0;
    color: inherit;
}

.ldr-alert-close:hover {
    opacity: 1;
}

.ldr-alert-close:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
    opacity: 1;
    border-radius: 2px;
}

/* Data Location Section Styles */
.ldr-data-location-section {
    background-color: var(--bg-secondary) !important;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

/* Ensure all child elements don't have white backgrounds */
.ldr-data-location-section * {
    background-color: transparent;
}

.ldr-data-location-section > div {
    background-color: transparent !important;
}

.ldr-data-location-section .ldr-alert-warning {
    background: linear-gradient(135deg, rgba(var(--accent-primary-rgb), 0.15) 0%, rgba(var(--accent-secondary-rgb), 0.15) 100%) !important;
    background-color: transparent !important;
    border-left: 4px solid var(--accent-primary);
    color: var(--text-primary) !important;
    border-radius: 0.375rem;
    box-shadow: 0 2px 8px rgba(var(--accent-primary-rgb), 0.2);
}

/* Override any default alert styles */
.ldr-data-location-section .alert {
    background-color: transparent !important;
}

.ldr-data-location-section .ldr-alert-warning strong {
    color: var(--accent-secondary);
}

.ldr-data-location-section .ldr-alert-warning i {
    color: var(--accent-primary);
}

.ldr-data-location-section .ldr-alert-warning small {
    color: var(--text-secondary);
    display: block;
    margin-top: 0.25rem;
}

.ldr-data-location-details {
    padding: 1rem;
}

.ldr-data-location-details .ldr-settings-item {
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    background-color: var(--bg-tertiary) !important;
    border-radius: 0.375rem;
    border: 1px solid var(--border-color);
}

/* Override any card or container styles within data location */
.ldr-data-location-section .ldr-card,
.ldr-data-location-section .card-body,
.ldr-data-location-section .ldr-card-content {
    background-color: transparent !important;
}

.ldr-data-location-details .ldr-settings-label {
    color: var(--accent-secondary);
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ldr-data-location-details .ldr-settings-label i {
    color: var(--accent-primary);
}

.ldr-data-location-details .ldr-settings-value code {
    background-color: rgba(var(--shadow-color-rgb), 0.5);
    color: var(--accent-tertiary);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
}

.ldr-data-location-details .ldr-platform-defaults {
    list-style: none;
    padding: 0;
    margin-top: 0.5rem;
}

.ldr-data-location-details .ldr-platform-defaults li {
    padding: 0.375rem 0;
    color: var(--text-secondary);
}

.ldr-data-location-details .ldr-platform-defaults strong {
    color: var(--text-primary);
    margin-right: 0.5rem;
}

.ldr-data-location-details .ldr-badge-info {
    background-color: var(--accent-primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.ldr-data-location-details .text-success {
    color: var(--success-color);
}

.ldr-data-location-details .text-muted {
    color: var(--text-muted);
    font-style: italic;
}

/* Mobile responsive styles
   CSS cannot read custom properties in @media queries; keep 767px in sync with --ldr-mobile-max */
@media (max-width: 767px) {
    .ldr-settings-tabs {
        padding-bottom: 0.5rem;
        /* Add visual scroll indicator */
        box-shadow: inset -10px 0 10px -10px rgba(var(--shadow-color-rgb), 0.3);
    }

    .ldr-settings-tab {
        flex-shrink: 0; /* Prevent tabs from shrinking */
        min-width: fit-content;
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }

    /* Make it clear the tabs are scrollable */
    .ldr-settings-tabs::-webkit-scrollbar {
        height: 6px;
    }

    .ldr-settings-tabs::-webkit-scrollbar-track {
        background: var(--bg-tertiary);
        border-radius: 3px;
    }

    .ldr-settings-tabs::-webkit-scrollbar-thumb {
        background: var(--accent-primary);
        border-radius: 3px;
    }

    /* Cap tooltip width on small screens */
    .ldr-settings-tooltip:hover::after {
        max-width: 200px;
    }

    /* Fix grid layouts for mobile - CRITICAL for preventing overflow */
    .ldr-settings-cards,
    .ldr-settings-row,
    .ldr-search-engine-grid,
    .ldr-quick-actions,
    .ldr-json-property-controls {
        grid-template-columns: 1fr !important;
        gap: 0.75rem;
    }

    /* Settings container */
    .ldr-settings-container {
        padding: 0.5rem;
        max-width: 100%;
        overflow-x: hidden;
    }

    /* Settings page wrapper */
    #settings {
        max-width: 100%;
        overflow-x: hidden;
        padding: 0.5rem;
    }

    /* Settings header */
    .ldr-settings-header {
        padding: 0 0.5rem;
    }

    .ldr-settings-header h1 {
        font-size: 1.5rem;
    }

    /* Settings cards */
    .ldr-settings-card {
        padding: 1rem;
        max-width: 100%;
    }

    .ldr-settings-card h3 {
        font-size: 1rem;
    }

    /* Settings sections */
    .ldr-settings-section {
        margin: 0 0 1rem 0;
    }

    /* Section accordion header — every .ldr-settings-section-header is an
       accordion (the JS attaches a tap-to-toggle handler and a data-target
       pointing at a collapsible body). Row layout keeps the chevron affordance
       on the right where the user expects it; column layout buries the chevron
       under the title. 44px enforces the WCAG 2.5.5 touch-target floor. */
    .ldr-settings-section-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        min-height: 44px;
        padding: 0.75rem 1rem;
    }

    .ldr-settings-section-title {
        font-size: 1rem;
    }

    /* Settings items */
    .ldr-settings-item {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        padding: 0.75rem 0;
    }

    .ldr-settings-item-label {
        min-width: unset;
        width: 100%;
    }

    .ldr-settings-item-control {
        width: 100%;
    }

    /* Form controls */
    .ldr-settings-item input[type="text"],
    .ldr-settings-item input[type="number"],
    .ldr-settings-item input[type="url"],
    .ldr-settings-item select,
    .ldr-settings-item textarea {
        width: 100%;
        min-height: 44px;
    }

    /* Buttons */
    .ldr-settings-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .ldr-settings-actions button,
    .ldr-settings-actions .btn {
        width: 100%;
        min-height: 44px;
    }

    /* JSON controls */
    .ldr-json-controls {
        flex-direction: column;
        gap: 0.5rem;
    }

    .ldr-json-controls button {
        width: 100%;
    }

    /* Community note */
    .ldr-community-note {
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
    }

    /* Support note */
    .ldr-support-note {
        font-size: 0.75rem;
    }

    /* Card content padding */
    .ldr-card-content {
        padding: 1rem;
    }

    /* Description text */
    .ldr-settings-description {
        font-size: 0.85rem;
    }
}

/* Extra small phones */
@media (max-width: 380px) {
    .ldr-settings-page,
    #settings,
    .ldr-settings-container {
        padding: 0.25rem;
    }

    .ldr-settings-header h1 {
        font-size: 1.25rem;
    }

    .ldr-settings-tab {
        font-size: 0.8rem;
        padding: 0.4rem 0.75rem;
    }

    .ldr-settings-card {
        padding: 0.75rem;
    }
}
