:root {
    /* Light Theme Colors */
    --bg-main: #fcfcfd;
    --bg-glass: rgba(255, 255, 255, 0.7);
    --border-glass: rgba(0, 0, 0, 0.08);
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    --accent-safe: #10b981;
    --accent-safe-hover: #059669;
    --accent-safe-bg: rgba(16, 185, 129, 0.1);
    --accent-primary: #3b82f6;
    --accent-primary-hover: #2563eb;
    --control-bg: #ffffff;
    --control-border: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-glass: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
}

[data-theme="dark"] {
    --bg-main: #0f1115;
    --bg-glass: rgba(20, 24, 32, 0.7);
    --border-glass: rgba(255, 255, 255, 0.08);
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-muted: #6b7280;
    --accent-safe: #34d399;
    --accent-safe-hover: #10b981;
    --accent-safe-bg: rgba(52, 211, 153, 0.15);
    --accent-primary: #60a5fa;
    --accent-primary-hover: #3b82f6;
    --control-bg: #1f232b;
    --control-border: #374151;
    --shadow-glass: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 2rem 1rem;
    background-image: radial-gradient(circle at top right, rgba(16, 185, 129, 0.05) 0%, transparent 40%),
                      radial-gradient(circle at bottom left, rgba(59, 130, 246, 0.05) 0%, transparent 40%);
}

.app-container {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--accent-safe);
}

.logo svg {
    flex-shrink: 0;
}

h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.025em;
}

h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow-glass);
    transition: all 0.3s ease;
}

.input-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.input-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

textarea {
    width: 100%;
    min-height: 150px;
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--control-border);
    background-color: var(--control-bg);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
}

textarea:focus {
    outline: none;
    border-color: var(--accent-safe);
    box-shadow: 0 0 0 3px var(--accent-safe-bg);
}

textarea::placeholder {
    color: var(--text-muted);
}

#customBlocklist {
    min-height: 80px;
    font-family: monospace;
    font-size: 0.85rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    line-height: 1;
}

.btn-primary {
    background-color: var(--accent-safe);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background-color: var(--accent-safe-hover);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background-color: var(--control-bg);
    color: var(--text-primary);
    border: 1px solid var(--control-border);
}

.btn-secondary:hover {
    background-color: var(--border-glass);
}

.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
    border-radius: 6px;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.icon-btn:hover {
    background-color: var(--border-glass);
    color: var(--text-primary);
}

.text-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: color 0.2s;
}

.text-btn:hover {
    color: var(--text-primary);
}

/* Settings */
.settings-group {
    border-top: 1px solid var(--border-glass);
    padding-top: 1rem;
    margin-top: 0.5rem;
}

.toggle-settings svg {
    transition: transform 0.3s ease;
}

.toggle-settings.active svg {
    transform: rotate(90deg);
}

.settings-panel {
    margin-top: 1rem;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease, margin 0.3s ease;
    max-height: 500px;
    opacity: 1;
}

.settings-panel.collapsed {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    pointer-events: none;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.help-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* Results */
.action-bar {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.top-action-bar {
    justify-content: flex-end;
}

.results-section {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.results-section.hidden {
    display: none;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.badge {
    padding: 0.25rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background-color: var(--accent-safe-bg);
    color: var(--accent-safe);
}

.output-container {
    position: relative;
}

#resultText {
    border-color: var(--accent-safe);
    background-color: rgba(16, 185, 129, 0.02);
}

.comparison-container {
    background-color: var(--control-bg);
    border: 1px solid var(--control-border);
    border-radius: 12px;
    padding: 1.25rem;
    margin-top: 0.5rem;
}

.removed-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
}

.removed-list li {
    font-size: 0.85rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    word-break: break-all;
}

.removed-list li .param-name {
    color: #ef4444;
    font-weight: 600;
    background-color: rgba(239, 68, 68, 0.1);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    white-space: nowrap;
}

.removed-list li .param-value {
    color: var(--text-muted);
    font-family: monospace;
}

.removed-list li.empty-state {
    color: var(--text-muted);
    font-style: italic;
    justify-content: center;
    padding: 1rem 0;
}

footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: auto;
    padding-top: 2rem;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: var(--text-primary);
    color: var(--bg-main);
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    font-weight: 500;
    font-size: 0.9rem;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000;
}

.toast:not(.hidden) {
    transform: translateX(-50%) translateY(0);
}

@media (max-width: 600px) {
    .action-bar {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}
