.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.modal-overlay .modal {
    background: var(--bg-secondary);
    border: 1px solid rgba(100, 140, 220, 0.15);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 400px;
    margin: 16px;
    transform: scale(0.95);
    transition: transform 0.2s;
    box-shadow: var(--shadow-lg), 0 0 40px rgba(51, 136, 255, 0.06);
}

.modal-overlay.visible .modal {
    transform: scale(1);
}

.modal-overlay .modal-header {
    padding: 20px 24px 0;
}

.modal-overlay .modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--accent) 0%, var(--neon-pink) 50%, var(--neon-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 12px rgba(255, 68, 170, 0.4));
}

.modal-overlay .modal-body {
    padding: 16px 24px;
}

.modal-overlay .modal-body p {
    margin: 0 0 12px;
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.5;
}

.modal-overlay .modal-body p:last-child {
    margin-bottom: 0;
}

.modal-overlay .modal-body .text-muted {
    color: var(--text-secondary);
    font-size: 13px;
}

.modal-overlay .modal-footer {
    padding: 16px 24px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.loading-dots::after {
    content: '';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

.empty-state {
    padding: 3rem 1.5rem;
    text-align: center;
}

.empty-state-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    color: var(--text-muted);
    opacity: 0.4;
}

.empty-state-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.empty-state-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.results-pagination,
.hits-pagination {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    padding: 1rem;
    border-top: 1px solid var(--border-color);
}

.page-btn {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.page-btn:hover:not(:disabled) {
    background: var(--bg-secondary);
    border-color: rgba(0, 170, 255, 0.5);
    color: var(--text-primary);
    box-shadow: 0 0 12px rgba(0, 170, 255, 0.25);
}

.page-btn.active {
    background: linear-gradient(135deg, var(--accent), var(--neon-pink));
    border-color: var(--accent);
    color: white;
    box-shadow: 0 0 18px rgba(255, 34, 85, 0.5);
}

.page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.search-card,
.results-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    transition: border-color 0.3s ease;
}

.search-card:hover,
.results-card:hover {
    border-color: rgba(100, 140, 220, 0.15);
}

.search-card-header,
.results-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.search-card-header::after,
.results-card-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 1.5rem;
    right: 1.5rem;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--neon-blue), var(--neon-purple), var(--accent), transparent);
    opacity: 0.4;
}

.search-title,
.results-title {
    font-weight: 600;
    background: linear-gradient(135deg, var(--neon-blue) 0%, var(--neon-cyan) 50%, var(--neon-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 10px rgba(0, 170, 255, 0.4));
}

.results-count {
    font-size: 0.875rem;
    color: var(--accent);
    text-shadow: 0 0 12px rgba(255, 34, 85, 0.5);
}

.search-card-body { padding: 1.5rem; }

.search-actions {
    display: flex;
    gap: 0.75rem;
}

.search-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.results-table-wrap { overflow-x: auto; }

.results-table {
    width: 100%;
    border-collapse: collapse;
}

.results-table th,
.results-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.results-table th {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--bg-tertiary);
}

.results-table tbody tr {
    transition: all 0.2s ease;
}

.results-table tbody tr:nth-child(even) {
    background: rgba(0, 170, 255, 0.03);
}

.results-table tbody tr:nth-child(odd) {
    background: rgba(170, 85, 255, 0.015);
}

.results-table tbody tr:hover {
    background: linear-gradient(90deg, rgba(0, 170, 255, 0.12) 0%, rgba(170, 85, 255, 0.06) 50%, rgba(255, 68, 170, 0.04) 100%);
    box-shadow: inset 0 0 50px rgba(0, 170, 255, 0.08), inset 4px 0 0 var(--neon-blue);
}

.results-table tbody tr:hover td {
    background: transparent;
}

.reveal-btn,
.copy-btn {
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.reveal-btn:hover,
.copy-btn:hover {
    color: var(--accent);
    filter: drop-shadow(0 0 4px rgba(255, 34, 68, 0.3));
}

.reveal-btn svg,
.copy-btn svg {
    width: 14px;
    height: 14px;
}

.eye-off-icon {
    display: none;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    transition: 0.2s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: var(--text-muted);
    transition: 0.2s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, var(--accent), var(--neon-pink));
    border-color: var(--accent);
    box-shadow: 0 0 18px rgba(255, 34, 85, 0.5);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
    background-color: white;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
}

