/* Modal LGPD */
.modal-lgpd-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(2, 11, 26, 0.9);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100000;
  padding: 20px;
  overflow-y: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* Scrollbar customizada para o overlay */
.modal-lgpd-overlay::-webkit-scrollbar {
  width: 8px;
}

.modal-lgpd-overlay::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.modal-lgpd-overlay::-webkit-scrollbar-thumb {
  background: rgba(26, 107, 255, 0.5);
  border-radius: 10px;
  transition: background 0.3s ease;
}

.modal-lgpd-overlay::-webkit-scrollbar-thumb:hover {
  background: rgba(26, 107, 255, 0.7);
}

/* Para Firefox */
.modal-lgpd-overlay {
  scrollbar-width: thin;
  scrollbar-color: rgba(26, 107, 255, 0.5) rgba(255, 255, 255, 0.05);
}

.modal-lgpd-overlay.show {
  display: flex;
  animation: fadeIn 0.3s ease;
}

/* Garantir que o modal fique centralizado ao rolar */
.modal-lgpd-overlay {
  align-items: flex-start;
  padding-top: 5vh;
  padding-bottom: 5vh;
}

@media (max-height: 600px) {
  .modal-lgpd-overlay {
    align-items: center;
    padding-top: 20px;
    padding-bottom: 20px;
  }
}

/* =========================================================
   SISTEMA DE COOKIES E LGPD
========================================================= */

/* Banner de Cookies */
#cookie-consent {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--glass);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  padding: 25px;
  z-index: 10000;
  display: none;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.4s ease;
}

#cookie-consent.show,
#cookie-consent[style*="block"] {
  display: block !important;
}

.cookie-content {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 20px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.cookie-icon {
  width: 100px;
  height: 100px;
  flex-shrink: 0;
  border-radius: 12px;
  overflow: hidden;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cookie-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cookie-text {
  margin-top: 15px;
  flex: 1;
}

.cookie-text h4 {
  font-family: "Montserrat", sans-serif;
  font-size: 1.3rem;
  color: var(--branco);
  margin-bottom: 10px;
}

.cookie-text p {
  color: var(--texto);
  line-height: 1.6;
  font-size: 0.95rem;
  margin: 0;
}

.cookie-text a {
  color: var(--azul2);
  text-decoration: underline;
  transition: color 0.3s ease;
}

.cookie-text a:hover {
  color: var(--azul1);
}

.cookie-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  flex-wrap: wrap;
}

.politicas-links {
  display: flex;
  gap: 15px;
}

.politicas-links a {
  color: var(--azul2);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

.politicas-links a:hover {
  color: var(--azul1);
}

#cookie-buttons {
  display: flex;
  gap: 15px;
}

.reject-btn,
.accept-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: "Inter", sans-serif;
}

.reject-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border);
  color: var(--texto);
}

.reject-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.accept-btn {
  background: linear-gradient(141deg, var(--azul1), #ff5722);
  color: var(--branco);
  box-shadow: 0 4px 15px rgba(26, 107, 255, 0.3);
}

.accept-btn:hover {
  background: linear-gradient(141deg, #2563eb, #ff6a3d);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26, 107, 255, 0.4);
}

/* Botão flutuante para reabrir cookies */
.cookie-toggle-btn {
  position: fixed;
  bottom: 30px;
  width: 60px;
  height: 60px;
  background: var(--glass);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9999;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  padding: 12px;
}

.cookie-toggle-left {
  left: 30px;
  right: auto;
}

.cookie-toggle-btn:hover {
  background: rgba(26, 107, 255, 0.2);
  border-color: var(--azul1);
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(26, 107, 255, 0.3);
}

.cookie-toggle-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cookie-toggle-btn.closed {
  opacity: 0.7;
}

.cookie-toggle-btn.open {
  opacity: 1;
}

/* Aviso temporário */
.cookie-aviso-temporario {
  position: fixed;
  background: var(--azul2);
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  z-index: 99999;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: opacity 0.3s ease;
  pointer-events: none;
}

@media (max-width: 768px) {
  .cookie-aviso-temporario {
    bottom: 80px;
    left: 20px;
  }
}

@media (min-width: 769px) {
  .cookie-aviso-temporario {
    bottom: 100px;
    left: 100px;
  }
}

.modal-lgpd-box {
  background: var(--glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  margin: auto;
  /* Melhorar a rolagem */
  overscroll-behavior: contain;
}

/* Scrollbar customizada para o box do modal */
.modal-lgpd-box::-webkit-scrollbar {
  width: 6px;
}

.modal-lgpd-box::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 10px;
}

.modal-lgpd-box::-webkit-scrollbar-thumb {
  background: rgba(26, 107, 255, 0.4);
  border-radius: 10px;
  transition: background 0.3s ease;
}

.modal-lgpd-box::-webkit-scrollbar-thumb:hover {
  background: rgba(26, 107, 255, 0.6);
}

/* Para Firefox */
.modal-lgpd-box {
  scrollbar-width: thin;
  scrollbar-color: rgba(26, 107, 255, 0.4) transparent;
}

.modal-lgpd-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.modal-lgpd-logo {
  margin: auto;
  width: 290px;
  height: 150px;
  border-radius: 12px;
  overflow: hidden;
  /* background: rgba(26, 107, 255, 0.1); */
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-lgpd-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.modal-lgpd-close {
  background: transparent;
  border: none;
  color: var(--texto);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-lgpd-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--branco);
}

.modal-lgpd-title {
  font-family: "Montserrat", sans-serif;
  font-size: 1.8rem;
  color: var(--branco);
  margin-bottom: 20px;
  text-align: center;
}

.modal-lgpd-text {
  color: var(--texto);
  line-height: 1.8;
  margin-bottom: 30px;
  text-align: center;
  font-size: 1rem;
}

.modal-lgpd-label {
  color: var(--branco);
  font-weight: 600;
  margin-bottom: 15px;
  display: block;
}

.modal-lgpd-options {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 25px;
}

.modal-lgpd-options label {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--texto);
  cursor: pointer;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: all 0.3s ease;
}

.modal-lgpd-options label:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--azul1);
}

