/* Design System - Checklist de Carros */
:root {
  --primary-color: #0D4796;
  /* Azul Royal */
  --primary-dark: #071D49;
  /* Azul Profundo */
  --primary-light: #2a6ed4;
  --bg-color: #101820;
  /* Preto Profundo */
  --white: #D0D0CE;
  /* Prata Luxo */
  --text-dark: #101820;
  /* Preto profundo para texto em fundo claro */
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 6px 12px rgba(0, 0, 0, 0.6);
  --transition: all 0.3s ease;
  --border-radius: 8px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Montserrat', sans-serif;
  background: var(--bg-color);
  color: var(--white);
  min-height: 100vh;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

/* Header */
/* Header */
.header {
  background: transparent;
  color: var(--white);
  padding: 10px 10px 5px;
  text-align: center;
  width: 100%;
  max-width: 100%;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  box-shadow: none;
  flex-shrink: 0;
}

.logo-img {
  width: auto;
  max-width: 90%;
  height: 300px;
  object-fit: contain;
  /* Negative margins to remove image whitespace */
  margin-top: -80px;
  margin-bottom: -80px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
  transition: transform 0.3s ease;
}

.header h2,
.header span {
  font-size: 2rem;
  /* Fixed size, no longer depends on screen height */
  margin: 0;
}

/* Container principal */
.container {
  background: linear-gradient(145deg, var(--primary-dark) 0%, #0a2a6c 100%);
  color: var(--white);
  padding: 30px;
  border-radius: var(--border-radius);
  max-width: 600px;
  width: 90%;
  margin: 10px auto;
  /* Reduced top margin, centered horizontally */
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
  margin-bottom: auto;
}

/* Labels e textos */
label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--white);
}

/* Inputs */
input {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--border-radius);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.3);
  color: var(--white);
  font-size: 15px;
  font-family: inherit;
  transition: var(--transition);
  margin-bottom: 20px;
}

input:focus {
  outline: none;
  border-color: var(--primary-color);
  background: rgba(0, 0, 0, 0.5);
  box-shadow: 0 0 0 3px rgba(13, 71, 150, 0.3);
}

input::placeholder {
  color: rgba(208, 208, 206, 0.5);
}

select {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--border-radius);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.3);
  color: var(--white);
  font-size: 15px;
  font-family: inherit;
  transition: var(--transition);
  margin-bottom: 20px;
  appearance: none;
  /* Modern browser support */
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23D0D0CE%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right .7em top 50%;
  background-size: .65em auto;
}

select:focus {
  outline: none;
  border-color: var(--primary-color);
}

/* Currency Input Styling */
.currency-wrapper {
  position: relative;
  margin-bottom: 20px;
}

.currency-wrapper input {
  margin-bottom: 0;
  padding-left: 40px;
  /* Space for R$ */
}

.currency-symbol {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.6);
  pointer-events: none;
  font-weight: 500;
}

/* Botões */
button {
  width: 100%;
  padding: 14px 24px;
  background: var(--primary-color);
  color: var(--white);
  font-weight: 700;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 16px;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: var(--transition);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  background: #155bc4;
}

button:active {
  transform: translateY(0);
}

button.secondary {
  background: transparent;
  border: 2px solid var(--white);
  color: var(--white);
}

button.secondary:hover {
  background: rgba(208, 208, 206, 0.1);
}

button.small {
  width: auto;
  padding: 10px 20px;
  font-size: 14px;
}

/* Cards de carro e itens de lista */
.carro-item {
  background: rgba(255, 255, 255, 0.05);
  /* Glass feel */
  color: var(--white);
  padding: 16px 20px;
  border-radius: var(--border-radius);
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow);
  transition: var(--transition);
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.carro-item:hover {
  transform: translateX(5px);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-hover);
}

.carro-item span {
  font-weight: 600;
  font-size: 14px;
}

.carro-item button {
  width: auto;
  padding: 10px 16px;
  font-size: 12px;
  background: var(--primary-color);
  color: var(--white);
  box-shadow: none;
}

.carro-item button:hover {
  background: #155bc4;
}

/* Lista de carros */
#listaCarros {
  margin-top: 20px;
}

.no-carros {
  text-align: center;
  padding: 20px;
  opacity: 0.8;
  font-style: italic;
  color: var(--white);
}

/* Mensagens de erro/sucesso */
.message {
  padding: 12px 16px;
  border-radius: var(--border-radius);
  margin-bottom: 16px;
  font-weight: 500;
}

.message.error {
  background: rgba(255, 82, 82, 0.2);
  color: #ff5252;
  border: 1px solid rgba(255, 82, 82, 0.3);
}

.message.success {
  background: rgba(76, 175, 80, 0.2);
  color: #4caf50;
  border: 1px solid rgba(76, 175, 80, 0.3);
}

