:root {
    --primary: #ff4801;
    --primary-hover: #d93e00;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --expired: #8b5cf6;
    --bg-main: #f8fafc;
    --header-bg: rgba(248, 250, 252, 0.85);
    --card-bg: rgba(255, 255, 255, 0.85);
    --card-border: rgba(255, 255, 255, 0.4);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --input-bg: #ffffff;
    --input-border: #e2e8f0;
    --list-bg: rgba(255, 255, 255, 0.4);
    --item-bg: #ffffff;
    --col-header-border: rgba(0, 0, 0, 0.05);
    --badge-bg: #ffffff;
    --item-avail-text: #065f46;
    --item-reg-text: #991b1b;
    --item-err-text: #92400e;
    --item-exp-text: #7c3aed;
    --header-avail-bg: rgba(16, 185, 129, 0.05);
    --header-reg-bg: rgba(239, 68, 68, 0.05);
    --header-err-bg: rgba(245, 158, 11, 0.05);
    --tooltip-bg: rgba(15, 23, 42, 0.9);
    --tooltip-text: #ffffff;
    --ghost-hover-bg: rgba(255, 72, 1, 0.08);
    --border-focus: rgba(255, 72, 1, 0.2);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-main: #0f172a;
        --header-bg: rgba(15, 23, 42, 0.85);
        --card-bg: rgba(30, 41, 59, 0.85);
        --card-border: rgba(255, 255, 255, 0.1);
        --text-main: #f8fafc;
        --text-muted: #94a3b8;
        --input-bg: #0f172a;
        --input-border: #334155;
        --list-bg: rgba(0, 0, 0, 0.2);
        --item-bg: #1e293b;
        --col-header-border: rgba(255, 255, 255, 0.05);
        --badge-bg: #334155;
        --item-avail-text: #34d399;
        --item-reg-text: #f87171;
        --item-err-text: #fbbf24;
        --item-exp-text: #a78bfa;
        --header-avail-bg: rgba(16, 185, 129, 0.1);
        --header-reg-bg: rgba(239, 68, 68, 0.1);
        --header-err-bg: rgba(245, 158, 11, 0.1);
        --tooltip-bg: rgba(255, 255, 255, 0.95);
        --tooltip-text: #0f172a;
        --ghost-hover-bg: rgba(255, 255, 255, 0.05);
    }
}

html { overscroll-behavior: none; background: var(--bg-main); min-height: 100vh; }
body { overscroll-behavior: none; font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; background: var(--bg-main); background-attachment: fixed; color: var(--text-main); max-width: 1200px; margin: 0 auto; padding: 0 20px 20px; box-sizing: border-box; min-height: 100vh; transition: background 0.3s ease, color 0.3s ease; display: flex; flex-direction: column; }

.hidden-el { display: none !important; }
.flex-center { display: flex; align-items: center; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.static-item { animation: none; opacity: 1; transform: translateY(0); }

.app-header { display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 100; padding: 16px 20px; margin: 0 -20px 24px; background: var(--header-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--card-border); box-shadow: 0 4px 20px -5px rgba(0,0,0,0.05); }
.app-header h2 { font-size: 22px; font-weight: 800; color: var(--text-main); margin: 0; letter-spacing: -0.5px; text-shadow: 0 2px 4px rgba(0,0,0,0.05); }

.btn-header-whois { display: flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--primary); background: var(--ghost-hover-bg); text-decoration: none; transition: all 0.2s ease; }
.btn-header-whois:hover { background: var(--primary); color: white; transform: translateY(-1px); box-shadow: 0 4px 10px rgba(255, 72, 1, 0.2); }

.glass-panel { background: var(--card-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--card-border); border-radius: 20px; box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05); }
.controls-form { padding: 24px 30px; margin-bottom: 30px; display: flex; flex-direction: column; gap: 20px; }
.controls-settings { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; width: 100%; justify-content: flex-start; }
.controls-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; width: 100%; justify-content: space-between; }

select { padding: 12px 20px; font-size: 14px; font-weight: 600; border: 2px solid var(--input-border); border-radius: 10px; outline: none; background-color: var(--input-bg); color: var(--text-main); cursor: pointer; transition: all 0.3s ease; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; padding-right: 40px; flex: none; width: 160px; min-width: 140px; box-sizing: border-box; }
select:focus, .input-group:focus-within, textarea.custom-textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--border-focus); }
.input-group { display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--input-bg); border: 2px solid var(--input-border); border-radius: 10px; padding: 0 16px; height: 44px; transition: all 0.3s ease; box-sizing: border-box; flex: none; }
.input-group input { border: none; outline: none; width: 60px; font-size: 14px; font-weight: 600; color: var(--text-main); text-align: center; background: transparent; }
.input-group span { font-size: 13px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }

.advanced-toggle-container { width: 100%; display: flex; justify-content: flex-start; margin-top: -8px; }
.btn-toggle { background: transparent; border: none; color: var(--text-muted); font-size: 13px; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 8px; transition: all 0.2s ease; height: auto; min-width: auto; justify-content: flex-start; }
.btn-toggle:hover { background: var(--ghost-hover-bg); color: var(--primary); }
.btn-toggle svg { transition: transform 0.3s ease; }
.btn-toggle.active svg { transform: rotate(180deg); }
.custom-domain-section { display: none; gap: 16px; width: 100%; align-items: stretch; animation: fadeIn 0.3s ease forwards; }
.custom-domain-section.show { display: flex; }

textarea.custom-textarea { width: 100%; min-height: 120px; padding: 16px 20px; font-family: 'JetBrains Mono', Consolas, monospace; font-size: 14px; border: 2px solid var(--input-border); border-radius: 10px; outline: none; resize: vertical; background: var(--input-bg); color: var(--text-main); transition: all 0.3s ease; box-sizing: border-box; line-height: 1.6; flex: 1; }
.suffix-checkbox-group { flex: 0 0 260px; background: var(--input-bg); border: 2px solid var(--input-border); border-radius: 10px; padding: 14px 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 10px; overflow-y: auto; min-height: 120px; box-sizing: border-box; align-content: start; }
.suffix-checkbox-group::-webkit-scrollbar { width: 4px; }
.suffix-checkbox-group::-webkit-scrollbar-track { background: transparent; }
.suffix-checkbox-group::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 10px; }
.suffix-checkbox-group label { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--text-main); cursor: pointer; user-select: none; }
.suffix-checkbox-group input[type="checkbox"] { cursor: pointer; accent-color: var(--primary); width: 15px; height: 15px; margin: 0; }
.select-all-label { grid-column: 1 / -1; border-bottom: 1px dashed var(--input-border); padding-bottom: 10px; margin-bottom: 6px; color: var(--primary); justify-content: flex-end; }

