:root {
    --primary: #10B981;
    --primary-dim: rgba(16, 185, 129, 0.15);
    --secondary: #6EE7B7;
    --accent: #F59E0B;
    --bg-dark: #0A1A12;
    --bg-panel: rgba(16, 25, 20, 0.7);
    --bg-panel-hover: rgba(20, 35, 28, 0.8);
    --text-main: #F3F4F6;
    --text-muted: #9CA3AF;
    --border-color: rgba(16, 185, 129, 0.2);
    --border-radius: 12px;
    --danger: #EF4444;
    --warning: #F59E0B;
    --safe: #10B981;
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(16, 185, 129, 0.05), transparent 25%),
        radial-gradient(circle at 90% 80%, rgba(110, 231, 183, 0.05), transparent 25%);
    padding-bottom: 3rem;
}

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

/* Header */
.header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.header-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-dim);
    color: var(--primary);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
}

.header-content h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

.header-content p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Glass Panels */
.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Utilities */
.hidden {
    display: none !important;
}

.full-width {
    width: 100%;
    margin-top: 1rem;
}

/* Input Section */
.input-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

.input-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

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

.slider {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
    background-color: rgba(255,255,255,0.1);
    border-radius: 20px;
    transition: .4s;
    border: 1px solid var(--border-color);
}

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

input:checked + .slider {
    background-color: var(--primary-dim);
    border-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(20px);
    background-color: var(--primary);
}

.toggle-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

input:checked ~ .toggle-label {
    color: var(--text-main);
}

/* Inputs */
.input-container {
    display: flex;
    position: relative;
    align-items: center;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    transition: border-color 0.2s;
}

.input-container:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-dim);
}

input[type="url"], textarea, input[type="text"] {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-main);
    padding: 1rem;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    resize: vertical;
}

.action-icon-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

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

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn.sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.btn-primary {
    background: var(--primary);
    color: #000;
}

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

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

.btn-primary.outline:hover {
    background: var(--primary-dim);
}

/* Results Section */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.results-header h2 {
    font-size: 1.25rem;
}

.badge {
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid;
}

.badge.safe { background: rgba(16, 185, 129, 0.15); color: var(--safe); border-color: rgba(16, 185, 129, 0.3); }

.result-card {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.url-comparison {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.url-row {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.url-row.sanitized {
    background: var(--primary-dim);
    border-color: var(--border-color);
}

.url-label {
    min-width: 70px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
    padding-top: 0.1rem;
}

.url-row.sanitized .url-label {
    color: var(--primary);
}

.url-content {
    flex-grow: 1;
    word-break: break-all;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.9rem;
    line-height: 1.4;
}

.highlight .tracker-param {
    text-decoration: line-through;
    color: var(--danger);
    opacity: 0.6;
}

.analysis-details h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--text-muted);
}

.analysis-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.analysis-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    background: rgba(255,255,255,0.02);
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    border-left: 2px solid var(--primary);
}

.analysis-list li.info {
    border-left-color: var(--accent);
}

/* Batch Results */
.batch-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.batch-list::-webkit-scrollbar { width: 6px; }
.batch-list::-webkit-scrollbar-track { background: rgba(0,0,0,0.1); }
.batch-list::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }

.batch-item {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.batch-item-url {
    flex-grow: 1;
    word-break: break-all;
    font-family: ui-monospace, SFMono-Regular, monospace;
    font-size: 0.85rem;
}

.batch-item-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    min-width: 100px;
    text-align: right;
}

/* Settings Section */
.settings-section {
    padding: 1rem 1.5rem;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.settings-header h2 {
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
}

.settings-header .chevron {
    color: var(--text-muted);
    transition: transform 0.3s;
}

.settings-section.open .chevron {
    transform: rotate(180deg);
}

.settings-content {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 1.5rem;
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.setting-group label {
    font-weight: 500;
    font-size: 0.95rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.setting-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.setting-group input[type="text"] {
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    padding: 0.75rem;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--primary);
    color: #000;
    padding: 0.75rem 1.5rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Footer */
.footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 640px) {
    .url-row {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    #copyResultBtn {
        align-self: flex-start;
    }
}
