/* ============================================
   VILLAGGIO BLU - SISTEMA DE FORNECEDORES
   Cores e estilos customizados
   ============================================ */

:root {
  /* Cores principais do Villaggio Blu */
  --villaggio-blue: #0F5380;
  --villaggio-blue-dark: #0A3A5A;
  --villaggio-blue-light: #1565A0;
  --villaggio-white: #FFFFFF;
  
  /* Cores de suporte */
  --success-green: #22C55E;
  --warning-yellow: #FBBF24;
  --danger-red: #EF4444;
  --info-blue: #3B82F6;
  
  /* Cores de texto */
  --text-dark: #1F2937;
  --text-medium: #6B7280;
  --text-light: #9CA3AF;
  
  /* Backgrounds */
  --bg-gray-50: #F9FAFB;
  --bg-gray-100: #F3F4F6;
  --bg-white: #FFFFFF;
}

/* Sobrescrever cores azuis do Tailwind com cores do Villaggio */
.bg-blue-600 {
  background-color: var(--villaggio-blue) !important;
}

.hover\:bg-blue-700:hover {
  background-color: var(--villaggio-blue-dark) !important;
}

.text-blue-600 {
  color: var(--villaggio-blue) !important;
}

.border-blue-600 {
  border-color: var(--villaggio-blue) !important;
}

.focus\:ring-blue-500:focus {
  --tw-ring-color: var(--villaggio-blue-light) !important;
}

/* Navbar com cor Villaggio */
nav.bg-blue-600 {
  background-color: var(--villaggio-blue) !important;
}

/* Botões primários */
button[type="submit"],
.btn-primary {
  background-color: var(--villaggio-blue);
  transition: all 0.2s ease;
}

button[type="submit"]:hover,
.btn-primary:hover {
  background-color: var(--villaggio-blue-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(15, 83, 128, 0.25);
}

/* Cards hover effect */
.hover\:shadow-lg:hover {
  box-shadow: 0 10px 15px -3px rgba(15, 83, 128, 0.1),
              0 4px 6px -2px rgba(15, 83, 128, 0.05);
}

/* Tabs ativas */
.tab-button.border-b-2.border-blue-600 {
  border-color: var(--villaggio-blue) !important;
  color: var(--villaggio-blue) !important;
}

/* Auth tabs */
.auth-tab.border-blue-600 {
  border-color: var(--villaggio-blue) !important;
  color: var(--villaggio-blue) !important;
}

/* Links */
a.text-blue-600:hover {
  color: var(--villaggio-blue-dark) !important;
}

/* Badges e tags */
.bg-blue-500 {
  background-color: var(--villaggio-blue) !important;
}

/* Estatísticas coloridas */
.text-blue-600 {
  color: var(--villaggio-blue) !important;
}

.text-blue-200 {
  color: rgba(15, 83, 128, 0.3) !important;
}

/* Ícones grandes coloridos */
.fa-users.text-blue-200,
.fas.text-blue-200 {
  color: rgba(15, 83, 128, 0.2) !important;
}

/* Inputs focus */
input:focus,
select:focus,
textarea:focus {
  border-color: var(--villaggio-blue-light);
  box-shadow: 0 0 0 3px rgba(15, 83, 128, 0.1);
}

/* WhatsApp button mantém verde */
.text-green-600,
.hover\:text-green-700:hover {
  /* Mantém verde do WhatsApp */
}

/* Scrollbar customizado */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-gray-100);
}

::-webkit-scrollbar-thumb {
  background: var(--villaggio-blue);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--villaggio-blue-dark);
}

/* Logo - ajustes e correções */
nav img {
  filter: brightness(1.1);
}

/* Forçar altura correta do logo da navbar */
nav img.h-20 {
  height: 5rem !important; /* 80px */
}

/* Logo de login - usar largura fixa e altura automática para manter proporção */
#authSection img {
  width: 18rem; /* 288px - w-72 */
  height: auto;
  max-width: 100%;
}

/* Garantir que logos mantenham proporção */
nav img {
  width: auto;
  max-width: 100%;
}

/* Animações suaves */
* {
  transition-property: background-color, border-color, color, fill, stroke;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

/* Gráficos - cores customizadas para Chart.js */
.chart-villaggio-blue {
  background-color: rgba(15, 83, 128, 0.5);
  border-color: rgb(15, 83, 128);
}

/* Cards de fornecedores */
.fornecedor-card {
  transition: all 0.3s ease;
}

.fornecedor-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(15, 83, 128, 0.15);
}

