/* PWA Specific Styles */

/* CSS Variables for window controls overlay */
:root {
  --wco-height: 0px;
  --app-title-bar-height: 60px;
}

/* Styles for when window controls overlay is enabled */
body.wco-enabled {
  /* Adjust the top padding to account for the window controls overlay */
  padding-top: var(--wco-height);
}

/* Custom title bar for installed PWA */
.pwa-title-bar {
  display: none;
  height: var(--app-title-bar-height);
  background: #0e0074;
  color: white;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0 16px;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Only show title bar in standalone mode */
@media (display-mode: standalone), (display-mode: window-controls-overlay) {
  .pwa-title-bar {
    display: flex;
  }
  
  /* Adjust content to make room for title bar */
  body {
    padding-top: var(--app-title-bar-height);
  }
  
  /* Hide browser UI elements that might be redundant in PWA mode */
  .browser-only {
    display: none !important;
  }
}

/* Special styles for window-controls-overlay mode */
@media (display-mode: window-controls-overlay) {
  .pwa-title-bar {
    padding-left: env(titlebar-area-x, 0);
    padding-right: calc(100vw - env(titlebar-area-width, 100%) - env(titlebar-area-x, 0));
  }
  
  /* Ensure content doesn't go under the window controls */
  .login-page {
    padding-top: env(titlebar-area-height, 33px);
  }
}

/* PWA installation prompt styles */
#pwa-install-container {
  animation: slide-up 0.3s ease-out;
}

@keyframes slide-up {
  from {
    transform: translate(-50%, 100%);
    opacity: 0;
  }
  to {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}

/* PWA offline indicator */
.offline-indicator {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: rgba(255, 59, 48, 0.9);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  z-index: 9999;
  display: none;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.offline-indicator.visible {
  display: flex;
  animation: fade-in 0.3s ease-out;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Custom scrollbar for PWA */
@media (display-mode: standalone), (display-mode: window-controls-overlay) {
  ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }
  
  ::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
  }
  
  ::-webkit-scrollbar-thumb {
    background: rgba(14, 0, 116, 0.3);
    border-radius: 4px;
  }
  
  ::-webkit-scrollbar-thumb:hover {
    background: rgba(14, 0, 116, 0.5);
  }
}
