/**
 * Super Guia Rio Preto — Modernização UI/UX Pro Max
 * Overlay de estilos premium sobre o app.css existente.
 * Mantém toda a funcionalidade, apenas eleva o visual.
 *
 * Melhorias: tipografia, espaçamento, cards, botões, inputs,
 * hover states, transições, elevação, consistência visual.
 */

/* ─── Design Tokens Modernos ───────────────────────────────────────────────── */
:root {
  /* Elevation system */
  --elevation-1: 0 1px 3px rgba(12, 24, 48, 0.06), 0 1px 2px rgba(12, 24, 48, 0.04);
  --elevation-2: 0 4px 8px rgba(12, 24, 48, 0.08), 0 2px 4px rgba(12, 24, 48, 0.04);
  --elevation-3: 0 12px 24px rgba(12, 24, 48, 0.1), 0 4px 8px rgba(12, 24, 48, 0.04);
  --elevation-4: 0 20px 40px rgba(12, 24, 48, 0.12), 0 8px 16px rgba(12, 24, 48, 0.04);

  /* Spacing rhythm (4px base) */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.5rem;
  --space-2xl: 4rem;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Refined colors */
  --brand-glow: rgba(0, 120, 240, 0.15);
  --accent-glow: rgba(255, 122, 0, 0.12);
  --card-hover-border: rgba(0, 120, 240, 0.2);
}

/* ─── Typography Refinements ───────────────────────────────────────────────── */
body {
  font-size: 15px;
  letter-spacing: -0.01em;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--display);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.35rem, 3vw, 1.75rem); }
h3 { font-size: clamp(1.05rem, 2vw, 1.25rem); }

p { line-height: 1.65; }

/* ─── Buttons — Premium Polish ─────────────────────────────────────────────── */
.btn {
  font-size: 0.9rem;
  letter-spacing: -0.01em;
  border-radius: 12px;
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-base),
    background var(--transition-fast),
    border-color var(--transition-fast);
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
  transition-duration: 80ms;
}

.btn-primary {
  box-shadow: 0 4px 12px rgba(0, 120, 240, 0.25), 0 1px 3px rgba(0, 120, 240, 0.15);
  background: linear-gradient(135deg, #0084ff 0%, #0056b3 100%);
}

.btn-primary:hover {
  box-shadow: 0 8px 20px rgba(0, 120, 240, 0.35), 0 2px 6px rgba(0, 120, 240, 0.2);
  background: linear-gradient(135deg, #0078f0 0%, #004da0 100%);
}

.btn-accent {
  box-shadow: 0 4px 12px rgba(255, 122, 0, 0.25);
  border-radius: 12px;
}

.btn-accent:hover {
  box-shadow: 0 8px 20px rgba(255, 122, 0, 0.35);
}

.btn-ghost {
  border-color: var(--line);
  box-shadow: var(--elevation-1);
}

.btn-ghost:hover {
  border-color: var(--brand);
  background: var(--brand-glow);
  color: var(--brand);
  box-shadow: var(--elevation-2);
}

.btn-wa {
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.2);
  background: linear-gradient(135deg, #34d058 0%, #22863a 100%);
}

.btn-wa:hover {
  box-shadow: 0 8px 20px rgba(40, 167, 69, 0.3);
}

.btn-sm {
  border-radius: 10px;
  font-size: 0.82rem;
}

.btn-cadastre {
  border-radius: 12px !important;
}

/* ─── Cards — Elevation & Hover ────────────────────────────────────────────── */
.card {
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--elevation-1);
  transition:
    transform var(--transition-base),
    box-shadow var(--transition-base),
    border-color var(--transition-base);
  overflow: hidden;
}

.card:hover,
a.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--elevation-3);
  border-color: var(--card-hover-border);
}

.card-media {
  overflow: hidden;
}

.card-media img {
  transition: transform var(--transition-slow);
}

.card:hover .card-media img {
  transform: scale(1.04);
}

.card-body {
  padding: 1.1rem 1.2rem 1.25rem;
}

.card h3 {
  font-weight: 700;
  line-height: 1.3;
}

/* Home company cards */
.home-company-card,
.home-offer-card {
  border-radius: 18px;
  box-shadow: var(--elevation-1);
  border: 1px solid rgba(213, 224, 240, 0.7);
  transition:
    transform var(--transition-base),
    box-shadow var(--transition-base),
    border-color var(--transition-base);
}