/* Modal backdrop */
.modal-backdrop {
  background-color: rgba(15, 83, 128, 0.75);
}

/* Avaliações do usuário logado */
.bg-blue-50 {
  background-color: rgba(15, 83, 128, 0.05) !important;
}

.border-blue-300 {
  border-color: rgba(15, 83, 128, 0.3) !important;
}

/* Top fornecedores - número de ranking */
.text-2xl.font-bold.text-blue-600 {
  color: var(--villaggio-blue) !important;
}

/* Responsividade */
@media (max-width: 768px) {
  nav img {
    max-height: 40px;
  }
  
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* Melhorias de acessibilidade */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--villaggio-blue);
  outline-offset: 2px;
}

/* Loading states */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Toast notifications (se adicionar no futuro) */
.toast-success {
  background-color: var(--success-green);
  color: white;
}

.toast-error {
  background-color: var(--danger-red);
  color: white;
}

.toast-info {
  background-color: var(--villaggio-blue);
  color: white;
}

/* ============================================
   RESPONSIVIDADE MOBILE - MODAIS E CONTAINERS
   ============================================ */

/* Modais responsivos */
@media (max-width: 640px) {
  /* Modais ocupam toda a tela em mobile */
  .fixed.inset-0 > div {
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 0 !important;
    max-height: 100vh !important;
    height: 100% !important;
  }
  
  /* Modal de detalhes do fornecedor */
  #modalDetalhesFornecedor .bg-white {
    max-width: 100vw !important;
    width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    margin: 0 !important;
  }
  
  /* Modal de avaliação */
  #modalAvaliacao .bg-white {
    max-width: 100vw !important;
    width: 100vw !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    margin: 0 !important;
  }
  
  /* Modal de trocar senha */
  .max-w-md {
    max-width: 100vw !important;
  }
  
  /* Área de avaliações */
  #areaAvaliacoes > div {
    max-width: 100vw !important;
    width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    margin: 0 !important;
  }
  
  /* Ajustar padding interno dos modais */
  .fixed.inset-0 .p-6 {
    padding: 1rem !important;
  }
  
  .fixed.inset-0 .p-4 {
    padding: 0.75rem !important;
  }
  
  /* Grid de mídias menor em mobile */
  .grid-cols-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  
  /* Botões menores em mobile */
  .fixed.inset-0 button {
    font-size: 0.875rem !important;
    padding: 0.5rem 0.75rem !important;
  }
  
  /* Textos menores em modais mobile */
  .fixed.inset-0 .text-3xl {
    font-size: 1.5rem !important;
  }
  
  .fixed.inset-0 .text-2xl {
    font-size: 1.25rem !important;
  }
  
  .fixed.inset-0 .text-xl {
    font-size: 1.125rem !important;
  }
  
  /* Stats cards em coluna em mobile */
  .grid-cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* Tablets e telas médias */
@media (min-width: 641px) and (max-width: 1024px) {
  .fixed.inset-0 > div {
    max-width: 90vw !important;
  }
  
  #modalDetalhesFornecedor .bg-white {
    max-width: 90vw !important;
  }
}

/* Navbar responsiva melhorada */
@media (max-width: 640px) {
  nav .container {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }
  
  nav img {
    max-height: 3rem !important;
  }
  
  #userInfo {
    gap: 0.25rem !important;
  }
  
  #userInfo button {
    padding: 0.375rem 0.5rem !important;
    font-size: 0.75rem !important;
  }
  
  #userName {
    font-size: 0.75rem !important;
    max-width: 120px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
}

/* Container principal com padding adequado */
@media (max-width: 640px) {
  .container {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }
  
  /* Cards de fornecedores */
  .grid.grid-cols-1 > div {
    padding: 0.75rem !important;
  }
  
  /* Formulários */
  form input,
  form select,
  form textarea {
    font-size: 1rem !important;
  }
}

/* Corrigir overflow horizontal */
body {
  overflow-x: hidden !important;
  max-width: 100vw !important;
}

html {
  overflow-x: hidden !important;
  max-width: 100vw !important;
}

/* Evitar scroll horizontal em todos os elementos */
* {
  max-width: 100vw;
}

/* Print styles */
@media print {
  nav,
  .no-print {
    display: none !important;
  }
  
  body {
    background: white;
  }
}