.modal-lgpd-options input[type="radio"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--azul1);
}

.modal-lgpd-options span {
  font-size: 1rem;
}

.modal-lgpd-input {
  width: 100%;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--branco);
  font-size: 1rem;
  font-family: "Inter", sans-serif;
  margin-bottom: 5px;
  transition: all 0.3s ease;
}

.modal-lgpd-input:focus {
  outline: none;
  border-color: var(--azul1);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 3px rgba(26, 107, 255, 0.1);
}

.modal-lgpd-error {
  color: var(--laranja);
  font-size: 0.85rem;
  display: none;
  margin-bottom: 15px;
  padding: 8px 12px;
  background: rgba(255, 106, 42, 0.1);
  border-left: 3px solid var(--laranja);
  border-radius: 6px;
}

.modal-lgpd-message {
  margin-bottom: 20px;
  padding: 12px;
  border-radius: 8px;
  text-align: center;
  font-size: 0.95rem;
}

.modal-lgpd-buttons {
  display: flex;
  gap: 15px;
  margin-top: 30px;
}

.modal-lgpd-cancel,
.modal-lgpd-submit {
  flex: 1;
  padding: 14px 24px;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: "Inter", sans-serif;
}

.modal-lgpd-cancel {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border);
  color: var(--texto);
}

.modal-lgpd-cancel:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.modal-lgpd-submit {
  background: linear-gradient(141deg, var(--azul1), #ff5722);
  color: var(--branco);
  box-shadow: 0 4px 15px rgba(26, 107, 255, 0.3);
}

.modal-lgpd-submit:hover {
  background: linear-gradient(141deg, #2563eb, #ff6a3d);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26, 107, 255, 0.4);
}

.modal-lgpd-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Mensagem de sucesso/erro */
.mensagem-lgpd {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  padding: 20px 30px;
  border-radius: 12px;
  font-size: 1rem;
  z-index: 999999;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  animation: slideDown 0.3s ease;
  max-width: 90%;
  text-align: center;
}

/* Animações */
@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Responsividade para cookies */
@media (max-width: 768px) {
  #cookie-consent {
    padding: 20px;
  }

  .cookie-content {
    flex-direction: column;
    gap: 15px;
  }

  .cookie-icon {
    width: 40px;
    height: 40px;
  }

  .cookie-actions {
    flex-direction: column;
    align-items: stretch;
  }

  #cookie-buttons {
    width: 100%;
  }

  .reject-btn,
  .accept-btn {
    flex: 1;
  }

  .cookie-toggle-btn {
    width: 50px;
    height: 50px;
    bottom: 20px;
    left: 20px;
  }

  .modal-lgpd-box {
    padding: 30px 20px;
  }

  .modal-lgpd-title {
    font-size: 1.5rem;
  }

  .modal-lgpd-buttons {
    flex-direction: column;
  }
}

/* Modal Gerenciar Cookies */
.modal-gerenciar-cookies {
  max-width: 700px;
  max-height: 85vh;
}

.cookie-categorias {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 30px 0;
}

.cookie-categoria {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  transition: all 0.3s ease;
}

.cookie-categoria:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--azul1);
}

.cookie-categoria-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.cookie-categoria-header h3 {
  font-family: "Montserrat", sans-serif;
  font-size: 1.2rem;
  color: var(--branco);
  margin-bottom: 8px;
}

.cookie-categoria-header p {
  color: var(--texto);
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0;
}

/* Toggle Switch */
.cookie-toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
  flex-shrink: 0;
  cursor: pointer;
}

.cookie-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.cookie-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.2);
  transition: 0.3s;
  border-radius: 26px;
}

.cookie-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.cookie-toggle-switch input:checked + .cookie-slider {
  background: linear-gradient(141deg, var(--azul1), #ff5722);
}

.cookie-toggle-switch input:checked + .cookie-slider:before {
  transform: translateX(24px);
}

.cookie-toggle-switch input:disabled + .cookie-slider {
  background-color: rgba(26, 107, 255, 0.3);
  cursor: not-allowed;
  opacity: 0.6;
}

.cookie-toggle-switch input:disabled + .cookie-slider:before {
  background-color: rgba(255, 255, 255, 0.8);
}
