/*
 * All CSS for admin and user interfaces should be placed in this file (style.css).
 * Do NOT include CSS directly in PHP files like functions.php.
 * This ensures maintainability and separation of concerns.
 */

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  overflow: auto;
  background: rgba(0,0,0,0.3);
  align-items: center;
  justify-content: center;
}
.modal.open {
  display: flex;
}
.modal-content {
  background: var(--bg-card);
  margin: auto;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
  min-width: 320px;
  max-width: 95vw;
  position: relative;
}
.close-modal {
  position: absolute;
  top: 10px;
  right: 18px;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
}
/* Container Principal da Nav */
.admin-nav {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.nav-wrapper {
  display: flex;
  justify-content: space-around;
  padding: 10px 0;
}

/* Itens Individuais */
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  flex: 1;
  max-width: 120px;
}

.nav-icon {
  font-size: 1.4rem;
  margin-bottom: 4px;
}

.nav-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Estado Ativo */
.nav-item.active {
  color: var(--primary);
  background: rgba(25, 184, 165, 0.1);
}

.nav-item.active::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 4px;
  background: var(--primary);
  border-radius: 10px 10px 0 0;
}

/* Badge de Pendentes */
.nav-badge {
  position: absolute;
  top: 4px;
  right: 12px;
  background: #ff4757;
  color: white;
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: bold;
  box-shadow: 0 2px 5px rgba(255, 71, 87, 0.3);
}

/* Hover Effect */
.nav-item:hover:not(.active) {
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
}
/* style.css - StarBox: PWA Ultra-Enhanced */

:root {
  /* Paleta de Cores - Profissional e de Alto Contraste */
  --primary: #2563eb;        /* Azul Moderno */
  --primary-hover: #1d4ed8;
  --accent: #f59e0b;         /* Laranja para Call-to-Actions */
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-rgb: 255, 255, 255; /* Necessário para o efeito Blur */
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  
  /* Variáveis de Design */
  --radius: 16px;
  --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --image-tile-size: 84px;
  --image-main-max: 360px;
}

/* Suporte ao Modo Escuro Automático */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --bg-card-rgb: 30, 41, 59;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border-color: #334155;
  }
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* Header com Efeito Blur (Glassmorphism) */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(var(--bg-card-rgb), 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  margin-bottom: 2rem;
}

/* Tipografia */
h1, h2, h3 {
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-main);
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.4rem; margin-bottom: 1.5rem; }

/* Formulários e Inputs */
label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
}

input, select, textarea {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius);
  border: 2px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 16px; /* Evita zoom automático no iOS */
  transition: var(--transition);
  margin-bottom: 1rem;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

/* Botões Modernos */
button {
  width: 100%;
  padding: 14px 24px;
  border-radius: var(--radius);
  border: none;
  background: var(--primary);
  color: white;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button:hover {
  background: var(--primary-hover);
  box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
  transform: translateY(-1px);
}

button:active {
  transform: scale(0.97);
}

.btn-secondary {
  background: var(--border-color);
  color: var(--text-main);
}

/* Grid de Produtos */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.product-card img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: calc(var(--radius) - 4px);
  margin-bottom: 1.25rem;
  filter: grayscale(15%);
  transition: var(--transition);
}

.product-card:hover img {
  filter: grayscale(0%);
}

/* Image standardization for gallery and product detail pages */
.gallery-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.gallery-item {
  position: relative;
  width: var(--image-tile-size);
  height: var(--image-tile-size);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-main-image {
  width: 100%;
  max-width: var(--image-main-max);
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 16px;
  border: 2px solid var(--primary);
  box-shadow: 0 2px 12px #0001;
  transition: var(--transition);
}

.carousel-thumb {
  width: var(--image-tile-size);
  height: var(--image-tile-size);
  object-fit: cover;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  cursor: pointer;
  transition: var(--transition);
  flex: 0 0 auto;
}

@media (max-width: 768px) {
  :root {
    --image-tile-size: 72px;
    --image-main-max: 320px;
  }
}

/* Badges e Status */
.badge {
  display: inline-flex;
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-secondary { background: #f1f5f9; color: #475569; }

/* Tabelas Responsivas */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
}

th, td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th {
  background: rgba(var(--bg-card-rgb), 0.5);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Ajustes Mobile */
@media (max-width: 640px) {
  .container { padding: 1rem; }
  h1 { font-size: 1.5rem; }
  .product-grid { grid-template-columns: 1fr; }
  
  .tab-bar button {
    padding: 10px 5px;
    font-size: 0.8rem;
  }
}