/* ============================================================
   UniCesumar Parking — style.css
   Tema: Dark tech dashboard
   Fontes: Syne (títulos) + DM Sans (corpo)
   ============================================================ */

/* ===== VARIÁVEIS GLOBAIS ===== */
:root {
  --bg:          #0a0e1a;
  --surface:     #111827;
  --surface2:    #1a2235;
  --border:      rgba(255, 255, 255, 0.07);
  --accent:      #3b82f6;
  --accent2:     #06b6d4;
  --success:     #10b981;
  --warning:     #f59e0b;
  --danger:      #ef4444;
  --text:        #f1f5f9;
  --muted:       #64748b;
  --card-radius: 16px;
}

/* ===== RESET E BASE ===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Grade de fundo estilo tech */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(59, 130, 246, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* Brilho azul no canto superior esquerdo */
body::after {
  content: '';
  position: fixed;
  top: -200px;
  left: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ===== CONTAINER PRINCIPAL ===== */
.app {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ===== CABEÇALHO ===== */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.logo h1 {
  font-family: 'Syne', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.logo h1 span { color: var(--accent2); }

.logo small {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 0.5px;
  margin-top: 1px;
}

#clock {
  font-family: 'Syne', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--muted);
}

#clock span { color: var(--text); }

/* ===== BADGE DE STATUS (Aberto / Fechado) ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.badge.open   { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge.closed { background: rgba(239, 68, 68, 0.15);  color: #f87171; }

/* Ponto colorido animado antes do texto */
.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ===== GRID DE CARDS DE MÉTRICAS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  padding: 1.25rem 1.5rem;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s;
}

.stat-card:hover { border-color: rgba(59, 130, 246, 0.3); }

/* Detalhe decorativo no canto superior direito de cada card */
.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 60px;
  height: 60px;
  border-radius: 0 16px 0 60px;
  opacity: 0.06;
}

.stat-card.blue::after  { background: var(--accent);   }
.stat-card.cyan::after  { background: var(--accent2);  }
.stat-card.green::after { background: var(--success);  }
.stat-card.amber::after { background: var(--warning);  }

.stat-label {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-family: 'Syne', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.stat-card.blue  .stat-value { color: #60a5fa; }
.stat-card.cyan  .stat-value { color: #22d3ee; }
.stat-card.green .stat-value { color: #34d399; }
.stat-card.amber .stat-value { color: #fbbf24; }

.stat-sub {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

/* ===== GRID PRINCIPAL (2 colunas) ===== */
.main-grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 1.5rem;
  align-items: start;
}

/* ===== PAINÉIS (cards com borda) ===== */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  overflow: hidden;
}

.panel-header {
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.2px;
}

.panel-header .icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.icon-blue  { background: rgba(59, 130, 246, 0.15); }
.icon-green { background: rgba(16, 185, 129, 0.15); }
.icon-amber { background: rgba(245, 158, 11, 0.15); }

/* ===== FORMULÁRIOS ===== */
.form-body { padding: 1.25rem 1.5rem; }

/* Grupo de abas (Entrada / Saída) */
.tab-group {
  display: flex;
  gap: 6px;
  background: var(--surface2);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 1.25rem;
}

.tab-btn {
  flex: 1;
  padding: 7px 10px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.tab-content        { display: none; }
.tab-content.active { display: block; }

/* Labels dos campos */
label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 6px;
  margin-top: 1rem;
}

label:first-of-type { margin-top: 0; }

/* Inputs e selects */
input, select {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

input:focus, select:focus { border-color: rgba(59, 130, 246, 0.5); }
input::placeholder        { color: var(--muted); }
select option             { background: var(--surface2); }

/* ===== BOTÕES ===== */
.btn {
  width: 100%;
  margin-top: 1.25rem;
  padding: 11px 20px;
  border: none;
  border-radius: 10px;
  font-family: 'Syne', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: all 0.2s;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #2563eb);
  color: #fff;
}
.btn-primary:hover { opacity: 0.9; }

.btn-success {
  background: linear-gradient(135deg, var(--success), #059669);
  color: #fff;
}
.btn-success:hover { opacity: 0.9; }

.btn-danger {
  background: linear-gradient(135deg, var(--danger), #dc2626);
  color: #fff;
  margin-top: 0.6rem;
}
.btn-danger:hover { opacity: 0.9; }

/* ===== TOAST (notificação flutuante) ===== */
#toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 500;
  display: none;
  z-index: 100;
  max-width: 300px;
  border: 1px solid;
  backdrop-filter: blur(10px);
}

#toast.success { background: rgba(16, 185, 129, 0.15); border-color: rgba(16, 185, 129, 0.3); color: #34d399; }
#toast.error   { background: rgba(239, 68, 68, 0.15);  border-color: rgba(239, 68, 68, 0.3);  color: #f87171; }
#toast.info    { background: rgba(59, 130, 246, 0.15);  border-color: rgba(59, 130, 246, 0.3);  color: #60a5fa; }

/* ===== LISTA DE VEÍCULOS NO PÁTIO ===== */
.vehicle-list { padding: 0.5rem; }

.vehicle-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-bottom: 6px;
  background: var(--surface2);
  transition: border-color 0.2s;
  cursor: pointer;
}

.vehicle-item:hover { border-color: rgba(239, 68, 68, 0.35); }

.vehicle-icon {
  font-size: 20px;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.vehicle-info    { flex: 1; min-width: 0; }

.vehicle-plate {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 1px;
}

.vehicle-meta {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 1px;
}

.vehicle-time {
  font-size: 0.78rem;
  color: var(--accent2);
  font-weight: 500;
}

/* ===== HISTÓRICO DE SAÍDAS ===== */
.history-list {
  max-height: 320px;
  overflow-y: auto;
  padding: 0.5rem;
}

/* Barra de scroll personalizada */
.history-list::-webkit-scrollbar       { width: 4px; }
.history-list::-webkit-scrollbar-track { background: transparent; }
.history-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 4px;
  font-size: 0.8rem;
}

.history-item:nth-child(odd) { background: rgba(255, 255, 255, 0.025); }

.history-plate { font-family: 'Syne', sans-serif; font-weight: 600; letter-spacing: 0.5px; }
.history-meta  { color: var(--muted); font-size: 0.72rem; }

.history-price {
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
}

.price-paid { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.price-free { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }

/* ===== ESTADO VAZIO ===== */
.empty-state {
  text-align: center;
  padding: 2rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.empty-state .empty-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

/* ===== DISTRIBUIÇÃO POR TIPO ===== */
.type-bars { padding: 1rem 1.5rem; }

.type-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.type-name { font-size: 0.78rem; color: var(--muted); width: 90px; }

.type-bar-bg {
  flex: 1;
  height: 6px;
  background: var(--surface2);
  border-radius: 99px;
  overflow: hidden;
}

.type-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.5s ease;
}

.type-count { font-size: 0.78rem; font-weight: 600; width: 20px; text-align: right; }

/* ===== PAINEL DE ADMINISTRAÇÃO ===== */
.actions-panel { padding: 1.5rem; }

.danger-zone {
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-top: 1rem;
}

.danger-title {
  font-size: 0.72rem;
  color: var(--danger);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.danger-desc { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.75rem; }

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 768px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .main-grid  { grid-template-columns: 1fr; }
}
