/* ==========================================================================
   DESIGN SYSTEM & CSS VARIABLES - FERRAMENTAS CERVEJEIRAS PUAIA (OFFLINE PWA)
   ========================================================================== */
:root {
  --bg-dark: #121214;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: #f1c40f;
  
  --primary: #f1c40f;
  --primary-glow: rgba(241, 196, 15, 0.25);
  --primary-hover: #d4ac0d;
  
  --text-main: #ffffff;
  --text-muted: #a1a1aa;
  --text-dim: #71717a;
  
  --success: #2ecc71;
  --info: #3498db;
  --danger: #e74c3c;
  
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Outfit', system-ui, -apple-system, sans-serif;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  padding-bottom: 90px; /* Espaço para o bottom nav no mobile */
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
}

/* Glassmorphism Container */
.glass {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.app-container {
  width: 100%;
  max-width: 600px;
  padding: 1rem;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 1.2rem 1rem;
  margin-bottom: 1rem;
}

.app-header img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  box-shadow: 0 0 15px var(--primary-glow);
}

.header-title h1 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}

.header-title p {
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* App Install & Offline Banner */
.pwa-banner {
  background: linear-gradient(135deg, rgba(241, 196, 15, 0.15), rgba(241, 196, 15, 0.05));
  border: 1px solid rgba(241, 196, 15, 0.3);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  animation: fadeIn 0.4s ease;
}

.pwa-banner-text {
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
}

.btn-install {
  background: var(--primary);
  color: #000;
  font-weight: 800;
  font-size: 0.75rem;
  padding: 8px 14px;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 12px var(--primary-glow);
  transition: transform 0.2s;
}

.btn-install:active {
  transform: scale(0.95);
}

.offline-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #2ecc71;
  background: rgba(46, 204, 113, 0.1);
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid rgba(46, 204, 113, 0.2);
  margin-top: 4px;
}

.offline-badge.offline {
  color: #f39c12;
  background: rgba(243, 156, 18, 0.1);
  border-color: rgba(243, 156, 18, 0.2);
}

/* Mobile Navigation Bar */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 600px;
  background: rgba(18, 18, 20, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 8px 0;
  z-index: 100;
}

.nav-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 6px 0;
  cursor: pointer;
  transition: all 0.2s;
}

.nav-tab .tab-icon {
  font-size: 1.25rem;
  margin-bottom: 2px;
  transition: transform 0.2s;
}

.nav-tab .tab-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
}

.nav-tab.active {
  color: var(--primary);
}

.nav-tab.active .tab-icon {
  transform: translateY(-2px) scale(1.1);
}

/* Sections & Tabs */
.tool-section {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tool-section.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Card Styles */
.card-box {
  padding: 1.4rem;
  margin-bottom: 1.2rem;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title span {
  color: var(--primary);
}

/* Form Controls */
.input-group {
  margin-bottom: 1rem;
}

.input-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-control {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 1.1rem;
  font-weight: 700;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 10px var(--primary-glow);
}

select.input-control {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23f1c40f' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.unit-tag {
  position: absolute;
  right: 14px;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--primary);
  pointer-events: none;
}

/* Results Display */
.result-box {
  background: linear-gradient(135deg, rgba(241, 196, 15, 0.12), rgba(0, 0, 0, 0.3));
  border: 1px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  text-align: center;
  margin-top: 1.2rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.result-val {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.1;
  margin: 4px 0;
}

.result-lbl {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Custom Grid for Water & Event Distribution Cards */
.water-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 1rem;
}

.water-card {
  padding: 1rem;
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
}

.water-card.azul { border-left-color: #3498db; }
.water-card.verde { border-left-color: #2ecc71; }
.water-card.amarelo { border-left-color: #f1c40f; }

.water-card h4 {
  font-size: 1rem;
  color: #fff;
  margin-bottom: 8px;
  font-weight: 800;
}

.water-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  padding: 3px 0;
  color: var(--text-muted);
  border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
}

.water-item strong {
  color: #fff;
}

/* Event Styles Grid Checkboxes */
.styles-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.style-chip {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  user-select: none;
}

.style-chip input {
  accent-color: var(--primary);
}

/* Converters Color Preview */
.color-preview-bar {
  height: 48px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  transition: background-color 0.3s;
}

/* Footer Link */
.app-footer {
  text-align: center;
  padding: 1.5rem 0;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.app-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
}
