/* CONTAINER */
.busca-corridas-container{
  display: flex;
  flex-direction: column;
  gap: 25px;
  padding: 50px 40px;
  max-width: 100%;
  margin: auto;
}

.busca-corridas-container h2{
  color: var(--primary);
  font-size: 1.8em;
}

/* GRID PRINCIPAL */
.busca-corridas{
  display: flex;
  gap: 30px;
  min-height: 600px;
}

/* SIDEBAR FILTROS - STICKY */
.sidebar-filtros {
  flex-shrink: 0;
  width: 300px;
  position: sticky;
  top: 100px;
  height: fit-content;
}

/* CONTAINER CARDS - SCROLL ILIMITADO */
.container-cards {
  flex: 1;
  overflow-y: auto;
  padding-right: 10px;
  scroll-behavior: smooth;
}

/* Scrollbar personalizado */
.container-cards::-webkit-scrollbar {
  width: 8px;
}

.container-cards::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.container-cards::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 10px;
}

.container-cards::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Firefox */
.container-cards {
  scrollbar-color: #888 #f1f1f1;
  scrollbar-width: thin;
}

@media (max-width: 768px) {
  .busca-corridas {
    flex-direction: column;
  }
  
  .sidebar-filtros {
    position: static;
    width: 100%;
    top: auto;
  }
  
  .container-cards {
    max-height: 500px;
  }

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

  .card {
    max-width: 100%;
  }
}

/* ================= FORM ================= */

.form{
  background: var(--secondary);
  padding: 25px;
  border-radius: 20px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.08);

  display: flex;
  flex-direction: column;
  gap: 15px;

  height: fit-content;
}

.form h3{
  color: var(--primary);
  margin-bottom: 5px;
}

/* CAMPOS */