.home-company-card:hover,
.home-offer-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--elevation-4);
  border-color: var(--card-hover-border);
}

.home-company-card .home-card-image,
.home-offer-card .home-card-image {
  overflow: hidden;
}

.home-company-card:hover .home-card-image img,
.home-offer-card:hover .home-card-image img {
  transform: scale(1.05);
}

.home-card-image img {
  transition: transform var(--transition-slow);
}

/* ─── Form Inputs — Modern Style ───────────────────────────────────────────── */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="number"],
input[type="password"],
input[type="search"],
input[type="date"],
input[type="datetime-local"],
select,
textarea {
  min-height: 46px;
  padding: 0.7rem 1rem;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-size: 0.92rem;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background var(--transition-fast);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
  background: #fafcff;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

/* ─── Search Box — Premium ─────────────────────────────────────────────────── */
.search-box {
  border-radius: 16px !important;
  box-shadow: var(--elevation-3) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.2) !important;
  backdrop-filter: blur(4px);
}

.search-box input {
  border: none !important;
  box-shadow: none !important;
}

.search-box button {
  border-radius: 12px !important;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* ─── Header — Glass Effect ────────────────────────────────────────────────── */
.site-header {
  backdrop-filter: blur(20px) saturate(1.2);
  border-bottom-width: 2px;
}

/* ─── Categories Grid — Refined ────────────────────────────────────────────── */
.home-category {
  border-radius: 16px;
  border: 1.5px solid var(--line);
  transition:
    transform var(--transition-base),
    box-shadow var(--transition-base),
    border-color var(--transition-base),
    background var(--transition-base);
}

.home-category:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--elevation-3);
  border-color: var(--brand);
  background: linear-gradient(135deg, #fff 0%, #f0f7ff 100%);
}

.home-category-icon {
  transition: transform var(--transition-bounce);
}

.home-category:hover .home-category-icon {
  transform: scale(1.15);
}

