/* PWA Install UI Styles */

.pwa-install-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #06BEDE, #4AABDF);
  color: #ffffff;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 25px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(6, 190, 222, 0.25);
}

.pwa-install-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(6, 190, 222, 0.35);
  background: linear-gradient(135deg, #4AABDF, #06BEDE);
}

.pwa-install-btn i {
  font-size: 1.1rem;
}

/* PWA Install Banner */
.pwa-install-banner {
  position: fixed;
  bottom: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, rgba(20, 20, 20, 0.95), rgba(40, 40, 40, 0.9));
  border: 2px solid rgba(6, 190, 222, 0.35);
  border-radius: 16px;
  padding: 1rem;
  backdrop-filter: blur(15px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  z-index: 9999;
  max-width: 400px;
  width: calc(100% - 2rem);
  transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  opacity: 0;
}

.pwa-install-banner.show {
  bottom: 30px;
  opacity: 1;
}

.install-banner-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.install-banner-icon {
  flex-shrink: 0;
}

.install-banner-icon i {
  font-size: 2rem;
  color: #06BEDE;
}

.install-banner-text {
  flex: 1;
}

.install-banner-text h4 {
  color: #06BEDE;
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 0.3rem 0;
  line-height: 1.2;
}

.install-banner-text p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.3;
}

.install-banner-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-shrink: 0;
}

.install-btn-primary {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: linear-gradient(135deg, #06BEDE, #4AABDF);
  color: #ffffff;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.install-btn-primary:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(6, 190, 222, 0.35);
}

.install-btn-close {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.4rem;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.install-btn-close:hover {
  background: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.9);
}

/* PWA Update Notification */
.pwa-update-notification {
  position: fixed;
  top: -100px;
  right: 30px;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.95), rgba(16, 185, 129, 0.9));
  border: 2px solid rgba(34, 197, 94, 0.4);
  border-radius: 16px;
  padding: 1rem;
  backdrop-filter: blur(15px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  z-index: 9999;
  min-width: 300px;
  transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  opacity: 0;
}

.pwa-update-notification.show {
  top: 30px;
  opacity: 1;
}

.update-content {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: white;
}

.update-content i {
  font-size: 1.5rem;
  animation: rotate 2s linear infinite;
}

.update-content span {
  flex: 1;
  font-weight: 600;
}

.update-content button {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.update-content button:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

@keyframes rotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* PWA Installed State */
.pwa-installed .pwa-install-banner,
.pwa-installed .pwa-install-btn {
  display: none !important;
}

/* ============ FLOATING CTA STYLES ============ */

@media (min-width: 769px) {
    .pwa-floating-cta {
        display: none !important;
    }
}

.pwa-floating-cta {
    position: fixed;
    bottom: 100px;
    right: 16px;
    z-index: 990;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: none;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.pwa-floating-cta.minimized {
    bottom: 130px;
}

.pwa-floating-cta.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

button.pwa-cta-expanded {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, rgba(10, 14, 26, 0.95), rgba(8, 12, 24, 0.95));
    border: 2px solid rgba(6, 190, 222, 0.40);
    border-radius: 50px;
    padding: 10px 16px 10px 14px;
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 20px rgba(6, 190, 222, 0.18);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    text-align: left;
}

.pwa-floating-cta:not(.minimized) .pwa-cta-expanded:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(6, 190, 222, 0.25);
    border-color: rgba(6, 190, 222, 0.60);
}

.pwa-floating-cta:not(.minimized) .pwa-cta-expanded:active {
    transform: scale(0.98);
}

.pwa-cta-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #06BEDE, #4AABDF);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pwa-cta-icon i {
    font-size: 1.3rem;
    color: #ffffff;
}

.pwa-cta-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pwa-cta-title {
    color: #06BEDE;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.1;
}

.pwa-cta-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
    line-height: 1.1;
}

.pwa-cta-close {
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 4px;
}

.pwa-cta-close i {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
}

.pwa-cta-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.pwa-cta-close:hover i {
    color: white;
}

