/* App.css - Enhanced VNStat Dashboard Styles */

/* Base Styles */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: #030712 !important;
  color: #ffffff;
}

.no-scrollbar {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;     /* Firefox */
}

.no-scrollbar::-webkit-scrollbar {
  display: none;             /* Chrome, Safari and Opera */
}

/* Container Styles */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

.github {
  display: flex;
  justify-content: end;
  align-items: center;
  gap: 2px;
}

.github-icon {
  color: white;
  text-decoration: none; 
  display: inline-flex; 
  align-items: center; 
  gap: 4px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #1f2937;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #4b5563;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #6b7280;
}

/* Loading Animation */
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* Gradient Text */
.bg-gradient-to-r {
  background: linear-gradient(to right, #60a5fa, #a855f7);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Card Hover Effects */
.stats-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stats-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

/* Button Styles */
.tab-bar {
  background: #232c3b;
  border-radius: 10px;
  border: 1px solid #293042;
  padding: 6px 10px;
  display: flex;
  gap: 6px;
  /* tighter spacing between tabs */
  justify-content: flex-start;
  margin: 0 auto;
  width: fit-content;
  /* only as wide as content */
}

.tab-button {
  background: #232c3b;
  color: #e5e7eb;
  border: none;
  padding: 6px 16px;
  /* less horizontal padding */
  font-size: 0.97rem;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.16s;
  outline: none;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: none;
  position: relative;
}

.tab-button.active {
  background: #2563eb;
  color: #fff;
  font-weight: 600;
  border: none;
  box-shadow: 0 4px 24px 0 rgba(59, 130, 246, 0.10);
  z-index: 2;
}

.tab-button:not(.active):hover {
  background: #263045;
  color: #fff;
  /* no border! */
}

.tab-button:not(.active) {
  background: #232c3b;
  color: #e5e7eb;
  border: none;
  box-shadow: none;
}


/* Select Dropdown */
.interface-select {
  background-image: url("data:image/svg+xml;charset=US-ASCII,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'><path fill='%23ffffff' d='M2 0L0 2h4zm0 5L0 3h4z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  background-size: 0.65rem auto;
  padding-right: 2.5rem;
}

.interface-select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Table Styles */
.network-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  background: #1f2937;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.network-table th {
  background: #374151;
  color: #d1d5db;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid #4b5563;
}

.network-table td {
  padding: 1rem;
  border-bottom: 1px solid #374151;
  color: #e5e7eb;
  font-size: 0.875rem;
}

.network-table tr:hover {
  background-color: #374151;
}

.network-table tr:last-child td {
  border-bottom: none;
}

/* Chart Container */
.chart-container {
  background: #1f2937;
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid #374151;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
  .label-text {
    display: none;
  }
  
  .container {
    padding: 0 0.5rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .tab-bar {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    white-space: nowrap;
    flex-wrap: nowrap;
    justify-content: flex-start;
    padding-bottom: 6px;
    gap: 8px;
    min-width: max-content;
  }

  .tab-button {
    flex-shrink: 0;
  }

  .network-table th,
  .network-table td {
    padding: 0.5rem;
    font-size: 0.75rem;
  }

  .chart-container {
    padding: 1rem;
  }
}

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

  .header-title {
    font-size: 2rem;
  }

  .section-title {
    font-size: 1.25rem;
  }

  .network-table {
    font-size: 0.75rem;
  }

  .network-table th,
  .network-table td {
    padding: 0.75rem 0.5rem;
  }
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.font-bold {
  font-weight: 700;
}

.font-semibold {
  font-weight: 600;
}

.font-medium {
  font-weight: 500;
}

.text-sm {
  font-size: 0.875rem;
}

.text-base {
  font-size: 1rem;
}

.text-lg {
  font-size: 1.125rem;
}

.text-xl {
  font-size: 1.25rem;
}

.text-2xl {
  font-size: 1.5rem;
}

.text-3xl {
  font-size: 1.875rem;
}

.text-4xl {
  font-size: 2.25rem;
}

.mb-2 {
  margin-bottom: 0.5rem;
}

.mb-3 {
  margin-bottom: 0.75rem;
}

.mb-4 {
  margin-bottom: 1rem;
}

.mb-6 {
  margin-bottom: 1.5rem;
}

.mb-8 {
  margin-bottom: 2rem;
}

.mt-2 {
  margin-top: 0.5rem;
}

.mt-4 {
  margin-top: 1rem;
}

.mt-6 {
  margin-top: 1.5rem;
}

.mt-8 {
  margin-top: 2rem;
}

.ml-2 {
  margin-left: 0.5rem;
}

.p-3 {
  padding: 0.75rem;
}

.p-4 {
  padding: 1rem;
}

.p-6 {
  padding: 1.5rem;
}

.p-8 {
  padding: 2rem;
}

.px-3 {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

.px-4 {
  padding-left: 1rem;
  padding-right: 1rem;
}

.py-2 {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.py-3 {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.rounded {
  border-radius: 0.25rem;
}

.rounded-md {
  border-radius: 0.375rem;
}

.rounded-lg {
  border-radius: 0.5rem;
}

.rounded-xl {
  border-radius: 0.75rem;
}

.shadow-sm {
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.shadow {
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.shadow-lg {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.shadow-xl {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.border {
  border-width: 1px;
}

.border-t {
  border-top-width: 1px;
}

.border-b {
  border-bottom-width: 1px;
}

.flex {
  display: flex;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.hidden {
  display: none;
}

.block {
  display: block;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-2 {
  gap: 0.5rem;
}

.gap-3 {
  gap: 0.75rem;
}

.gap-4 {
  gap: 1rem;
}

.gap-6 {
  gap: 1.5rem;
}

.w-full {
  width: 100%;
}

.h-full {
  height: 100%;
}

.min-h-screen {
  min-height: 100vh;
}

.overflow-hidden {
  overflow: hidden;
}

.overflow-x-auto {
  overflow-x: auto;
}

.transition-all {
  transition: all 0.15s ease;
}

.transition-colors {
  transition: color 0.15s ease, background-color 0.15s ease;
}

/* Color Classes */
.text-white {
  color: #ffffff;
}

.text-gray-300 {
  color: #d1d5db;
}

.text-gray-400 {
  color: #9ca3af;
}

.text-gray-500 {
  color: #6b7280;
}

.text-blue-400 {
  color: #60a5fa;
}

.text-blue-500 {
  color: #3b82f6;
}

.text-green-400 {
  color: #34d399;
}

.text-purple-400 {
  color: #a78bfa;
}

.text-orange-400 {
  color: #fb923c;
}

.bg-gray-800 {
  background-color: #1f2937;
}

.bg-gray-900 {
  background-color: #111827;
}

.bg-gray-950 {
  background-color: #030712;
}

.border-gray-700 {
  border-color: #374151;
}

.border-gray-800 {
  border-color: #1f2937;
}

.focus\:outline-none:focus {
  outline: none;
}

.focus\:ring-2:focus {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5);
}

.focus\:ring-blue-500:focus {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5);
}

.focus\:border-blue-500:focus {
  border-color: #3b82f6;
}

.hover\:bg-gray-700:hover {
  background-color: #374151;
}

.hover\:text-white:hover {
  color: #ffffff;
}

/* Custom Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

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

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

@keyframes slideIn {
  from {
    transform: translateX(-10px);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.slide-in {
  animation: slideIn 0.3s ease-out;
}

/* Chart Customizations */
.recharts-wrapper {
  font-family: inherit;
}

.recharts-tooltip-wrapper {
  z-index: 1000;
}

.recharts-cartesian-axis-tick-value {
  fill: #9ca3af;
  font-size: 12px;
}

.recharts-cartesian-grid-horizontal line,
.recharts-cartesian-grid-vertical line {
  stroke: #374151;
}

/* Error States */
.error-message {
  color: #ef4444;
  background-color: #7f1d1d;
  border: 1px solid #991b1b;
  padding: 1rem;
  border-radius: 0.5rem;
  margin: 1rem 0;
}

.success-message {
  color: #10b981;
  background-color: #064e3b;
  border: 1px solid #065f46;
  padding: 1rem;
  border-radius: 0.5rem;
  margin: 1rem 0;
}

/* Focus States for Accessibility */
.tab-button:focus,
.interface-select:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5);
}

/* Print Styles */
@media print {
  body {
    background: white !important;
    color: black !important;
  }

  .bg-gray-800,
  .bg-gray-900,
  .bg-gray-950 {
    background: white !important;
    color: black !important;
  }

  .text-white,
  .text-gray-300,
  .text-gray-400 {
    color: black !important;
  }

  .border-gray-700,
  .border-gray-800 {
    border-color: #ccc !important;
  }
}