button { padding: 10px 16px; font-size: 14px; font-weight: 700; border-radius: 10px; cursor: pointer; transition: all 0.3s ease; box-sizing: border-box; height: 44px; display: flex; align-items: center; justify-content: center; white-space: nowrap; flex: 1; min-width: 100px; gap: 8px; }
button:active:not(:disabled) { transform: scale(0.98); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: linear-gradient(135deg, var(--primary), #ff6a1f); color: white; border: none; box-shadow: 0 4px 12px rgba(255, 72, 1, 0.3); flex: 2; }
.btn-primary:hover:not(:disabled) { box-shadow: 0 6px 16px rgba(255, 72, 1, 0.4); transform: translateY(-1px); }

.btn-ghost { background: transparent; color: var(--text-main); border: 1.5px solid var(--input-border); }
.btn-ghost:hover:not(:disabled) { background: var(--ghost-hover-bg); border-color: var(--text-muted); }

.btn-ghost-danger { background: transparent; color: var(--danger); border: 1.5px solid rgba(239, 68, 68, 0.3); }
.btn-ghost-danger:hover:not(:disabled) { background: rgba(239, 68, 68, 0.05); border-color: var(--danger); }

.loader-spinner { animation: spin 1s linear infinite; display: none; }
.btn-primary.is-loading .loader-spinner { display: block; }
@keyframes spin { 100% { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }

.progress-wrapper { flex-grow: 1; display: flex; flex-direction: column; gap: 8px; width: 100%; margin-top: 10px; }
.progress-header { display: flex; justify-content: space-between; align-items: center; }
.progress-text { font-size: 14px; font-weight: 600; color: var(--text-muted); }
.progress-percent { font-size: 14px; font-weight: 700; color: var(--primary); }
.progress-bar-container { width: 100%; height: 8px; background-color: var(--input-border); border-radius: 4px; overflow: hidden; box-shadow: inset 0 1px 2px rgba(0,0,0,0.05); }

.progress-bar { height: 100%; width: 0%; background: linear-gradient(90deg, var(--primary), #ff8547); border-radius: 4px; transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease; position: relative; overflow: hidden; }
.progress-bar::after { content: ''; position: absolute; top: 0; left: 0; bottom: 0; right: 0; background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0) 100%); animation: shimmer 1.5s infinite; }
.progress-finished { background: linear-gradient(90deg, var(--success), #34d399); }
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

.results { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; width: 100%; flex-grow: 1; }
.col { display: flex; flex-direction: column; height: 550px; overflow: hidden; }
.col-header { padding: 18px 24px; font-weight: 700; font-size: 15px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--col-header-border); }
.header-title { display: flex; align-items: center; gap: 8px; }
.header-available { color: var(--success); background: var(--header-avail-bg); border-radius: 20px 20px 0 0; }
.header-registered { color: var(--danger); background: var(--header-reg-bg); border-radius: 20px 20px 0 0; }
.header-error { color: var(--warning); background: var(--header-err-bg); border-radius: 20px 20px 0 0; }
.count-badge { background-color: var(--badge-bg); padding: 4px 12px; border-radius: 20px; font-size: 13px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }

.list-container { flex-grow: 1; padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; background: var(--list-bg); border-radius: 0 0 20px 20px; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; position: relative; }
.list-container::-webkit-scrollbar { width: 6px; }
.list-container::-webkit-scrollbar-track { background: transparent; }
.list-container::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 10px; }

.empty-state { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--text-muted); opacity: 0.6; pointer-events: none; }
.empty-state svg { width: 48px; height: 48px; stroke-width: 1.5; }
.empty-state span { font-size: 14px; font-weight: 500; }

.domain-item { padding: 14px 18px; border-radius: 12px; background: var(--item-bg); box-shadow: 0 2px 4px rgba(0,0,0,0.02); border: 1px solid transparent; display: flex; justify-content: space-between; align-items: center; gap: 10px; animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards; opacity: 0; transform: translateY(10px); }
.item-info { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.domain-name { font-family: 'JetBrains Mono', Consolas, monospace; font-size: 15px; font-weight: 700; word-break: break-all; }
.domain-meta { font-size: 12px; color: var(--text-muted); font-family: system-ui, -apple-system, sans-serif; font-weight: 500; margin-top: 2px; }

.item-available { border-left: 4px solid var(--success); color: var(--item-avail-text); }
.item-registered { border-left: 4px solid var(--danger); color: var(--item-reg-text); opacity: 0.9; }
.item-expired { border-left: 4px solid var(--expired); color: var(--item-exp-text); opacity: 1; }
.item-error { border-left: 4px solid var(--warning); color: var(--item-err-text); }

.expired-badge { background-color: var(--expired); color: white; font-size: 11px; padding: 2px 6px; border-radius: 4px; font-weight: bold; white-space: nowrap; }

.action-pills { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-start; margin-top: 2px; }
.pill-btn { display: inline-flex; align-items: center; justify-content: center; padding: 4px 12px; font-size: 11px; font-weight: 700; color: var(--success); border: 1.5px solid var(--success); border-radius: 50px; background: transparent; text-decoration: none; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); letter-spacing: 0.3px; cursor: pointer; }
.pill-btn:hover { background: var(--success); color: #ffffff; transform: scale(1.05); box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2); }

@keyframes slideIn { to { opacity: 1; transform: translateY(0); } }

.global-tooltip { position: fixed; top: 0; left: 0; background: var(--tooltip-bg); color: var(--tooltip-text); padding: 10px 14px; border-radius: 10px; font-family: system-ui, -apple-system, sans-serif; font-size: 13px; font-weight: 500; pointer-events: none; z-index: 99999; opacity: 0; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.25); white-space: nowrap; transition: opacity 0.2s cubic-bezier(0.165, 0.84, 0.44, 1); }
.global-tooltip.show { opacity: 1; }
.global-tooltip::after { content: ''; position: absolute; top: 100%; left: var(--arrow-x, 50%); transform: translateX(-50%); border: 5px solid transparent; border-top-color: var(--tooltip-bg); }

.app-footer { width: 100%; text-align: center; padding: 32px 20px 10px; font-size: 13px; font-weight: 500; color: var(--text-muted); display: flex; justify-content: center; align-items: center; gap: 4px; }
.app-footer a { color: var(--primary); text-decoration: none; font-weight: 600; transition: all 0.2s ease; }
.app-footer a:hover { color: var(--primary-hover); }

.mobile-tab-nav { display: none; }

@media (max-width: 992px) {
    .results { grid-template-columns: repeat(2, 1fr); }
    .results > .col:last-child { grid-column: 1 / -1; height: 400px; }
}

@media (max-width: 768px) { 
    body { padding: 0 12px 16px; } 
    .app-header { margin: 0 -12px 20px; padding: 14px 12px; }
    .app-header h2 { font-size: 18px; }
    .btn-header-whois { padding: 8px; border-radius: 6px; }
    .btn-header-whois span { display: none; }
    
    .controls-form { padding: 16px; gap: 16px; } 
    .controls-settings { flex-direction: column; align-items: stretch; gap: 12px; }
    .controls-settings > select, .input-group { width: 100%; }
    .controls-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
    #startBtn { grid-column: 1 / -1; }
    .custom-domain-section { flex-direction: column; } 
    .suffix-checkbox-group { width: 100%; grid-template-columns: repeat(3, 1fr); max-height: none; overflow-y: visible; } 
    
    .mobile-tab-nav { display: flex; justify-content: center; gap: 8px; margin-bottom: 16px; width: 100%; }
    .mobile-tab-indicator { width: 8px; height: 8px; border-radius: 50%; background: var(--input-border); transition: all 0.3s ease; }
    .mobile-tab-indicator.active { background: var(--primary); width: 20px; border-radius: 4px; }
    
    .results { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; gap: 16px; padding-bottom: 10px; }
    .results::-webkit-scrollbar { display: none; }
    .col { flex: 0 0 100%; scroll-snap-align: center; height: calc(100vh - 420px); min-height: 450px; }
}

@media (max-width: 480px) { 
    .suffix-checkbox-group { grid-template-columns: repeat(2, 1fr); } 
}