.message.warning {
  background: rgba(255, 152, 0, 0.2);
  color: #ff9800;
  border: 1px solid rgba(255, 152, 0, 0.3);
}

.pending-alert {
  background: rgba(255, 215, 0, 0.15);
  border: 1px solid #FFD700;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
  text-align: center;
}

.pending-alert p {
  color: #FFD700;
  margin-bottom: 15px;
  font-weight: bold;
}

/* Links */
.link {
  color: var(--white);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
  opacity: 0.8;
}

.link:hover {
  opacity: 1;
  text-decoration: underline;
}

/* Flex utilities */
.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gap-10 {
  gap: 10px;
}

.gap-20 {
  gap: 20px;
}

.flex-col {
  display: flex;
  flex-direction: column;
}

.text-center {
  text-align: center;
}

.mt-20 {
  margin-top: 20px;
}

.mb-20 {
  margin-bottom: 20px;
}

/* Responsivo */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  .container {
    padding: 20px;
    margin: auto;
    width: 95%;
  }

  .header {
    margin: 10px auto;
    padding: 12px 20px;
    font-size: 14px;
  }

  /* Barra de ações no mobile - botões empilhados */
  .action-bar {
    flex-direction: column;
    gap: 10px;
  }

  .action-bar button {
    width: 100%;
  }

  .flex-between {
    flex-direction: column;
    gap: 10px;
  }

  .flex-between button.small {
    width: 100%;
  }

  .carro-item {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .carro-item button {
    width: 100%;
  }

  .carro-item>div {
    width: 100%;
    flex-direction: column !important;
  }
}

/* Mobile pequeno (smartphones) */
@media (max-width: 480px) {
  .header {
    font-size: 12px;
    padding: 10px 15px;
    letter-spacing: 1px;
  }

  .container {
    padding: 15px;
    margin: auto;
  }

  button {
    padding: 12px 20px;
    font-size: 14px;
  }

  button.small {
    padding: 12px 16px;
    font-size: 13px;
  }

  label {
    font-size: 13px;
  }

  input,
  select {
    padding: 12px 14px;
    font-size: 14px;
  }
}

/* Animações */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.container {
  animation: fadeIn 0.4s ease-out;
}

.carro-item {
  animation: fadeIn 0.3s ease-out;
}

/* Loading state */
.loading {
  opacity: 0.7;
  pointer-events: none;
}

button.loading::after {
  content: '...';
  animation: dots 1s infinite;
}

@keyframes dots {

  0%,
  20% {
    content: '.';
  }

  40% {
    content: '..';
  }

  60%,
  100% {
    content: '...';
  }
}

/* Admin specific overrides if needed */
.admin-nav button.active {
  background: #FFD700 !important;
  color: #333 !important;
}

/* Admin Desktop Layout Revisions */
@media (min-width: 1024px) {
  body.admin-page {
    /* Ensure body allows full width usage */
    align-items: center;
  }

  body.admin-page .header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 20px 50px;
    margin-top: -80px;
    margin-bottom: -80px;
    width: 100%;
    max-width: 1400px;
  }

  body.admin-page .logo-img {
    height: 250px;
    width: auto;
    margin-top: -80px;
    margin-bottom: -80px;
    margin: 0;
    /* Reset negative margins */
    order: 1;
  }

  body.admin-page .header h2 {
    order: 2;
    flex: 1;
    margin-top: -80px;
    margin-bottom: -80px;
    text-align: center;
    margin-right: 233px;
    font-size: 2.5rem;
    letter-spacing: 4px;
    /* More premium spacing */
  }

  /* Wider container for Admin */
  body.admin-page .container {
    max-width: 1200px;
    width: 95%;
  }

  /* Horizontal Nav occupying more space */
  body.admin-page .admin-nav {
    flex-direction: row;
    gap: 20px;
    margin-bottom: 30px;
  }

  body.admin-page .admin-nav button {
    flex: 1;
    padding: 18px;
    font-size: 16px;
    border-radius: 12px;
  }

  /* Adjust stats grid for wider screen */
  body.admin-page .stats-grid {
    gap: 25px;
  }

  body.admin-page .stat-card {
    padding: 30px;
  }

  body.admin-page .stat-value {
    font-size: 42px;
  }
}

/* Modal Header Fixes */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 15px;
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
}

.modal-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-delete-btn {
  width: auto !important;
  padding: 8px 15px !important;
  background: rgba(255, 82, 82, 0.2) !important;
  color: #ff5252 !important;
  border: 1px solid rgba(255, 82, 82, 0.3) !important;
  font-size: 12px !important;
  display: flex;
  align-items: center;
  gap: 5px;
}

.modal-delete-btn:hover {
  background: rgba(255, 82, 82, 0.4) !important;
}

.modal-close {
  width: 32px !important;
  height: 32px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.1) !important;
  color: white !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  font-size: 16px !important;
  border: none !important;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.3) !important;
  transform: rotate(90deg);
}