/* Variáveis CSS */
:root {
  --primary-hue: 216;
  --primary-color: #0d6efd;
  --primary-dark: #0143a3;
  --primary-light: #e7f1ff;
  --surface-color: #ffffff;
  --text-color: #2c3e50;
  --header-footer-bg: #0143a3;
  
  /* Espaçamentos */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  
  /* Border radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;
}

/* Reset e estilos base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%; /* Prevent font scaling in landscape */
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  line-height: 1.5;
  color: var(--text-color);
  overflow-x: hidden; /* Prevent horizontal scroll */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ⚠️  LEGACY NAVBAR - NOW HANDLED BY modern-design.css ⚠️ */
/*
.navbar {
  background-color: var(--header-footer-bg);
  padding: var(--spacing-sm) 0;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar-brand {
  color: white;
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: 500;
  padding: var(--spacing-xs) var(--spacing-sm);
}
*/

.nav-link {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  padding: var(--spacing-xs) var(--spacing-sm);
  transition: color 0.2s ease;
  display: inline-block;
  min-height: 44px; /* Minimum touch target size */
  line-height: 44px;
}

.nav-link:hover {
  color: white;
}

/* Footer */
footer {
  text-align: center;
  padding: var(--spacing-md);
  background-color: var(--header-footer-bg);
  color: white;
  margin-top: auto;
}

/* Botões */
.btn {
  display: inline-block;
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  min-height: 44px; /* Minimum touch target size */
  line-height: 1.2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  transform: translateY(-1px);
}

/* Formulários */
.form-group {
  margin-bottom: var(--spacing-md);
}

/* Melhorias nos inputs e selects */
.form-control {
  background-color: white;
  color: var(--text-color);
  border: 1px solid #dee2e6;
  transition: all 0.3s ease;
  min-height: 44px; /* Minimum touch target size */
  padding: var(--spacing-sm);
  font-size: 16px; /* Prevent zoom on iOS */
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-light);
  outline: none;
}

/* Estilos específicos para selects */
select.form-control {
  appearance: auto;
  padding-right: 2rem;
  cursor: pointer;
  background-color: white;
  color: var(--text-color);
}

select.form-control option {
  padding: 0.5rem;
  background-color: white;
  color: var(--text-color);
}

/* Estilos para labels */
.form-group label {
  color: var(--text-color);
  margin-bottom: 0.5rem;
  font-weight: 500;
  display: block;
}

/* Placeholder */
.form-control::placeholder {
  color: #6c757d;
  opacity: 0.8;
}

/* Disabled state */
.form-control:disabled,
.form-control[readonly] {
  background-color: #e9ecef;
  opacity: 1;
}

/* Utilitários */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
  width: 100%;
}

/* Responsividade */
@media (max-width: 768px) {
  :root {
    --spacing-lg: 1.5rem;
    --spacing-md: 1rem;
    --spacing-sm: 0.75rem;
  }
  
  html {
    font-size: 14px;
  }
  
  .navbar-brand {
    font-size: 1.25rem;
  }
  
  .btn {
    font-size: 1rem;
    padding: var(--spacing-sm) var(--spacing-md);
    width: 100%; /* Full width buttons on mobile */
    margin-bottom: var(--spacing-sm);
  }
  
  .container {
    padding: 0 var(--spacing-sm);
  }
  
  /* Improve touch targets */
  .form-control,
  .btn,
  .nav-link {
    min-height: 44px;
    line-height: 44px;
  }
  
  /* Prevent text zoom on form inputs */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="tel"],
  textarea {
    font-size: 16px !important;
  }
}

/* Melhorias nos selects */
select.form-control {
  background-color: white;
  color: var(--text-color);
  text-transform: capitalize;
  cursor: pointer;
  appearance: auto;
  min-height: 44px;
  line-height: 44px;
}

select.form-control option {
  background: white;
  color: var(--text-color);
  padding: var(--spacing-sm);
  text-transform: capitalize;
}

select.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-light);
  outline: none;
}

/* Formulários */
.form-group {
  margin-bottom: var(--spacing-md);
}

select.form-control,
.form-control {
  width: 100%;
  padding: var(--spacing-sm);
  border: 1px solid #dee2e6;
  border-radius: var(--radius-md);
  font-size: 1rem;
}

/* Correção específica para selects do Bootstrap */
select.form-control,
select.form-select {
  background-color: #ffffff !important;
  color: #212529 !important;
  border: 1px solid #ced4da !important;
  font-size: 1rem !important;
  line-height: 1.5 !important;
  padding: 0.5rem !important;
  min-height: 44px !important;
}

select.form-control option,
select.form-select option {
  background-color: #ffffff !important;
  color: #212529 !important;
  padding: 12px !important;
  font-size: 1rem !important;
}

/* Hover state */
select.form-control:hover,
select.form-select:hover {
  border-color: var(--primary-color) !important;
}

/* Focus state */
select.form-control:focus,
select.form-select:focus {
  border-color: var(--primary-color) !important;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25) !important;
}

/* Quill Editor Styles */
.ql-container {
  min-height: 150px;
  height: auto;
  font-size: 1rem;
  line-height: 1.5;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}

.ql-toolbar {
  border: 1px solid #ccc;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: #f8f9fa;
}

.ql-editor {
  min-height: 150px;
  padding: 1rem;
}

.ql-editor.ql-empty:before {
  color: #999;
  content: attr(data-placeholder);
  float: left;
  pointer-events: none;
  height: 0;
}

.ql-snow .ql-toolbar button {
  color: var(--text-color);
  min-height: 44px; /* Minimum touch target size */
}

.ql-snow .ql-toolbar button:hover {
  color: var(--primary-color);
}

.ql-snow .ql-toolbar button.ql-active {
  color: var(--primary-color);
}

.ql-snow .ql-toolbar button.ql-active .ql-stroke {
  stroke: var(--primary-color);
}

.ql-snow .ql-toolbar button.ql-active .ql-fill {
  fill: var(--primary-color);
}

/* Mobile-specific improvements */
@media (max-width: 480px) {
  :root {
    --spacing-lg: 1.25rem;
    --spacing-md: 0.875rem;
    --spacing-sm: 0.625rem;
  }
  
  html {
    font-size: 13px;
  }
  
  .container {
    padding: 0 var(--spacing-xs);
  }
  
  /* Improve readability on small screens */
  p, li, span, div {
    line-height: 1.6;
  }
  
  /* Optimize spacing for mobile */
  .form-group {
    margin-bottom: var(--spacing-sm);
  }
  
  /* Ensure proper spacing in lists */
  ul, ol {
    padding-left: var(--spacing-md);
  }
  
  /* Improve button spacing */
  .btn + .btn {
    margin-left: 0;
    margin-top: var(--spacing-sm);
  }
}