/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

.pb-safe {
  padding-bottom: env(safe-area-inset-bottom);
}

.pt-safe {
  padding-top: env(safe-area-inset-top);
}

/* Hide details marker for messenger dropdowns */
details > summary {
  list-style: none;
}

details > summary::-webkit-details-marker {
  display: none;
}

/* PWA Offline indicator */
body.offline::before {
  content: "Offline - Internet connection required for changes";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: #ef4444;
  color: white;
  text-align: center;
  padding: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 9999;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Offline form state */
.offline-disabled {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}

.offline-disabled::after {
  content: "Internet connection required";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(239, 68, 68, 0.95);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 500;
  font-size: 0.875rem;
  white-space: nowrap;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 100;
}

/* Offline toast notification */
.offline-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #ef4444;
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 500;
  font-size: 0.875rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 10000;
  transition: transform 0.3s ease;
}

.offline-toast.show {
  transform: translateX(-50%) translateY(0);
}

/* Show elements only when offline */
body.offline .offline\:block {
  display: block !important;
}

body:not(.offline) .offline\:block {
  display: none !important;
}

/* Hide elements when offline */
body.offline .online\:block {
  display: none !important;
}

body:not(.offline) .online\:block {
  display: block !important;
}

@media (prefers-color-scheme: dark) {
  .offline-disabled::after,
  .offline-toast {
    background: rgba(239, 68, 68, 0.95);
  }
}

/* PWA installed state - hide install instructions when running as standalone app */
@media (display-mode: standalone) {
  .pwa__instructions {
    display: none;
  }
}

/* PWA installer button - only show when install is available */
.pwa__installer {
  display: none;
}

.pwa--can-install .pwa__installer {
  display: block;
}
