/* === IP CIDR Scan Page Styles === */

/* Page header (align with other tools like PortScan) */
.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;
}
.find-ping-badge {
  display: inline-block;
  font-size: 12px;
  padding: 2px 6px;
  background: rgba(24,144,255,0.1);
  color: var(--info-color);
  border-radius: 4px;
  border: 1px solid rgba(24,144,255,0.2);
  vertical-align: middle;
  white-space: nowrap;
}

/* Control Panel */
.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 4px 20px rgba(0,0,0,0.02); position: relative; overflow: hidden;}
.global-progress { position: absolute; bottom: 0; left: 0; height: 4px; background: var(--info-color); width: 0%; transition: width 0.3s ease-out; z-index: 10; }

.control-row { display: flex; flex-wrap: nowrap; gap: 16px; align-items: center; justify-content: space-between; width: 100%; }
.input-group { display: flex; gap: 12px; flex: 1; min-width: 300px; align-items: center; flex-wrap: wrap; }

.input-addon-group { display: flex; border: 1px solid var(--input-border); border-radius: 8px; background-color: var(--input-bg); flex: 1; overflow: hidden; min-width: 250px; transition: var(--transition);}
.input-addon-group:focus-within { border-color: var(--info-color); box-shadow: 0 0 0 3px rgba(24, 144, 255, 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); max-width: 180px; border: none; display: inline-flex; align-items: center; }
.input-main { height: 44px; padding: 0 16px; font-size: 16px; flex: 1; background: transparent; color: var(--text-color); width: 100%; font-family: 'Roboto Mono', monospace; }

.btn-scan { display: inline-flex; align-items: center; justify-content: center; padding: 0 24px; height: 44px; border-radius: 8px; font-weight: 600; font-size: 14px; cursor: pointer; transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1); white-space: nowrap; background-color: var(--primary-color); color: #fff; box-shadow: 0 4px 12px rgba(24, 144, 255, 0.2); border: none; width: 140px; }
.btn-scan:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(24, 144, 255, 0.3); background-color: var(--primary-hover);}
.btn-scan.scanning { background-color: var(--warning-color); box-shadow: 0 4px 12px rgba(250, 173, 20, 0.2); pointer-events: none; }
.btn-scan:disabled { background-color: var(--text-tertiary); box-shadow: none; cursor: not-allowed; opacity: 0.7; transform: none; }

.advanced-options { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; padding-top: 12px; border-top: 1px dashed var(--border-color); width: 100%; }
.option-item { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); }
.option-item input, .option-item select { height: 30px; border-radius: 6px; border: 1px solid var(--input-border); background: var(--input-bg); color: var(--text-color); font-size: 13px; padding: 0 8px; width: 100px; }

.switch-label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--text-color); white-space: nowrap; }
.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); }

/* View mode segmented control & subnet tabs */
.segmented-control { display: inline-flex; background-color: var(--hover-bg); padding: 4px; border-radius: 8px; border: 1px solid var(--border-color); }
.segment-option { display: none; }
.segment-label { padding: 6px 14px; border-radius: 6px; color: var(--text-secondary); cursor: pointer; font-size: 13px; font-weight: 600; transition: all 0.2s ease-out; user-select: none; }
.segment-option:checked + .segment-label { background-color: var(--card-bg); color: var(--info-color); box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.subnet-header-row td { background-color: var(--hover-bg); font-weight: 700; color: var(--text-color); border-bottom: 2px solid var(--border-color); }

.subnet-tabs { display: none; flex-wrap: wrap; gap: 8px; padding: 16px 16px 0 16px; }
.subnet-tabs.active { display: flex; }
.subnet-tab-btn { background: var(--hover-bg); border: 1px solid var(--border-color); color: var(--text-secondary); padding: 6px 14px; border-radius: 6px; font-size: 13px; font-family: 'Roboto Mono', monospace; cursor: pointer; transition: var(--transition); font-weight: 600; white-space: nowrap; }
.subnet-tab-btn:hover { border-color: var(--info-color); color: var(--info-color); background: rgba(24, 144, 255, 0.05); }
.subnet-tab-btn.active { background: var(--info-color); color: #fff; border-color: var(--info-color); box-shadow: 0 2px 8px rgba(24, 144, 255, 0.25); }

/* Summary stats grid */
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; justify-content: center; box-shadow: 0 2px 8px rgba(0,0,0,0.02); transition: var(--transition); position: relative; overflow: hidden; }
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.05); }
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 100%; background: var(--color-ssl); transition: var(--transition); }
.stat-card.total::before { background: var(--info-color); }
.stat-card.total:hover { border-color: var(--info-color); }
.stat-card.alive::before { background: var(--primary-color); }
.stat-card.alive:hover { border-color: var(--primary-color); }
.stat-card.dead::before { background: var(--text-tertiary); }
.stat-card.dead:hover { border-color: var(--text-tertiary); }
.stat-card.grey::before { border-color: var(--color-ssl); }
.stat-card.grey:hover { border-color: var(--color-ssl); }

.stat-label { font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; font-weight: 600; padding-left: 8px; }
.stat-value { font-size: 28px; font-weight: 800; color: var(--text-color); font-family: 'Roboto Mono', monospace; padding-left: 8px; display: flex; align-items: baseline; gap: 6px;}
.stat-sub { font-size: 13px; color: var(--text-tertiary); font-weight: 400; font-family: 'Inter', sans-serif;}

