/**
 * FL-RegMaster Admin Cabinet - PWA Styles
 */

/* Install Banner */
.pwa-install-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 15px 20px;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  display: none;
  animation: slideUp 0.3s ease-out;
}

.pwa-install-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  flex-wrap: wrap;
  gap: 10px;
}

.pwa-install-content i {
  font-size: 24px;
  margin-right: 10px;
}

.pwa-install-content span {
  flex: 1;
  font-weight: 500;
}

.pwa-install-actions {
  display: flex;
  gap: 10px;
}

.pwa-install-actions .btn {
  white-space: nowrap;
}

/* Offline Indicator */
.pwa-offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #f39c12;
  color: white;
  padding: 10px 20px;
  text-align: center;
  z-index: 9998;
  display: none;
  animation: slideDown 0.3s ease-out;
}

.pwa-offline-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.pwa-offline-content i {
  font-size: 18px;
}

/* Update Notification */
.pwa-update-notification {
  margin: 10px;
  animation: fadeIn 0.3s ease-out;
}

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

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

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

/* Responsive adjustments */
@media (max-width: 768px) {
  .pwa-install-content {
    flex-direction: column;
    text-align: center;
  }

  .pwa-install-content span {
    margin-bottom: 10px;
  }

  .pwa-install-actions {
    width: 100%;
    justify-content: center;
  }

  .pwa-install-actions .btn {
    flex: 1;
  }
}

/* Standalone mode adjustments */
@media (display-mode: standalone) {
  body {
    /* Add any standalone-specific styles */
  }
}

/* iOS Standalone mode - Safe Area handling */
/* Add padding-top to wrapper to account for iOS status bar and notch */
/* This ensures content doesn't overlap with the status bar area */
body.ios-standalone .wrapper {
  /* Fallback: 20px for iPhone X and newer (with notch), 0 for older devices */
  padding-top: 20px;
  /* iOS 11.0-11.2: constant() syntax */
  padding-top: constant(safe-area-inset-top);
  /* iOS 11.2+: env() syntax (preferred) */
  padding-top: env(safe-area-inset-top);
}

/* For fixed header navbar, adjust top position */
body.ios-standalone .main-header.navbar-fixed-top {
  top: 20px; /* Fallback */
  top: constant(safe-area-inset-top);
  top: env(safe-area-inset-top);
}

/* Support for @supports query (more modern approach) */
@supports (padding: env(safe-area-inset-top)) {
  body.ios-standalone .wrapper {
    padding-top: env(safe-area-inset-top);
  }
  
  body.ios-standalone .main-header.navbar-fixed-top {
    top: env(safe-area-inset-top);
  }
}