.campo{
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.campo label{
  font-weight: 500;
  font-size: 0.85em;
  color: var(--primary);
}

.campo input,
.campo select{
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #ddd;
  outline: none;
  transition: 0.3s;
  background: var(--gray);
}

.campo input::placeholder{
  color: #999;
}

.campo input:focus,
.campo select:focus{
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(255,107,0,0.2);
}

/* BOTÃO DE BUSCA MODERNO */
.btn-wrapper {
  background: rgba(255, 255, 255, 0.96);
  border-radius: 28px;
  padding: 12px;
  margin-top: 20px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

.form button.btn-buscar {
  background: linear-gradient(135deg, var(--accent) 0%, #ff8c00 100%);
  color: white;
  border: none;
  padding: 16px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1em;
  cursor: pointer;
  transition: background 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 6px 14px rgba(255, 107, 0, 0.22);
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 1px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.form button.btn-buscar:hover {
  background: linear-gradient(135deg, #ff8c00 0%, var(--accent) 100%);
  box-shadow: 0 8px 18px rgba(255, 107, 0, 0.26);
}

.form button.btn-buscar:active {
  box-shadow: 0 4px 10px rgba(255, 107, 0, 0.18);
}

/* ================= RESULTADOS ================= */

.resultados{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap:20px;
  justify-content:flex-start;
  background-color: transparent;
  padding: 0;
}

/* CARD */

.card{
  width:100%;
  max-width:320px;
  height:420px; /* altura fixa = formato retângulo */
  
  background:white;
  border-radius:18px;
  overflow:hidden;
  box-shadow:0 10px 25px rgba(0,0,0,0.08);
  transition:0.3s;

  display:flex;
  flex-direction:column;
}

.card:hover{
  transform:translateY(-8px);
  box-shadow:0 20px 40px rgba(0,0,0,0.12);
}

/* IMAGEM */
.card-image{
  position:relative;
  height:160px;
  overflow:hidden;
}

.card-image img{
  width:100%;
  height:100%;
  object-fit:cover;
  transition:0.4s;
}

.card:hover .card-image img{
  transform:scale(1.08);
}

/* TAG */
.tag{
  position:absolute;
  top:12px;
  left:12px;
  background:rgba(255,107,0,0.95);
  color:white;
  padding:6px 14px;
  border-radius:20px;
  font-size:12px;
  font-weight:bold;
  text-transform: uppercase;
}

.card-status {
  position:absolute;
  top:12px;
  right:12px;
  display:flex;
  align-items:center;
  gap:8px;
  background: rgba(255,255,255,0.92);
  color: #222;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.8em;
  font-weight: 700;
  letter-spacing: 0.3px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.card-status::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #24b34a;
}

.card-status.realizada::before {
  background: #e94e4e;
}

.card-status.agendada::before {
  background: #24b34a;
}

/* CONTEÚDO */
.card-content{
  padding:20px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  flex:1;
}

.card-content h2{
  font-size:18px;
  color:var(--primary);
}

/* DESCRIÇÃO */
.card-content p{
  font-size:14px;
  color:#555;
}

/* INFO */
.card-info{
  display:flex;
  justify-content:space-between;
  font-size:13px;
  color:#777;
}

/* EXTRA (baseado no formulário) */
.card-extra{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:5px;
}

.card-extra span{
  background:var(--gray);
  padding:5px 10px;
  border-radius:8px;
  font-size:12px;
}

/* BOTÃO */
.card button{
  margin-top:10px;
  padding:10px;
  border:none;
  border-radius:25px;
  background:var(--accent);
  color:white;
  font-weight:bold;
  cursor:pointer;
  transition:0.3s;
}

.card button:hover{
  opacity:0.85;
}
/* ================= RESPONSIVO ================= */

@media(max-width: 768px){

  .busca-corridas{
    grid-template-columns: 1fr;
  }

  .form{
    order: 1;
    max-height: 70vh;
    overflow-y: auto;
    padding-bottom: 140px;
    position: relative;
  }

  .resultados{
    order: 2;
    grid-template-columns: 1fr;
  }

  .card {
    max-width: 100%;
  }

  .btn-wrapper {
    position: sticky;
    bottom: 10px;
    z-index: 2;
  }

}

/* Desktop: botão fixo e rolagem no formulário */
@media(min-width: 769px) {
  .form {
    max-height: 70vh;
    overflow-y: auto;
    padding-bottom: 80px; /* espaço para o botão fixo */
  }

  .btn-buscar {
    position: sticky;
    bottom: 20px;
    margin-top: 20px;
    z-index: 10;
  }
}

/* ================= MODAL MODERNO ================= */

.modal {
  display: flex;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.8);
  backdrop-filter: blur(5px);
  align-items: center;
  justify-content: center;
  animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.modal-content {
  background: white;
  border-radius: 20px;
  width: 95%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px rgba(0,0,0,0.3);
  position: relative;
  animation: modalSlideIn 0.4s ease-out;
  z-index: 10001;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255,255,255,0.9);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 24px;
  font-weight: bold;
  color: var(--primary);
  cursor: pointer;
  z-index: 10002;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.modal-close:hover {
  background: white;
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

/* HERO SECTION */
.modal-hero {
  position: relative;
  height: 250px;
  border-radius: 20px 20px 0 0;
  overflow: hidden;
}

.modal-hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.7);
}

.modal-hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(10, 40, 64, 0.8) 0%, rgba(255, 107, 0, 0.6) 100%);
}

.modal-hero-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 30px;
  color: white;
}

.modal-title {
  font-size: 2em;
  font-weight: 700;
  margin-bottom: 15px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.modal-badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-primary {
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.3);
}

.badge-secondary {
  background: rgba(255,107,0,0.8);
  border: 1px solid rgba(255,107,0,1);
}

.badge-accent {
  background: rgba(10,40,64,0.8);
  border: 1px solid rgba(10,40,64,1);
}

/* MODAL BODY */
.modal-body {
  padding: 30px;
}

.modal-description {
  margin-bottom: 30px;
  font-size: 1.1em;
  line-height: 1.6;
  color: #555;
  text-align: center;
  padding: 20px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 15px;
  border-left: 4px solid var(--accent);
}

/* GRID DE CARDS */
.modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.info-card {
  background: white;
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
  border: 1px solid #f0f0f0;
  transition: all 0.3s ease;
}

.info-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.info-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}

.info-icon {
  font-size: 1.5em;
}

.info-card h3 {
  color: var(--primary);
  font-size: 1.2em;
  margin: 0;
  font-weight: 600;
}

.info-card p {
  margin: 8px 0;
  line-height: 1.5;
  color: #666;
}

.info-card strong {
  color: var(--primary);
}

/* DESTAQUES */
.destaques-section {
  background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
  border: 2px solid #ffc107;
  border-radius: 15px;
  padding: 25px;
  margin-top: 20px;
}

.destaques-section h4 {
  color: #856404;
  font-size: 1.3em;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.destaques-section ul {
  list-style: none;
  padding: 0;
}

.destaques-section li {
  padding: 10px 0;
  border-bottom: 1px solid rgba(133, 100, 4, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.destaques-section li:last-child {
  border-bottom: none;
}

.destaques-section strong {
  color: #856404;
  font-weight: 600;
}

/* ================= RESPONSIVO ================= */

@media(max-width: 768px) {
  .modal-content {
    width: 98%;
    max-height: 95vh;
  }

  .modal-hero {
    height: 200px;
  }

  .modal-hero-content {
    padding: 20px;
  }

  .modal-title {
    font-size: 1.5em;
  }

  .modal-body {
    padding: 20px;
  }

  .modal-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .modal-description {
    font-size: 1em;
    padding: 15px;
  }
}
