.page-header { margin-bottom: 20px; text-align: center; color: var(--text-color); }
.page-header h2 { margin: 0 0 8px 0; }
.page-header p { margin: 0; color: var(--text-secondary); font-size: 14px; }
.pro-badge { display: inline-block; background: var(--primary-color); color: #fff; padding: 4px 8px; border-radius: 4px; font-size: 12px; font-weight: bold; margin-left: 10px; vertical-align: middle; }

.control-panel { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 12px; padding: 20px; margin-bottom: 20px; display: flex; flex-direction: column; gap: 16px; border-top: 4px solid var(--primary-color); box-shadow: 0 2px 8px rgba(0,0,0,0.02); position: relative; overflow: visible;}
.global-progress { position: absolute; bottom: 0; left: 0; height: 3px; background: var(--primary-color); width: 0%; transition: width 0.4s ease-out; z-index: 10; }

.control-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; justify-content: space-between; width: 100%; }
.inputs-wrapper { display: flex; flex-direction: column; gap: 12px; flex: 1; min-width: 300px; }

.input-addon-group { display: flex; border: 1px solid var(--input-border); border-radius: 8px; background-color: var(--input-bg); overflow: hidden; transition: var(--transition); min-width: 0;}
.input-addon-group:focus-within { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(82, 196, 26, 0.15); transform: translateY(-1px); }
.select-method { background: var(--hover-bg); border-right: 1px solid var(--border-color); padding: 0 12px; font-weight: 600; font-size: 14px; color: var(--text-color); height: 44px; cursor: pointer; transition: var(--transition); display: inline-flex; align-items: center; border: none; border-radius: 8px 0 0 8px; }

.input-main { height: 44px; padding: 0 16px; font-size: 15px; flex: 1; background: transparent; color: var(--text-color); width: 100%; font-family: 'Roboto Mono', monospace; min-width: 0; }

