/**
 * Custom Styles
 */

/* ============================================================================
   Global Improvements
   ============================================================================ */

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Better focus states for accessibility */
*:focus {
  outline: 2px solid #0d6efd;
  outline-offset: 2px;
}

/* ============================================================================
   Section Headers
   ============================================================================ */

.section-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border-color);
}

.section-header h2 {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-header h2 i {
  color: #0d6efd;
}

.section-header p {
  margin: 0;
  color: var(--text-secondary);
}

/* ============================================================================
   Category Sections
   ============================================================================ */

.category-section {
  margin-bottom: 3rem;
}

.category-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: #0d6efd;
  color: white;
  border-radius: 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.category-badge.security {
  background: #dc3545;
}

.category-badge.performance {
  background: #198754;
}

.category-badge.lookup {
  background: #0dcaf0;
}

/* ============================================================================
   Enhanced Cards
   ============================================================================ */

.feature-card {
  transition: transform 0.2s, box-shadow 0.2s;
  border: 2px solid transparent;
  height: 100%;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15) !important;
  border-color: #0d6efd;
}

.feature-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 1.1rem;
}

.feature-card .feature-icon {
  font-size: 1.5rem;
  margin-right: 0.5rem;
}

.feature-card .card-title {
  margin-bottom: 1.5rem;
}

.feature-card .btn-test {
  width: 100%;
  font-weight: 600;
  padding: 0.75rem;
  border-radius: 0.5rem;
  transition: all 0.2s;
}

.feature-card .btn-test:hover {
  transform: scale(1.02);
}

/* Compact view for smaller features */
.feature-card.compact .card-body {
  padding: 1rem;
}

.feature-card.compact .card-title {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

/* ============================================================================
   IP Display Enhancement
   ============================================================================ */

.ip-display {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 2rem;
  border-radius: 1rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .ip-display {
  background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
}

.ip-display .ip-value {
  font-size: 2rem;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  margin: 0.5rem 0;
}

.ip-display .ip-label {
  font-size: 0.875rem;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ip-display .ip-location {
  font-size: 1rem;
  opacity: 0.85;
  margin-top: 0.5rem;
}

.ip-details-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  backdrop-filter: blur(10px);
  transition: all 0.2s;
}

.ip-details-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  color: white;
  transform: scale(1.05);
}

/* ============================================================================
   Results Enhancement
   ============================================================================ */

.results-container {
  margin-top: 1.5rem;
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result-card {
  border-left: 4px solid #0d6efd;
  margin-bottom: 1rem;
}

.result-card.success {
  border-left-color: #198754;
}

.result-card.warning {
  border-left-color: #ffc107;
}

.result-card.danger {
  border-left-color: #dc3545;
}

/* ============================================================================
   Status Badges
   ============================================================================ */

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.status-badge i {
  font-size: 1rem;
}

/* ============================================================================
   Loading States
   ============================================================================ */

.loading-container {
  text-align: center;
  padding: 3rem 1rem;
}

.loading-spinner {
  width: 3rem;
  height: 3rem;
  border-width: 0.25rem;
}

.loading-text {
  margin-top: 1rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Skeleton loader */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 0.375rem;
}

[data-theme="dark"] .skeleton {
  background: linear-gradient(90deg, #2d3748 25%, #1a202c 50%, #2d3748 75%);
  background-size: 200% 100%;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* ============================================================================
   Collapsible Sections
   ============================================================================ */

.collapsible-section {
  margin-bottom: 1.5rem;
}

.collapse-trigger {
  cursor: pointer;
  user-select: none;
  transition: all 0.2s;
}

.collapse-trigger:hover {
  color: #0d6efd;
}

.collapse-trigger .collapse-icon {
  transition: transform 0.3s;
  display: inline-block;
}

.collapse-trigger[aria-expanded="true"] .collapse-icon {
  transform: rotate(90deg);
}

/* ============================================================================
   Tables
   ============================================================================ */

.table-modern {
  border-collapse: separate;
  border-spacing: 0 0.5rem;
}

.table-modern thead th {
  background: var(--card-header-bg);
  border: none;
  padding: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.875rem;
  letter-spacing: 0.5px;
}

.table-modern tbody tr {
  background: var(--card-bg);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: all 0.2s;
}

.table-modern tbody tr:hover {
  transform: scale(1.01);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.table-modern tbody td {
  border: none;
  padding: 1rem;
  vertical-align: middle;
}

.table-modern tbody tr td:first-child {
  border-radius: 0.5rem 0 0 0.5rem;
}

.table-modern tbody tr td:last-child {
  border-radius: 0 0.5rem 0.5rem 0;
}

/* ============================================================================
   Mobile Responsiveness
   ============================================================================ */

@media (max-width: 768px) {
  .ip-display .ip-value {
    font-size: 1.5rem;
  }

  .section-header h2 {
    font-size: 1.5rem;
  }

  /* Stack cards on mobile */
  .row .col-md-6 {
    margin-bottom: 1rem;
  }

  /* Hide table headers on mobile, show as cards */
  .table-responsive-mobile {
    display: block;
  }

  .table-responsive-mobile thead {
    display: none;
  }

  .table-responsive-mobile tbody,
  .table-responsive-mobile tr,
  .table-responsive-mobile td {
    display: block;
    width: 100%;
  }

  .table-responsive-mobile tr {
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
  }

  .table-responsive-mobile td {
    text-align: right;
    padding: 0.5rem 0;
    position: relative;
    padding-left: 50%;
  }

  .table-responsive-mobile td::before {
    content: attr(data-label);
    position: absolute;
    left: 0;
    font-weight: 600;
    text-align: left;
  }
}

/* ============================================================================
   Tooltips
   ============================================================================ */

.tooltip-trigger {
  cursor: help;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-color: var(--text-muted);
}

.info-icon {
  color: #0d6efd;
  cursor: help;
  font-size: 0.875rem;
  margin-left: 0.25rem;
}

/* ============================================================================
   Progress Bars
   ============================================================================ */

.progress-modern {
  height: 1.5rem;
  border-radius: 1rem;
  background: var(--card-header-bg);
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-modern .progress-bar {
  font-weight: 600;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: width 0.3s ease;
}

/* ============================================================================
   Empty States
   ============================================================================ */

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
}

.empty-state i {
  font-size: 3rem;
  opacity: 0.5;
  margin-bottom: 1rem;
}

.empty-state h5 {
  margin-bottom: 0.5rem;
}

.empty-state p {
  margin-bottom: 0;
  font-size: 0.9rem;
}

/* ============================================================================
   Footer Enhancement
   ============================================================================ */

footer {
  margin-top: 4rem;
  padding: 2rem 0 !important;
  border-top: 1px solid var(--border-color);
}

/* ============================================================================
   Utility Classes
   ============================================================================ */

.text-gradient {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.shadow-lg-hover {
  transition: box-shadow 0.3s;
}

.shadow-lg-hover:hover {
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175) !important;
}

.fade-in {
  animation: fadeIn 0.5s ease-in;
}

.slide-up {
  animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================================================
   Print Styles
   ============================================================================ */

@media print {
  .no-print {
    display: none !important;
  }

  body {
    background: white !important;
    color: black !important;
  }

  .card {
    break-inside: avoid;
  }
}
