/**
 * PWA Offline Styles
 * ==================
 * 
 * Styles for offline functionality:
 * - Offline indicators
 * - Update prompts
 * - Native app feel
 */

/* Splash Screen - Removed */

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

/* Offline Indicator */
#offline-indicator {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #ffc107;
  color: #000;
  padding: 12px;
  text-align: center;
  z-index: 10000;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  animation: slideDown 0.3s ease;
}

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

/* PWA Installed Styles */
body.pwa-installed {
  /* Add any styles for installed PWA */
}

body.pwa-installed .navbar {
  /* Adjust navbar for standalone mode */
  padding-top: env(safe-area-inset-top);
}

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

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* PWA Notification */
.pwa-notification {
  animation: slideIn 0.3s ease;
}

.pwa-notification-success {
  background: #28a745 !important;
}

.pwa-notification-warning {
  background: #ffc107 !important;
  color: #000 !important;
}

.pwa-notification-info {
  background: #17a2b8 !important;
}

/* Fullscreen Support */
@media (display-mode: standalone) {
  body {
    /* Adjust for standalone mode */
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
  }
  
  /* Hide browser UI elements */
  .navbar {
    padding-top: env(safe-area-inset-top);
  }
  
  /* Adjust for notches */
  .container {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
}

/* Safe Area Insets for iOS */
@supports (padding: max(0px)) {
  body {
    padding-left: max(0px, env(safe-area-inset-left));
    padding-right: max(0px, env(safe-area-inset-right));
  }
  
  .navbar {
    padding-top: max(0px, env(safe-area-inset-top));
  }
  
  .footer {
    padding-bottom: max(0px, env(safe-area-inset-bottom));
  }
}

/* Loading States */
.pwa-loading {
  position: relative;
  overflow: hidden;
}

.pwa-loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  animation: loading 1.5s infinite;
}

@keyframes loading {
  to {
    left: 100%;
  }
}

/* Offline Content Placeholder */
.offline-placeholder {
  text-align: center;
  padding: 3rem 1rem;
  color: #6b7280;
}

.offline-placeholder-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.offline-placeholder-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #374151;
}

.offline-placeholder-text {
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

/* Smooth Transitions */
* {
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* Prevent Text Selection on Mobile (Native Feel) */
@media (max-width: 768px) {
  body.pwa-installed {
    -webkit-tap-highlight-color: transparent;
  }
  
  body.pwa-installed button,
  body.pwa-installed a {
    -webkit-tap-highlight-color: rgba(102, 126, 234, 0.2);
  }
}