.quick-ports { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.quick-label { font-size: 12px; color: var(--text-tertiary); font-weight: 600;}
.port-chip { font-size: 12px; background: var(--hover-bg); border: 1px solid var(--border-color); padding: 4px 10px; border-radius: 6px; cursor: pointer; color: var(--text-secondary); transition: var(--transition); font-weight: 500;}
.port-chip:hover, .port-chip.active { background: rgba(82, 196, 26, 0.1); border-color: rgba(82, 196, 26, 0.3); color: var(--primary-color); }

.abuse-warning { font-size: 12px; color: var(--warning-color); display: flex; align-items: center; gap: 6px; font-weight: 500; background: rgba(250, 173, 20, 0.1); padding: 6px 10px; border-radius: 6px; width: fit-content; border: 1px solid rgba(250, 173, 20, 0.2);}

.action-area { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.quota-info { font-size: 13px; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; font-weight: 500; margin-top: 18px;}
.quota-info strong { font-family: 'Roboto Mono', monospace; }
.quota-timer { font-size: 12px; color: var(--warning-color); font-family: 'Roboto Mono', monospace; display: none; }

.btn-exec { display: inline-flex; align-items: center; justify-content: center; padding: 0 32px; height: 44px; border-radius: 8px; font-weight: 600; font-size: 15px; cursor: pointer; transition: all 0.2s; white-space: nowrap; background-color: var(--primary-color); color: #fff; box-shadow: 0 4px 12px rgba(82, 196, 26, 0.2); border: none; width: 100%;}
.btn-exec:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(82, 196, 26, 0.3); background-color: var(--primary-hover);}
.btn-exec.scanning { background-color: var(--warning-color); box-shadow: 0 4px 12px rgba(250, 173, 20, 0.2); pointer-events: none;}
.btn-exec:disabled { background-color: var(--text-tertiary); box-shadow: none; cursor: not-allowed; opacity: 0.7; transform: none;}

.capture-page-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 16px; height: 44px; border-radius: 8px; font-weight: 600; font-size: 14px;
  cursor: pointer; transition: all 0.2s; white-space: nowrap;
  background-color: var(--card-bg); color: var(--text-color);
  border: 1px solid var(--border-color); flex: 0 0 auto;
}
.capture-page-btn:hover:not(:disabled) {
  border-color: var(--primary-color); color: var(--primary-color); background: rgba(82, 196, 26, 0.05); transform: translateY(-2px);
}
.capture-page-btn:disabled {
  cursor: not-allowed; opacity: 0.6; transform: none; background: var(--hover-bg);
}

.advanced-options { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; padding-top: 12px; border-top: 1px dashed var(--border-color); width: 100%; }
.switch-label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--text-color); }
.switch { position: relative; width: 36px; height: 20px; background-color: #e5e5e5; border-radius: 20px; transition: var(--transition); }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; background-color: #fff; border-radius: 50%; transition: var(--transition); box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.switch-checkbox { display: none; }
.switch-checkbox:checked + .switch { background-color: var(--primary-color); }
.switch-checkbox:checked + .switch::after { transform: translateX(16px); }

.tooltip-wrapper { position: relative; display: inline-flex; align-items: center; cursor: pointer; overflow: visible; }
.info-badge { position: absolute; top: -5px; right: -12px; background: var(--accent); color: white; border-radius: 50%; width: 14px; height: 14px; font-size: 10px; display: flex; align-items: center; justify-content: center; font-style: normal; font-weight: bold; }
.tooltip-content { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%) translateY(10px); margin-bottom: 8px; width: max-content; max-width: 300px; background-color: #222; color: #f0f0f0; padding: 12px; border-radius: 8px; font-family: 'Roboto Mono', monospace; font-size: 11px; line-height: 1.5; opacity: 0; visibility: hidden; transition: all 0.2s var(--ease-out); z-index: 1000; box-shadow: 0 10px 30px rgba(0,0,0,0.3); text-align: left; white-space: pre-wrap; word-break: break-word; overflow-wrap: break-word; pointer-events: none; }
:root.dark-mode .tooltip-content, body.dark-mode .tooltip-content { background: #334155; }
.tooltip-content::after { content: ''; position: absolute; top: 100%; left: 50%; margin-left: -6px; border-width: 6px; border-style: solid; border-color: #222 transparent transparent transparent; }
:root.dark-mode .tooltip-content::after, body.dark-mode .tooltip-content::after { border-top-color: #334155; }
.tooltip-wrapper:hover .tooltip-content { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

.status-bar { margin-bottom: 16px; color: var(--text-secondary); font-size: 14px; opacity: 0; transition: opacity 0.3s; display: flex; align-items: center; gap: 8px; font-weight: 500;}
.status-bar.visible { opacity: 1; }
.pulse-dot { width: 10px; height: 10px; background-color: var(--primary-color); border-radius: 50%; animation: pulse 1.5s infinite; }

.summary-panel { display: none; grid-template-columns: 280px 1fr; gap: 20px; margin-bottom: 20px; align-items: stretch; }
.summary-panel.active { display: grid; animation: fadeIn 0.5s ease-out forwards; }

.summary-card { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 16px; box-shadow: 0 4px 12px rgba(0,0,0,0.02); }
.summary-title { font-size: 15px; font-weight: 700; color: var(--text-color); border-bottom: 1px dashed var(--border-color); padding-bottom: 12px; display: flex; align-items: center; justify-content: space-between; }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; flex: 1;}
.stat-box { background: var(--hover-bg); padding: 16px 12px; border-radius: 8px; border: 1px solid var(--border-color); display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; text-align: center;}
.stat-label { font-size: 12px; color: var(--text-tertiary); margin-bottom: 6px; }
.stat-value { font-size: 24px; font-weight: 800; color: var(--text-color); font-family: 'Roboto Mono', monospace; }
.val-open { color: var(--primary-color); }
.val-closed { color: var(--error-color); }
.val-filtered { color: var(--warning-color); }

#chartContainer { width: 100%; height: 140px; }

.result-table-wrap { overflow-x: auto; border: 1px solid var(--border-color); border-radius: 12px; background: var(--card-bg); display: none; box-shadow: 0 4px 16px rgba(0,0,0,0.02); margin-bottom: 20px; }
.result-table-wrap.active { display: block; animation: slideInUp 0.4s ease-out forwards; }

.agent-info-bar { padding: 12px 16px; background: var(--hover-bg); border-bottom: 1px solid var(--border-color); font-size: 13px; font-weight: 600; color: var(--text-color); display: flex; justify-content: space-between; align-items: center;}
.agent-badge { padding: 3px 8px; background: rgba(82, 196, 26, 0.1); color: var(--primary-color); border-radius: 4px; font-size: 11px; border: 1px solid rgba(82, 196, 26, 0.2); margin-left: 8px;}

.port-table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 600px; font-size: 14px; }
.port-table th, .port-table td { padding: 14px 16px; border-bottom: 1px solid var(--border-color); text-align: left; vertical-align: middle; }
.port-table th { background: rgba(245, 247, 250, 0.5); color: var(--text-secondary); font-weight: 600; white-space: nowrap; }
html.dark-mode .port-table th { background: rgba(30, 30, 30, 0.5); }

.port-table tbody tr { transition: background-color 0.2s; }
.port-table tbody tr:hover { background: rgba(82, 196, 26, 0.03); }

.port-num { font-weight: 700; color: var(--text-color); font-family: 'Roboto Mono', monospace;}
.port-service { font-size: 12px; color: var(--text-tertiary); background: rgba(0,0,0,0.05); padding: 3px 8px; border-radius: 4px; display: inline-block;}
html.dark-mode .port-service { background: rgba(255,255,255,0.08); }

.status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 6px; font-weight: 600; font-size: 12px;}
.time-val { color: var(--text-tertiary); font-weight: 500; font-family: 'Roboto Mono', monospace;}

.st-open { color: var(--primary-color); background: rgba(82, 196, 26, 0.1); border: 1px solid rgba(82, 196, 26, 0.3); }
.st-closed { color: var(--error-color); background: rgba(255, 77, 79, 0.08); border: 1px solid rgba(255, 77, 79, 0.2); }
.st-filtered { color: var(--warning-color); background: rgba(250, 173, 20, 0.1); border: 1px solid rgba(250, 173, 20, 0.3); }
.st-pending { color: var(--text-tertiary); background: var(--hover-bg); border: 1px dashed var(--border-color); }

@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(82, 196, 26, 0.6); } 70% { box-shadow: 0 0 0 8px rgba(82, 196, 26, 0); } 100% { box-shadow: 0 0 0 0 rgba(82, 196, 26, 0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideInUp { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 900px) {
  .summary-panel { grid-template-columns: 1fr; }
  .control-row { flex-direction: column; align-items: stretch; }
  .action-area { align-items: stretch; }
  .btn-exec { width: 100%; }
  .capture-page-btn .btn-text { display: none; }
}
