/* Port Scanner Specific Styles */

.main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

@media (max-width: 768px) {
  .main-grid {
    grid-template-columns: 1fr;
  }
}

.port-range-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.port-range-group .input-field {
  flex: 1;
}

.range-separator {
  font-weight: 600;
  color: #6c757d;
  font-size: 16px;
}

.scan-progress {
  margin-bottom: 16px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #e9ecef;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea, #764ba2);
  width: 0%;
  transition: width 0.3s ease;
  border-radius: 4px;
}

.progress-text {
  font-size: 12px;
  color: #6c757d;
  text-align: center;
}

.scan-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.stat-item {
  background: rgba(255,255,255,0.8);
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #dee2e6;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stat-label {
  font-size: 12px;
  color: #6c757d;
  font-weight: 500;
}

.stat-value {
  font-size: 14px;
  font-weight: 600;
  color: #2c3e50;
  font-family: monospace;
}

.result-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.filter-btn {
  padding: 6px 12px;
  border: 1px solid #dee2e6;
  background: white;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  background: #f8f9fa;
  border-color: #667eea;
}

.filter-btn.active {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border-color: #667eea;
}

.result-container {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  background: #f8f9fa;
}

.result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid #e9ecef;
  transition: background 0.2s ease;
}

.result-item:last-child {
  border-bottom: none;
}

.result-item:hover {
  background: rgba(102, 126, 234, 0.05);
}

.result-item.open {
  background: rgba(40, 167, 69, 0.1);
  border-left: 3px solid #28a745;
}

.result-item.closed {
  background: rgba(220, 53, 69, 0.1);
  border-left: 3px solid #dc3545;
}

.result-item.scanning {
  background: rgba(255, 193, 7, 0.1);
  border-left: 3px solid #ffc107;
}

.port-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.port-number {
  font-family: monospace;
  font-weight: 600;
  font-size: 14px;
  color: #2c3e50;
  min-width: 60px;
}

.port-service {
  font-size: 12px;
  color: #6c757d;
  background: rgba(255,255,255,0.8);
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid #e9ecef;
}

.port-status {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.port-status.open {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.port-status.closed {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.port-status.scanning {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

.common-ports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.common-port-item {
  background: rgba(255,255,255,0.8);
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.common-port-item:hover {
  background: rgba(102, 126, 234, 0.1);
  border-color: #667eea;
  transform: translateY(-1px);
}

.common-port-number {
  font-family: monospace;
  font-weight: 600;
  color: #2c3e50;
}

.common-port-service {
  font-size: 11px;
  color: #6c757d;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #6c757d;
  font-style: italic;
}

.empty-state svg {
  width: 48px;
  height: 48px;
  opacity: 0.3;
  margin-bottom: 12px;
}

.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

@media (max-width: 768px) {
  .scan-stats {
    grid-template-columns: 1fr;
  }
  
  .common-ports-grid {
    grid-template-columns: 1fr;
  }
  
  .result-filters {
    justify-content: center;
  }
  
  .toolbar {
    justify-content: center;
  }
  
  .port-range-group {
    flex-direction: column;
    gap: 8px;
  }
  
  .range-separator {
    transform: rotate(90deg);
  }
}

/* 动画效果 */
.result-item.new {
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.scanning-indicator {
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* 滚动条样式 */
.result-container::-webkit-scrollbar {
  width: 6px;
}

.result-container::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.result-container::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.result-container::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}