/**
 * PWA Install Prompt Styles
 * 
 * Estilos para o banner e modal de instalação do PWA
 * 
 * @package PremierLineGym
 * @version 1.0.4
 */

/* ============================================
   Banner Principal (Fixo no Topo)
   ============================================ */

.plg-pwa-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999999;
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transform: translateY(-100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-bottom: 2px solid #e4b649;
}

.plg-pwa-banner--visible {
  transform: translateY(0);
}

.plg-pwa-banner__content {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  max-width: 100%;
}

.plg-pwa-banner__icon {
  flex-shrink: 0;
}

.plg-pwa-banner__icon img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.plg-pwa-banner__text {
  flex: 1;
  min-width: 0;
}

.plg-pwa-banner__title {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 2px 0;
  line-height: 1.2;
}

.plg-pwa-banner__message {
  font-size: 12px;
  color: #cccccc;
  margin: 0;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plg-pwa-banner__actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.plg-pwa-banner__btn {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
  margin: 0;
  outline: none;
  transition: all 0.2s ease;
}

.plg-pwa-banner__btn--primary {
  background: linear-gradient(135deg, #e4b649 0%, #d4a439 100%);
  color: #1a1a1a;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(228, 182, 73, 0.3);
  white-space: nowrap;
}

.plg-pwa-banner__btn--primary:hover {
  background: linear-gradient(135deg, #f0c659 0%, #e0b449 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(228, 182, 73, 0.4);
}

.plg-pwa-banner__btn--primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(228, 182, 73, 0.3);
}

.plg-pwa-banner__btn--close {
  color: #999999;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.plg-pwa-banner__btn--close:hover {
  color: #ffffff;
}

.plg-pwa-banner__btn--close svg {
  width: 20px;
  height: 20px;
}

/* Responsivo - Banner */
@media (max-width: 380px) {
  .plg-pwa-banner__content {
    gap: 8px;
    padding: 10px 12px;
  }

  .plg-pwa-banner__icon img {
    width: 40px;
    height: 40px;
  }

  .plg-pwa-banner__title {
    font-size: 13px;
  }

  .plg-pwa-banner__message {
    font-size: 11px;
  }

  .plg-pwa-banner__btn--primary {
    font-size: 12px;
    padding: 6px 12px;
  }
}

/* ============================================
   Modal de Instruções
   ============================================ */

.plg-pwa-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000000;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(4px);
}

.plg-pwa-modal-overlay--visible {
  opacity: 1;
}

.plg-pwa-modal {
  background: #1a1a1a;
  border-radius: 16px;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  border: 1px solid #333333;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.plg-pwa-modal-overlay--visible .plg-pwa-modal {
  transform: scale(1);
}

/* Header do Modal */
.plg-pwa-modal__header {
  position: relative;
  padding: 24px 24px 16px;
  border-bottom: 1px solid #333333;
}

.plg-pwa-modal__header h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  padding-right: 40px;
}

.plg-pwa-modal__close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: #999999;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.plg-pwa-modal__close:hover {
  color: #ffffff;
}

/* Body do Modal */
.plg-pwa-modal__body {
  padding: 24px;
}

.plg-pwa-modal__body > p {
  margin: 0 0 20px 0;
  color: #cccccc;
  font-size: 15px;
  line-height: 1.5;
}

/* Lista de Instruções */
.plg-pwa-instructions {
  list-style: none;
  padding: 0;
  margin: 0 0 24px 0;
}

.plg-pwa-instructions li {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  align-items: flex-start;
}

.plg-pwa-instructions li:last-child {
  margin-bottom: 0;
}

.plg-pwa-instruction__step {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e4b649 0%, #d4a439 100%);
  color: #1a1a1a;
  font-weight: 700;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(228, 182, 73, 0.3);
}

.plg-pwa-instruction__text {
  flex: 1;
  color: #e0e0e0;
  font-size: 15px;
  line-height: 1.6;
  padding-top: 4px;
}

.plg-pwa-instruction__text strong {
  color: #ffffff;
  font-weight: 600;
}

/* Benefícios */
.plg-pwa-benefits {
  background: rgba(228, 182, 73, 0.1);
  border: 1px solid rgba(228, 182, 73, 0.2);
  border-radius: 12px;
  padding: 16px 20px;
  margin-top: 24px;
}

