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

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: #f4f7f6;
  margin: 0;
  padding: 0;
  color: #333;
  line-height: 1.6;
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 30px auto;
  background: #fff;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.header {
  text-align: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid #eee;
}

h1 {
  margin: 0 0 10px;
  color: #2c3e50;
  font-size: 2.2em;
}

h2 {
  color: #34495e;
  font-size: 1.5em;
  margin-bottom: 15px;
}

p.subtitle {
  color: #7f8c8d;
  margin: 0;
  font-size: 1.1em;
}

/* Navigation Bar */
.nav-bar {
  text-align: center;
  margin-bottom: 30px;
  padding: 12px;
  background: #eef2f3;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px;
}

.nav-bar a {
  font-weight: 600;
  text-decoration: none;
  color: #555;
  padding: 8px 16px;
  border-radius: 5px;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-bar a:hover {
  background-color: #dfe6e9;
  color: #000;
}

.nav-bar a.active {
  color: #0056b3;
  background-color: #d6eaf8;
}

/* Forms & Inputs */
form {
  margin-bottom: 20px;
}

label {
  display: block;
  margin: 10px 0 5px;
  font-weight: 600;
  color: #555;
}

input,
select {
  padding: 10px;
  width: 100%;
  margin-bottom: 15px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 14px;
  transition: border-color 0.3s;
}

input:focus,
select:focus {
  outline: none;
  border-color: #007bff;
}

/* Buttons */
button,
.btn {
  background: #007bff;
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition:
    background 0.2s,
    transform 0.1s;
  display: inline-block;
  text-align: center;
}

button:hover,
.btn:hover {
  background: #0056b3;
  transform: translateY(-1px);
}

button:disabled,
.btn:disabled {
  background: #95a5a6;
  cursor: not-allowed;
  transform: none;
}

.btn-danger {
  background: #dc3545;
}
.btn-danger:hover {
  background: #bd2130;
}

.btn-warning {
  background: #ffc107;
  color: #212529;
}
.btn-warning:hover {
  background: #e0a800;
}

.btn-success {
  background: #28a745;
}
.btn-success:hover {
  background: #218838;
}

/* Result Cards & Alerts */
.result-card {
  background: #fff;
  border: 1px solid #c3e6cb;
  border-left: 5px solid #28a745;
  padding: 15px;
  margin-top: 15px;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

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

.result-title {
  font-weight: bold;
  font-size: 1.1em;
  margin-bottom: 10px;
  display: block;
  color: #333;
}

.info-row {
  margin: 5px 0;
  font-size: 0.95em;
}

.label-bold {
  font-weight: bold;
  color: #555;
  width: 120px;
  display: inline-block;
}

/* Status Badges */
.status-badge {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.85em;
  font-weight: bold;
  text-transform: capitalize;
}

.status-running,
.status-active {
  background-color: #d4edda;
  color: #155724;
}
.status-stopped,
.status-inactive {
  background-color: #f8d7da;
  color: #721c24;
}
.status-processing {
  background-color: #cce5ff;
  color: #004085;
}
.status-error {
  background-color: #fff3cd;
  color: #856404;
}

/* Tables */
.table-responsive {
  overflow-x: auto;
  width: 100%;
}

.styled-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
  font-size: 0.9em;
}

.styled-table th,
.styled-table td {
  border: 1px solid #ddd;
  padding: 12px 15px;
  text-align: left;
}

.styled-table th {
  background-color: #f8f9fa;
  color: #333;
  font-weight: 600;
}

.styled-table tr:nth-child(even) {
  background-color: #f9f9f9;
}

.styled-table tr:hover {
  background-color: #f1f1f1;
}

/* Sections */
.section {
  margin-bottom: 40px;
  padding: 20px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #eaeaea;
}

.stream-img {
  border: 3px solid #007bff;
  border-radius: 8px;
  max-width: 100%;
  height: auto;
  margin-top: 15px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

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

.stat-card {
  background: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  text-align: center;
  border-top: 4px solid #bdc3c7;
}

/* Stat Card Colors */
.stat-card.cars {
  border-top-color: #2ecc71;
}
.stat-card.motorbikes {
  border-top-color: #3498db;
}
.stat-card.cycles {
  border-top-color: #f1c40f;
}
.stat-card.buses {
  border-top-color: #e67e22;
}
.stat-card.trucks {
  border-top-color: #8e44ad;
}
.stat-card.rickshaws {
  border-top-color: #1abc9c;
}
.stat-card.people {
  border-top-color: #e74c3c;
}

.stat-value {
  font-size: 2.5em;
  font-weight: bold;
  color: #2c3e50;
  margin: 10px 0;
}

.stat-label {
  font-size: 0.9em;
  color: #7f8c8d;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 15px;
    margin: 15px;
  }

  .nav-bar {
    flex-direction: column;
  }

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