/* Custom styling for RadioDetector Dashboard with Bootstrap */
@import url('https://fonts.googleapis.com/css2?family=Red+Hat+Display:ital,wght@0,300..900;1,300..900&display=swap');

* {
  font-family: "Red Hat Display", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
  min-height: 100vh;
  padding: 20px;
}

/* Navbar customization */
.navbar {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  border-radius: 8px;
}

main {
  background: rgba(255, 255, 255, 0.98);
  border-radius: 12px;
  padding: 30px;
  max-width: 1400px;
  margin: 0 auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.subtitle {
  color: #666;
  margin: 0 0 30px 0;
  font-weight: 500;
}

/* Statistics Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.stat-card {
  color: #333;
  padding: 25px;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Compact stats next to header */
.stats-compact {
  display: flex;
  gap: 15px;
  flex-shrink: 0;
}

.stat-card-small {
  background: rgba(0, 0, 0, 0.03);
  padding: 10px 15px;
  border-radius: 8px;
  text-align: center;
  min-width: 100px;
}

.stat-value-small {
  font-size: 1.5rem;
  font-weight: 700;
  color: #333;
  line-height: 1;
}

.stat-label-small {
  font-size: 0.75rem;
  color: #666;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Tracking lists */
.tracking-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tracking-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.tracking-badge {
  display: inline-block;
  background: #667eea;
  color: white;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}

.tracking-badge-empty {
  display: inline-block;
  background: rgba(0, 0, 0, 0.05);
  color: #999;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-style: italic;
}

/* DataTables Bootstrap customization */
table.dataTable {
  font-size: 0.875rem;
}

table.dataTable thead th {
  font-weight: 600;
}

/* Log controls and container */
.log-controls {
  margin-bottom: 1rem;
}

.log-container {
  font-family: 'Courier New', monospace;
  white-space: pre-wrap;
  max-height: 600px;
  overflow-y: auto;
  background: black;
  color: greenyellow;
  border: 1px solid #444;
  border-radius: 0.375rem;
  padding: 1rem;
}

.auto-refresh-status {
  font-size: 0.875rem;
}

/* Action buttons */
.actions {
  margin-bottom: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  main {
    padding: 15px;
  }

  /* Fix header layout on mobile */
  main > div[style*="display: flex; justify-content: space-between"] {
    flex-direction: column !important;
    gap: 20px !important;
  }

  main > div[style*="display: flex; justify-content: space-between"] > div {
    flex-direction: column !important;
    width: 100% !important;
  }

  main > div[style*="display: flex; justify-content: space-between"] > div > div {
    flex-direction: column !important;
    width: 100% !important;
  }
  
  .stats-compact {
    margin-top: 15px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .stat-card-small {
    min-width: 80px;
  }

  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  h3 {
    font-size: 1rem;
  }

  .subtitle {
    font-size: 0.9rem;
  }

  /* Make tables scrollable on mobile */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Better navbar on mobile */
  .navbar-text {
    margin-top: 10px;
    display: block;
  }

  /* Fix header image overflow */
  img {
    max-width: 100%;
    height: auto !important;
    max-height: 5em !important;
  }

  /* Stack tracking badges vertically on mobile */
  .tracking-list {
    width: 100%;
    margin-bottom: 15px;
  }

  .tracking-badge {
    display: inline-block;
    margin-right: 5px;
    margin-bottom: 4px;
  }
}

/* Station links in table */
.station-link {
  color: #0d6efd;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.station-link:hover {
  color: #0a58ca;
  text-decoration: underline;
}

/* Compact statistics table for station page */
.compact-stats-table {
    td {
        padding: 0.5rem 0;
        border-bottom: 1px solid #e9ecef;
        
        &:first-child {
            color: #6c757d;
            font-weight: 500;
        }
        
        &:last-child {
            text-align: right;
            font-weight: 600;
            color: #1d4638;
            font-size: 1.1rem;
        }
    }
    
    tr:last-child td {
        border-bottom: none;
    }
}