/* Data table */
.table-wrap { overflow-x: auto; border: 1px solid var(--border-color); border-radius: 12px; background: var(--card-bg); box-shadow: 0 4px 16px rgba(0,0,0,0.04); margin-bottom: 20px; display: none;}
.table-wrap.active { display: block; animation: fadeIn 0.6s ease-out forwards; }
.table-wrap::-webkit-scrollbar { height: 8px; }
.table-wrap::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }

.data-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; min-width: 800px; margin-top: 8px; }
.data-table th, .data-table td { padding: 14px 16px; border-bottom: 1px solid var(--border-color); text-align: left; vertical-align: middle; }
.data-table th { position: sticky; top: 0; z-index: 2; background: rgba(245, 247, 250, 0.95); backdrop-filter: blur(4px); color: var(--text-secondary); font-weight: 600; white-space: nowrap; }
html.dark-mode .data-table th { background: rgba(20, 20, 20, 0.95); }
.data-table tbody tr { transition: background-color 0.2s; }
.data-table tbody tr:hover { background: rgba(24, 144, 255, 0.04); }

.ip-col { font-family: 'Roboto Mono', monospace; font-weight: 600; color: var(--text-color); font-size: 14px; }
.geo-col { color: var(--text-secondary); display: flex; align-items: center; gap: 6px; }

.status-badge { padding: 4px 10px; border-radius: 6px; font-weight: 600; font-size: 12px; display: inline-flex; align-items: center; gap: 4px; }
.status-alive { background: rgba(82, 196, 26, 0.1); color: var(--primary-color); border: 1px solid rgba(82, 196, 26, 0.2); }
.status-dead { background: rgba(0, 0, 0, 0.05); color: var(--text-tertiary); border: 1px solid var(--border-color); }
html.dark-mode .status-dead { background: rgba(255, 255, 255, 0.05); }

.latency-val { font-family: 'Roboto Mono', monospace; font-weight: 700; }
.latency-good { color: var(--primary-color); }
.latency-mid { color: var(--warning-color); }
.latency-bad { color: var(--error-color); }
.latency-none { color: var(--text-tertiary); }

.action-btn-group { display: inline-flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.action-btn { background: transparent; border: 1px solid var(--border-color); border-radius: 6px; padding: 4px 10px; font-size: 12px; color: var(--text-secondary); cursor: pointer; transition: var(--transition); font-weight: 600; white-space: nowrap;}
.action-btn:hover { background: var(--hover-bg); color: var(--info-color); border-color: var(--info-color); }

/* Status bar */
.status-bar { margin-bottom: 16px; color: var(--text-secondary); font-size: 14px; display: flex; align-items: center; justify-content: space-between; font-weight: 500;}
.status-left { display: flex; align-items: center; gap: 8px; }
.pulse-dot { width: 10px; height: 10px; background-color: var(--info-color); border-radius: 50%; animation: pulse-blue 1.5s infinite; display: none;}
.pulse-dot.active { display: block; }

/* Mixed probe tooltip & TCP badge */
.tooltip-wrapper { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.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; z-index: 1;}
.tooltip-content { position: absolute; bottom: 120%; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,0.85); color: #fff; padding: 10px 14px; border-radius: 8px; font-size: 12px; white-space: normal; width: 260px; text-align: left; opacity: 0; visibility: hidden; transition: var(--transition); z-index: 100; box-shadow: 0 4px 16px rgba(0,0,0,0.15); pointer-events: none; line-height: 1.5; font-weight: normal; }
html.dark-mode .tooltip-content { background: #334155; }
.tooltip-content::after { content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); border-width: 6px; border-style: solid; border-color: rgba(0,0,0,0.85) transparent transparent transparent; }
html.dark-mode .tooltip-content::after { border-top-color: #334155; }
.tooltip-wrapper:hover .tooltip-content { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(-4px); }
.tcp-badge { font-size: 10px; padding: 2px 6px; border-radius: 4px; background: rgba(114, 46, 209, 0.1); color: var(--accent); border: 1px solid rgba(114, 46, 209, 0.2); margin-left: 6px; vertical-align: middle; font-weight: bold;}

/* Action button group & capture */
.action-group { display: inline-flex; gap: 12px; flex-shrink: 0; align-items: center; }
.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); }

/* Page info section */
.page-info { margin-top: 24px; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 12px; padding: 24px; box-shadow: 0 2px 8px rgba(0,0,0,0.02); }
.page-info h2 { font-size: 18px; margin: 0 0 12px 0; color: var(--text-color); }
.page-info p { font-size: 14px; color: var(--text-secondary); line-height: 1.7; margin: 0 0 12px 0; }
.page-info ul { margin: 0 0 12px 0; padding-left: 20px; }
.page-info li { font-size: 13px; color: var(--text-secondary); line-height: 1.8; }
.page-info details { margin-bottom: 8px; }
.page-info summary { font-size: 14px; font-weight: 600; color: var(--text-color); cursor: pointer; padding: 8px 0; }
.page-info details p { margin-top: 4px; }

/* Animations */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse-blue { 0% { box-shadow: 0 0 0 0 rgba(24, 144, 255, 0.6); } 70% { box-shadow: 0 0 0 6px rgba(24, 144, 255, 0); } 100% { box-shadow: 0 0 0 0 rgba(24, 144, 255, 0); } }
@keyframes slideInUp { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }

/* Responsive */
@media (max-width: 900px) {
  .control-row { flex-direction: column; align-items: stretch; }
  .action-group { width: 100%; justify-content: stretch; }
  .btn-scan { width: 100%; flex: 1; }
  .capture-page-btn .btn-text { display: none; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .input-group { min-width: 100%; }
}

@media (max-width: 600px) {
  .summary-grid { grid-template-columns: 1fr; }
}
