@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&family=Roboto:wght@300;400;500&display=swap');

:root {
  --accent-color: #007acc;
  --accent-light: #2d6ea0;
  --bg-dark: #1e4792;
  --bg-card: rgba(15, 23, 42, 0.8);
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-color: #1e293b;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  outline: none;
}

body {
  background: var(--bg-dark);
  font-family: 'Roboto', sans-serif;
  margin: 0;
  padding: 0;
  position: relative;
  line-height: normal;
  user-select: none;
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Background with animation */
#bg {
  position: fixed;
  width: 100vw;
  height: 100vh;
  background-image: linear-gradient(
      rgba(15, 23, 42, 0.7),
      rgba(15, 23, 42, 0.7)
    ),
    url(../src/background.png);
  image-rendering: optimizeQuality;
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  z-index: -1;
  animation: bgZoom 30s infinite alternate;
}

@keyframes bgZoom {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(1.05);
  }
}

/* Stats Container */
.stats-container {
  position: sticky;
  top: 0;
  margin-bottom: 20px;
  padding: 15px 20px;
  background-color: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(10px);
  color: white;
  z-index: 1000;
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.stats {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.stat-item {
  margin: 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
}

.stat-item::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-color);
}

.stat-date {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Main Container */
.container {
  max-width: 1200px;
  margin: 2% auto;
  padding: 30px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: 'Roboto', sans-serif;
  font-size: 1em;
  line-height: normal;
  border-radius: 16px;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.container:hover {
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

.container h1 {
  text-align: center;
  margin-bottom: 30px;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  position: relative;
  padding-bottom: 15px;
  font-family: 'Montserrat', sans-serif;
}

.container h1::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--accent-color),
    transparent
  );
}

/* Search Bar */
.search-container {
  position: relative;
  margin-bottom: 30px;
}

.search-bar {
  width: 100%;
  padding: 15px 20px 15px 50px;
  border: 1px solid var(--border-color);
  border-radius: 50px;
  background-color: rgba(30, 41, 59, 0.7);
  color: var(--text-primary);
  font-size: 1rem;
  transition: var(--transition);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.search-bar:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(0, 43, 130, 0.3);
}

.search-bar::placeholder {
  color: var(--text-muted);
}

.search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.2rem;
}

/* Sections */
section {
  margin: 30px 0;
  padding: 25px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background-color: rgba(30, 41, 59, 0.5);
  backdrop-filter: blur(5px);
  color: var(--text-primary);
  transition: var(--transition);
  animation: fadeIn 0.5s ease forwards;
  opacity: 0;
  transform: translateY(20px);
}

section:hover {
  border-color: var(--accent-light);
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

@keyframes fadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

section h2 {
  margin-bottom: 20px;
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--accent-color);
  font-family: 'Montserrat', sans-serif;
  position: relative;
  padding-bottom: 10px;
}

section h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 2px;
  background-color: var(--accent-color);
}

/* Vehicle Container */
.vehicle-container {
  margin-bottom: 25px;
  animation: slideIn 0.4s ease forwards;
  opacity: 0;
  transform: translateX(-20px);
}

@keyframes slideIn {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.vehicle {
  padding: 20px;
  border-radius: 10px;
  background-color: rgba(15, 23, 42, 0.5);
  margin-bottom: 15px;
  transition: var(--transition);
  border-left: 4px solid var(--accent-color);
}

.vehicle:hover {
  background-color: rgba(15, 23, 42, 0.7);
  transform: translateX(5px);
}

.vehicle h3 {
  margin-bottom: 15px;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.no-liveries {
  color: var(--danger);
  position: relative;
}

.no-liveries::after {
  content: 'No liveries available';
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8rem;
  background-color: var(--danger);
  color: white;
  padding: 3px 8px;
  border-radius: 20px;
}

/* Livery Items */
.livery {
  padding: 12px 15px;
  margin: 8px 0;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border-left: 3px solid var(--accent-light);
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 10px;
}

.livery:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: translateX(5px);
}

/* Section HR */
section hr {
  width: 100%;
  border: none;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--accent-color),
    transparent
  );
  margin: 20px 0;
}

/* Vehicle HR */
.vehicle-container hr {
  width: 100%;
  border: none;
  height: 1px;
  background-color: var(--border-color);
  margin: 15px 0;
}

/* Search Results Info */
.search-info {
  padding: 15px;
  background-color: rgba(30, 41, 59, 0.7);
  border-radius: 10px;
  margin-bottom: 20px;
  display: none;
  animation: fadeIn 0.3s ease;
}

.search-info.show {
  display: block;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.5);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: var(--accent-color);
  border-radius: 10px;
  transition: var(--transition);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-light);
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    margin: 5% auto;
    padding: 20px;
  }

  .stats {
    flex-direction: column;
    gap: 15px;
  }

  .stat-date {
    margin-left: 0;
  }

  section {
    padding: 15px;
  }

  .vehicle {
    padding: 15px;
  }
}

/* Loading Animation */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
  flex-direction: column;
  gap: 20px;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(0, 43, 130, 0.3);
  border-top: 5px solid var(--accent-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state h3 {
  margin-bottom: 10px;
  font-size: 1.5rem;
}

/* Filter Tags */
.filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.filter-tag {
  padding: 5px 15px;
  background-color: rgba(30, 41, 59, 0.7);
  border-radius: 20px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid var(--border-color);
}

.filter-tag:hover {
  background-color: var(--accent-color);
  color: white;
}

.filter-tag.active {
  background-color: var(--accent-color);
  color: white;
}

/* Export Button */
.export-btn {
  background: var(--accent-color);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 50px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.export-btn:hover {
  background: var(--accent-light);
  transform: translateY(-2px);
}

.stats-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.home-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--accent-color);
  color: white;
  padding: 12px 20px;
  border-radius: 50px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
  box-shadow: var(--shadow);
  z-index: 1000;
  border: none;
  cursor: pointer;
}

.home-button:hover {
  background: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  color: white;
  text-decoration: none;
}

/* Optional: Add some responsive behavior */
@media (max-width: 768px) {
  .home-button {
    bottom: 15px;
    right: 15px;
    padding: 10px 16px;
    font-size: 0.8rem;
  }
}