.plg-pwa-benefits h3 {
  margin: 0 0 12px 0;
  font-size: 16px;
  font-weight: 700;
  color: #e4b649;
}

.plg-pwa-benefits ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.plg-pwa-benefits li {
  color: #e0e0e0;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 8px;
  padding-left: 0;
}

.plg-pwa-benefits li:last-child {
  margin-bottom: 0;
}

/* Footer do Modal */
.plg-pwa-modal__footer {
  padding: 16px 24px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.plg-pwa-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: #999999;
  font-size: 13px;
  user-select: none;
  margin: 0;
}

.plg-pwa-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  margin: 0;
}

.plg-pwa-checkbox:hover {
  color: #cccccc;
}

.plg-pwa-btn {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
}

.plg-pwa-btn--primary {
  background: linear-gradient(135deg, #e4b649 0%, #d4a439 100%);
  color: #1a1a1a;
  font-size: 15px;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: 24px;
  box-shadow: 0 4px 12px rgba(228, 182, 73, 0.3);
}

.plg-pwa-btn--primary:hover {
  background: linear-gradient(135deg, #f0c659 0%, #e0b449 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(228, 182, 73, 0.4);
}

.plg-pwa-btn--primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(228, 182, 73, 0.3);
}

/* Scrollbar do Modal */
.plg-pwa-modal::-webkit-scrollbar {
  width: 8px;
}

.plg-pwa-modal::-webkit-scrollbar-track {
  background: #1a1a1a;
}

.plg-pwa-modal::-webkit-scrollbar-thumb {
  background: #444444;
  border-radius: 4px;
}

.plg-pwa-modal::-webkit-scrollbar-thumb:hover {
  background: #555555;
}

/* Responsivo - Modal */
@media (max-width: 480px) {
  .plg-pwa-modal-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .plg-pwa-modal {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 16px 16px 0 0;
  }

  .plg-pwa-modal__header {
    padding: 20px 20px 16px;
  }

  .plg-pwa-modal__header h2 {
    font-size: 20px;
  }

  .plg-pwa-modal__body {
    padding: 20px;
  }

  .plg-pwa-modal__footer {
    padding: 16px 20px 20px;
    flex-direction: column;
    align-items: stretch;
  }

  .plg-pwa-btn--primary {
    width: 100%;
  }

  .plg-pwa-checkbox {
    justify-content: center;
  }
}

/* ============================================
   Ajuste para espaçamento do conteúdo
   ============================================ */

/* Quando o banner está visível, adiciona padding ao body */
body.plg-pwa-banner-active {
  padding-top: 76px;
}

@media (max-width: 380px) {
  body.plg-pwa-banner-active {
    padding-top: 68px;
  }
}

/* ============================================
   Animações
   ============================================ */

@keyframes plg-pwa-slideDown {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(0);
  }
}

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

@keyframes plg-pwa-scaleIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* ============================================
   Modo Standalone (PWA já instalado)
   ============================================ */

@media (display-mode: standalone) {
  .plg-pwa-banner,
  .plg-pwa-modal-overlay {
    display: none !important;
  }
}

/* ============================================
   Modal de Instalação - Loading Spinner
   ============================================ */

.plg-pwa-spinner {
  width: 60px;
  height: 60px;
  margin: 0 auto;
  border: 4px solid rgba(228, 182, 73, 0.2);
  border-top-color: #e4b649;
  border-radius: 50%;
  animation: plg-pwa-spin 0.8s linear infinite;
}

@keyframes plg-pwa-spin {
  to {
    transform: rotate(360deg);
  }
}

.plg-pwa-modal--installing .plg-pwa-modal__body h2 {
  color: #e4b649;
  font-size: 20px;
  font-weight: 700;
}

/* ============================================
   Modal de Sucesso - Success Icon
   ============================================ */

.plg-pwa-success-icon {
  margin: 0 auto 20px;
  width: 80px;
  height: 80px;
  animation: plg-pwa-scaleIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.plg-pwa-modal--success .plg-pwa-modal__body h2 {
  font-size: 20px;
  font-weight: 700;
}

.plg-pwa-modal--success .plg-pwa-modal__body p {
  font-size: 14px;
}

/* Animação de pulse para o ícone de sucesso */
@keyframes plg-pwa-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.plg-pwa-success-icon svg {
  animation: plg-pwa-pulse 0.6s ease-in-out;
}