/* Minimized state */
button.pwa-cta-minimized {
    display: none;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #06BEDE, #4AABDF);
    border: none;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(6, 190, 222, 0.35);
    transition: all 0.3s ease;
}

.pwa-cta-minimized i {
    font-size: 1.4rem;
    color: #ffffff;
}

.pwa-cta-minimized:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(6, 190, 222, 0.40);
}

.pwa-floating-cta.minimized .pwa-cta-expanded {
    display: none;
}

.pwa-floating-cta.minimized .pwa-cta-minimized {
    display: flex;
}

/* Simple Install Guide Modal */
.simple-install-guide {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.simple-install-guide.show {
    opacity: 1;
}

.simple-guide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.simple-guide-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, rgba(10, 14, 26, 0.98), rgba(8, 12, 24, 0.98));
    border-top: 2px solid rgba(6, 190, 222, 0.40);
    border-radius: 24px 24px 0 0;
    padding: 24px;
    max-height: 80vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.simple-install-guide.show .simple-guide-content {
    transform: translateY(0);
}

.simple-guide-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
}

.simple-guide-header {
    text-align: center;
    margin-bottom: 24px;
}

.simple-guide-icon {
    width: auto;
    height: 48px;
    max-width: 65%;
    border-radius: 0;
    margin: 0 auto 12px;
    display: block;
    object-fit: contain;
}

.simple-guide-header h3 {
    color: #06BEDE;
    font-size: 1.4rem;
    margin: 0;
}

.simple-guide-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.simple-guide-step {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(255, 255, 255, 0.05);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.simple-guide-step .step-num {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #06BEDE, #4AABDF);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #ffffff;
    flex-shrink: 0;
}

.simple-guide-step p {
    color: white;
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.4;
}

.simple-guide-step i {
    color: #06BEDE;
}

.simple-guide-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #06BEDE, #4AABDF);
    border: none;
    border-radius: 25px;
    color: #ffffff;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.simple-guide-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(6, 190, 222, 0.35);
}

/* Hide floating CTA when PWA is installed */
.pwa-installed .pwa-floating-cta {
    display: none !important;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .pwa-floating-cta,
    .pwa-cta-expanded,
    .pwa-cta-minimized,
    .simple-install-guide,
    .simple-guide-content {
        transition: none;
    }
}

/* Mobile Responsiveness */
@media screen and (max-width: 768px) {
  .pwa-install-banner {
    bottom: -120px;
    padding: 0.8rem;
    max-width: calc(100% - 1rem);
  }
  
  .pwa-install-banner.show {
    bottom: 20px;
  }
  
  .install-banner-content {
    flex-direction: column;
    text-align: center;
    gap: 0.8rem;
  }
  
  .install-banner-actions {
    flex-direction: row;
    justify-content: center;
  }
  
  .install-banner-text h4 {
    font-size: 1rem;
  }
  
  .install-banner-text p {
    font-size: 0.85rem;
  }
  
  .pwa-update-notification {
    right: 15px;
    left: 15px;
    min-width: auto;
  }
  
  .update-content {
    flex-direction: column;
    text-align: center;
    gap: 0.8rem;
  }
  
  .pwa-install-item {
    margin-left: auto;
  }
  
  .pwa-install-btn {
    font-size: 0.8rem;
    padding: 0.5rem 0.8rem;
  }
  
  /* Hide floating CTA on mobile - use header button instead */
  .pwa-floating-cta {
    display: none !important;
  }
}

/*========== PWA HEADER INSTALL BUTTON (Mobile Only) ==========*/
.pwa-header-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #06BEDE, #4AABDF);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(6, 190, 222, 0.25);
  transition: all 0.3s ease;
  margin-left: auto;
  margin-right: 0.25rem;
}

.pwa-header-btn i {
  font-size: 1.2rem;
  color: #ffffff;
}

.pwa-header-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(6, 190, 222, 0.40);
}

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

/* Show header button only on mobile when not installed */
@media screen and (max-width: 768px) {
  .pwa-header-btn {
    display: flex;
  }
  
  /* Hide when PWA is installed */
  .pwa-installed .pwa-header-btn {
    display: none !important;
  }
}