﻿/* Clean Settings Design */
.whitelist-settings,
.blacklist-settings {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Loading Overlay - Prevents Layout Shift */
.loading-overlay-container {
    position: relative;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 41, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 12px;
    animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.loading-overlay .spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3rem;
}

.spinner {
    width: 2rem;
    height: 2rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top: 2px solid #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.spinner-sm {
    width: 1rem;
    height: 1rem;
    border: 1px solid #e5e7eb;
    border-top: 1px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 0.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Settings Grid */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Settings Cards - Dark Theme */
.settings-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
}

.card-header {
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.card-header h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #ffffff;
}

.card-header p {
    margin: 0;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
}

.card-content {
    padding: 1.5rem;
}

/* Add Section */
.add-section {
    margin-bottom: 1rem;
}

.input-group {
    display: flex;
    gap: 0.5rem;
}

.form-select,
.form-input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-select:focus,
.form-input:focus {
    outline: none;
    border-color: rgba(99, 102, 241, 0.4);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Buttons */
.btn-primary {
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.4);
}

.btn-primary:disabled {
    background: rgba(255, 255, 255, 0.2);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn-save {
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, #4ade80, #22c55e);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 20px rgba(74, 222, 128, 0.3);
}

.btn-save:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(74, 222, 128, 0.4);
}

.btn-save:disabled {
    background: rgba(255, 255, 255, 0.2);
    cursor: not-allowed;
}

.btn-remove {
    padding: 0.25rem 0.5rem;
    background: #ef4444;
    color: #ffffff;
    border: none;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
    line-height: 1;
}

.btn-remove:hover {
    background: #dc2626;
}

/* Items List */
.items-list {
    max-height: 300px;
    overflow-y: auto;
}

.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.04);
}

.list-item:last-child {
    margin-bottom: 0;
}

.list-item span {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.9);
    flex: 1;
    margin-right: 0.5rem;
}

.hash-display {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.75rem !important;
    background: rgba(255, 255, 255, 0.1);
    color: #a5b4fc;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}

/* Image Input Tabs */
.image-input-tabs {
    display: flex;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tab-button {
    padding: 0.5rem 1rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.15s ease-in-out;
}

.tab-button.active {
    color: #6366f1;
    border-bottom-color: #6366f1;
}

.tab-button:hover {
    color: rgba(255, 255, 255, 0.9);
}

/* File Upload */
.file-upload-area {
    position: relative;
}

.file-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-upload-label {
    display: block;
    padding: 2rem;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s ease-in-out;
    margin-bottom: 1rem;
}

.file-upload-label:hover {
    border-color: rgba(99, 102, 241, 0.5);
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.upload-icon {
    font-size: 2rem;
}

.upload-content span {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
}

.upload-content small {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
}

.selected-file {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 0.375rem;
    margin-bottom: 0.75rem;
}

.selected-file span {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.9);
}

/* Save Section */
.save-section {
    text-align: center;
    padding: 1.5rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Messages */
.message {
    position: fixed;
    top: 1rem;
    right: 1rem;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    color: #ffffff;
    font-weight: 500;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 300px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.message.success {
    background: #059669;
}

.message.error {
    background: #ef4444;
}

.message-close {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 1.25rem;
    cursor: pointer;
    margin-left: 1rem;
    padding: 0;
    line-height: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .message {
        position: relative;
        top: auto;
        right: auto;
        margin: 1rem 0;
    }
}