/* ─── Footer — Polish ──────────────────────────────────────────────────────── */
.site-footer {
  background: linear-gradient(180deg, #f8fafc 0%, #edf2f7 100%);
  border-top: 1px solid var(--line);
}

/* ─── Badges — Refined ─────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.75rem;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.badge-ok {
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
}

.badge-warn {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
}

.badge-err {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

/* ─── Stats Section — Premium ──────────────────────────────────────────────── */
.home-stats {
  background: linear-gradient(135deg, #fafcff 0%, #f0f7ff 50%, #f8fffe 100%);
  border-top: 1px solid rgba(0, 120, 240, 0.08);
  border-bottom: 1px solid rgba(0, 120, 240, 0.08);
}

.home-stat {
  transition: transform var(--transition-base);
}

.home-stat:hover {
  transform: translateY(-2px);
}

/* ─── Flash Messages — Polished ────────────────────────────────────────────── */
.flash {
  border-radius: 12px;
  padding: 0.85rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--elevation-2);
  animation: flash-in 300ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes flash-in {
  from { opacity: 0; transform: translateY(-8px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.flash-ok {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border: 1px solid #86efac;
  color: #166534;
}

.flash-erro {
  background: linear-gradient(135deg, #fef2f2, #fee2e2);
  border: 1px solid #fca5a5;
  color: #991b1b;
}

/* ─── Panel Shell (Admin/Empresa) — Refined ────────────────────────────────── */
.panel-shell {
  gap: 2rem;
}

.panel-shell .side a {
  border-radius: 10px;
  padding: 0.6rem 0.85rem;
  margin-bottom: 0.2rem;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.panel-shell .side a:hover {
  background: var(--brand-glow);
  color: var(--brand);
}

.panel-shell .side a.active {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 120, 240, 0.25);
}

/* ─── Tables — Modern ──────────────────────────────────────────────────────── */
.table {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--elevation-1);
}

.table th {
  background: #f8fafc;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.table td {
  font-size: 0.88rem;
}

.table tr:hover td {
  background: rgba(0, 120, 240, 0.02);
}

/* ─── Plans Cards — Premium Feel ───────────────────────────────────────────── */
.plan-card {
  border-radius: 20px;
  border: 1.5px solid var(--line);
  box-shadow: var(--elevation-2);
  transition:
    transform var(--transition-base),
    box-shadow var(--transition-base),
    border-color var(--transition-base);
}

.plan-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--elevation-4);
  border-color: var(--brand);
}

.plan-card.is-featured {
  border-color: var(--brand);
  box-shadow: var(--elevation-3), 0 0 0 1px var(--brand);
}

/* ─── CTA Section — Premium ────────────────────────────────────────────────── */
.home-cta {
  border-radius: 24px;
  background: linear-gradient(135deg, #071b36 0%, #0a2951 50%, #0d3568 100%);
  box-shadow: var(--elevation-4);
  padding: 2rem 2.5rem;
}

/* ─── Mobile Bottom Tab Bar — Polished ─────────────────────────────────────── */
.mobile-tabbar {
  backdrop-filter: blur(16px) saturate(1.3);
  border-top: 1px solid rgba(213, 224, 240, 0.5);
  box-shadow: 0 -4px 20px rgba(12, 24, 48, 0.08);
}

.mobile-tabbar a {
  transition: color var(--transition-fast), transform var(--transition-fast);
}

.mobile-tabbar a:active {
  transform: scale(0.92);
}

/* ─── Map Card ─────────────────────────────────────────────────────────────── */
.home-map-card {
  border-radius: 20px;
  box-shadow: var(--elevation-2);
  border: 1px solid var(--line);
}

/* ─── Empty States ─────────────────────────────────────────────────────────── */
.empty {
  border-radius: 16px;
  border: 2px dashed var(--line);
  background: linear-gradient(135deg, #fafcff, #f8fafc);
  padding: 2.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ─── Stars Rating ─────────────────────────────────────────────────────────── */
.stars {
  letter-spacing: 1px;
  font-size: 0.95rem;
}

/* ─── Scroll Reveal Animation ──────────────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .home-company-card,
  .home-offer-card,
  .home-category,
  .home-news-card {
    animation: reveal-up 400ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
  }

  .home-company-grid > *:nth-child(1) { animation-delay: 0ms; }
  .home-company-grid > *:nth-child(2) { animation-delay: 60ms; }
  .home-company-grid > *:nth-child(3) { animation-delay: 120ms; }

  .home-offer-grid > *:nth-child(1) { animation-delay: 0ms; }
  .home-offer-grid > *:nth-child(2) { animation-delay: 60ms; }
  .home-offer-grid > *:nth-child(3) { animation-delay: 120ms; }
  .home-offer-grid > *:nth-child(4) { animation-delay: 180ms; }

  @keyframes reveal-up {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }
}

/* ─── Focus Visible (Accessibility) ────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

button:focus-visible,
.btn:focus-visible {
  outline-offset: 3px;
}

/* ─── Selection ────────────────────────────────────────────────────────────── */
::selection {
  background: var(--brand-glow);
  color: var(--ink);
}

/* ─── Scrollbar (webkit) ───────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(86, 103, 129, 0.3); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(86, 103, 129, 0.5); }

/* ─── Map Ad Slots (5 posições premium) ────────────────────────────────────── */
.map-premium-slots {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.map-ad-slot {
  border: 1.5px dashed rgba(255, 122, 0, 0.4) !important;
  background: linear-gradient(135deg, #fffbf5 0%, #fff8f0 100%) !important;
  position: relative;
}

.map-ad-slot:hover {
  border-color: var(--accent) !important;
  background: linear-gradient(135deg, #fff5eb 0%, #fff0e0 100%) !important;
  box-shadow: 0 4px 16px rgba(255, 122, 0, 0.12);
}

.map-ad-slot-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(255, 122, 0, 0.1);
  font-size: 1.4rem;
}

.map-ad-slot-title {
  color: var(--accent-2) !important;
  font-size: 1rem;
}

.badge-ad {
  background: linear-gradient(135deg, #ff9a2e, #e85d00) !important;
  color: #fff !important;
  font-weight: 800;
  padding: 0.35rem 0.7rem;
  border-radius: 8px;
  font-size: 0.78rem;
  white-space: nowrap;
}

.map-ad-slot-info {
  font-size: 0.8rem;
  color: var(--accent-2);
  margin-top: 0.2rem;
}

.map-ad-slot .btn-accent {
  font-size: 0.82rem;
  min-height: 38px;
  padding: 0.5rem 1rem;
}

/* Card de empresa premium ativa (pagou) */
.map-premium-card {
  border: 1.5px solid rgba(255, 122, 0, 0.5) !important;
  background: linear-gradient(135deg, #fffdf9 0%, #fff9f0 100%) !important;
  position: relative;
  box-shadow: 0 4px 16px rgba(255, 122, 0, 0.08);
}

.map-premium-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #ff9a2e, #e85d00);
  border-radius: 4px 0 0 4px;
}

.map-premium-card:hover {
  border-color: var(--accent) !important;
  box-shadow: 0 8px 24px rgba(255, 122, 0, 0.15);
  transform: translateY(-2px);
}

.badge-premium {
  background: linear-gradient(135deg, #ff9a2e, #e85d00) !important;
  color: #fff !important;
  font-weight: 800;
  padding: 0.3rem 0.65rem;
  border-radius: 8px;
  font-size: 0.72rem;
  white-space: nowrap;
}

/* ─── Banner Promo: Posições Premium no Mapa ───────────────────────────────── */
.mapa-promo-banner {
  margin: 1.5rem 0;
  padding: 1.8rem 2rem;
  border-radius: 20px;
  background: linear-gradient(135deg, #071b36 0%, #0a2951 40%, #0d3a6d 100%);
  color: #fff;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 2rem;
  align-items: center;
  box-shadow: 0 12px 32px rgba(7, 27, 54, 0.2);
  overflow: hidden;
  position: relative;
}

.mapa-promo-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255, 122, 0, 0.2), transparent 70%);
  pointer-events: none;
}

.mapa-promo-content {
  display: flex;
  gap: 2rem;
  align-items: center;
  position: relative;
  z-index: 1;
}

.mapa-promo-badge {
  display: inline-block;
  padding: 0.35rem 0.8rem;
  background: rgba(255, 122, 0, 0.2);
  border: 1px solid rgba(255, 122, 0, 0.4);
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #ffb366;
  margin-bottom: 0.5rem;
}

.mapa-promo-text h3 {
  font-family: var(--display);
  font-size: 1.5rem;
  margin: 0 0 0.4rem;
  letter-spacing: -0.03em;
  color: #fff;
}

.mapa-promo-text p {
  margin: 0 0 0.8rem;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.9rem;
  line-height: 1.5;
}

.mapa-promo-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.85);
}

.mapa-promo-features li {
  white-space: nowrap;
}

.mapa-promo-price {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}

.mapa-promo-valor small {
  display: block;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 0.2rem;
}

.mapa-promo-valor strong {
  display: block;
  font-family: var(--display);
  font-size: 2.4rem;
  letter-spacing: -0.03em;
  color: #fff;
}

.mapa-promo-valor strong span {
  font-size: 1.2rem;
}

.mapa-promo-note {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.5);
}

.mapa-promo-preview {
  position: relative;
  z-index: 1;
}

.mapa-promo-mockup {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.mockup-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.8rem;
  border-radius: 10px;
  font-size: 0.82rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.mockup-item.is-premium {
  background: rgba(255, 122, 0, 0.12);
  border-color: rgba(255, 122, 0, 0.3);
}

.mockup-item.is-free {
  opacity: 0.4;
}

.mockup-rank {
  font-weight: 800;
  font-size: 0.75rem;
  color: #ffb366;
  min-width: 20px;
}

.mockup-item.is-free .mockup-rank {
  color: rgba(255, 255, 255, 0.5);
}

.mockup-label {
  flex: 1;
  color: rgba(255, 255, 255, 0.9);
}

.mockup-badge-star {
  font-size: 0.7rem;
}

/* Banner menor na lista de empresas */
.empresas-promo-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
  border-radius: 14px;
  background: linear-gradient(135deg, #071b36 0%, #0a2951 100%);
  color: #fff;
  box-shadow: 0 8px 20px rgba(7, 27, 54, 0.15);
}

.empresas-promo-left {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  font-size: 0.88rem;
}

.empresas-promo-left strong {
  font-family: var(--display);
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.empresas-promo-left b {
  color: #ffb366;
}

/* Responsivo */
@media (max-width: 900px) {
  .mapa-promo-banner {
    grid-template-columns: 1fr;
    padding: 1.5rem;
  }
  .mapa-promo-content {
    flex-direction: column;
    text-align: center;
  }
  .mapa-promo-features {
    justify-content: center;
  }
  .mapa-promo-preview {
    display: none;
  }
}

@media (max-width: 600px) {
  .empresas-promo-banner {
    flex-direction: column;
    text-align: center;
    padding: 1.2rem;
  }
  .empresas-promo-left {
    flex-direction: column;
    gap: 0.4rem;
  }
}
