/* PWA-specific styles */

/* Online status indicator */
.online-status {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 5px;
    text-align: center;
    font-size: 0.8rem;
    font-weight: bold;
    z-index: 9999;
    transition: all 0.3s ease;
  }
  
  .online-status.online {
    background-color: #2ecc71;
    color: white;
    transform: translateY(-100%);
  }
  
  .online-status.offline {
    background-color: #e74c3c;
    color: white;
    transform: translateY(0);
  }
  
  /* Install banner */
  .install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #3498db;
    color: white;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
    z-index: 9000;
  }
  
  .install-banner p {
    margin: 0;
    flex: 1;
  }
  
  .install-banner .btn {
    margin-left: 10px;
  }
  
  .install-banner .primary-btn {
    background-color: white;
    color: #3498db;
  }
  
  .install-banner .close-btn {
    background: none;
    color: white;
    font-size: 1.5rem;
    padding: 0 10px;
  }
  
  /* Mobile optimizations */
  @media (max-width: 768px) {
    /* Hide scrollbars but allow scrolling */
    body {
      scrollbar-width: none; /* Firefox */
      -ms-overflow-style: none; /* IE and Edge */
    }
    
    body::-webkit-scrollbar {
      display: none; /* Chrome, Safari and Opera */
    }
    
    /* Make buttons larger for touch */
    .btn {
      padding: 12px 20px;
      min-height: 44px;
    }
    
    /* Improve form inputs on mobile */
    input, select {
      font-size: 16px; /* Prevents iOS zoom on focus */
      min-height: 44px;
    }
    
    /* Fix for position: fixed elements in iOS */
    .install-banner, .online-status {
      position: fixed;
      width: 100%;
      will-change: transform;
    }
    
    /* Disable pull-to-refresh */
    html, body {
      overscroll-behavior-y: contain;
    }
    
    /* Full height for app-like experience */
    .container {
      min-height: 100vh;
      padding-bottom: 60px; /* Space for install banner */
    }
  }
  
  /* Portrait orientation optimizations */
  @media screen and (orientation: portrait) {
    .navbar {
      padding: 10px 0;
    }
    
    .nav-links a {
      margin-left: 10px;
      font-size: 0.9rem;
    }
  }
  
  /* App-installed experience (standalone mode) */
  @media all and (display-mode: standalone) {
    /* Hide the install banner when in app mode */
    .install-banner {
      display: none !important;
    }
    
    /* Additional app-specific styles */
    body {
      padding-top: env(safe-area-inset-top);
      padding-bottom: env(safe-area-inset-bottom);
      padding-left: env(safe-area-inset-left);
      padding-right: env(safe-area-inset-right);
    }
    
    .navbar {
      padding-top: max(10px, env(safe-area-inset-top));
    }
    
    /* For devices with notches */
    .online-status {
      padding-top: max(5px, env(safe-area-inset-top));
    }
  }
  
  /* Splash screen styles */
  .splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #3498db;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
  }
  
  .splash-screen.hide {
    opacity: 0;
    pointer-events: none;
  }
  
  .splash-logo {
    width: 150px;
    height: 150px;
    margin-bottom: 20px;
    animation: pulse 2s infinite;
  }
  
  .splash-title {
    color: white;
    font-size: 2rem;
    margin-bottom: 20px;
  }
  
  .splash-spinner {
    width: 40px;
    height: 40px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
  }
  
  @keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
  }
  
  @keyframes spin {
    to { transform: rotate(360deg); }
  }