.settings-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.settings-section {
    margin-bottom: 0;
}

.section-header-content {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    flex: 1;
    margin-bottom: 16px;
}

.section-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    flex-shrink: 0;
    border: 1px solid var(--border-color);
}

.section-icon svg {
    width: 20px;
    height: 20px;
    color: var(--accent);
    filter: drop-shadow(0 0 8px rgba(255, 34, 85, 0.5));
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--neon-pink) 0%, var(--neon-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 10px rgba(170, 85, 255, 0.4));
}

.section-description {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 4px 0 0 0;
}

.settings-fields {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    animation: borderPulse 4s ease-in-out infinite;
}

@keyframes borderPulse {
    0%, 100% { border-color: rgba(100, 140, 220, 0.06); }
    50% { border-color: rgba(100, 140, 220, 0.14); }
}

.setting-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg-secondary);
    gap: 24px;
}

.setting-field:first-child {
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.setting-field:last-child {
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.setting-field:only-child {
    border-radius: var(--radius-md);
}

.setting-info {
    flex: 1;
    min-width: 0;
}

.setting-label {
    font-weight: 500;
    font-size: 14px;
    color: var(--text-primary);
    display: block;
}

.setting-description {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 4px 0 0 0;
    line-height: 1.4;
}

.setting-control {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.settings-actions {
    display: none;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    position: sticky;
    bottom: 0;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    margin-top: 8px;
}

.settings-actions.visible {
    display: flex;
}

.changes-indicator {
    font-size: 13px;
    color: var(--warning);
    text-shadow: 0 0 12px rgba(255, 204, 0, 0.5);
}

.reset-section-btn {
    opacity: 0.5;
    transition: opacity 0.2s;
}

.reset-section-btn:hover {
    opacity: 1;
}

.tags-wrapper {
    min-width: 300px;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tags-display {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 32px;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    align-items: flex-start;
    align-content: flex-start;
}

.tags-empty {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: rgba(0, 170, 255, 0.08);
    border: 1px solid rgba(0, 170, 255, 0.3);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-family: var(--font-mono);
    color: var(--neon-blue);
    text-shadow: 0 0 10px rgba(0, 170, 255, 0.5);
}

.tag-remove {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    font-size: 14px;
    line-height: 1;
    margin-left: 2px;
    transition: color 0.15s;
}

.tag-remove:hover { color: var(--danger); }

.tags-input-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: border-color 0.2s;
}

.tags-input-box:focus-within {
    border-color: rgba(51, 136, 255, 0.4);
    box-shadow: 0 0 0 3px rgba(51, 136, 255, 0.08);
}

.tags-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 13px;
    min-width: 0;
}

.tags-input::placeholder { color: var(--text-muted); }

.tags-count {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

.input-with-suffix {
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-with-suffix .form-input {
    width: 120px;
    text-align: right;
}

.input-suffix {
    font-size: 13px;
    color: var(--text-secondary);
    min-width: 60px;
}

.spin {
    animation: spin 1s linear infinite;
}

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

.time-cell {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.copyable {
    cursor: pointer;
    transition: all 0.2s;
}

.copyable:hover {
    color: var(--accent);
    text-shadow: 0 0 12px rgba(255, 34, 85, 0.5);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #cc1133);
    border-color: var(--danger);
    color: white;
    box-shadow: 0 2px 12px rgba(255, 34, 68, 0.3);
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(255, 34, 68, 0.5);
}

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

.btn-ghost:hover {
    background: var(--bg-hover);
    border-color: var(--border-color);
    color: var(--text-primary);
    text-shadow: 0 0 10px rgba(51, 136, 255, 0.15);
}

@media (max-width: 768px) {
    .setting-field {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .setting-control {
        width: 100%;
        align-items: flex-start;
    }

    .tags-wrapper {
        min-width: 100%;
        max-width: 100%;
    }

    .input-with-suffix .form-input {
        flex: 1;
    }

    .search-grid { grid-template-columns: 1fr; }
}
