/* ========================================================
   PWA App Splash Screen (Dark Gray Background & White Logo)
   ======================================================== */
.app-splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: #1e293b; /* Dark gray */
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.45s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.45s ease;
    padding: 24px;
    box-sizing: border-box;
    overflow: hidden;
}

.app-splash-screen.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.splash-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 320px;
    width: 100%;
}

.splash-logo-container {
    margin-bottom: 18px;
    animation: splashLogoIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.splash-logo-img {
    max-width: 220px;
    width: 65vw;
    height: auto;
    max-height: 140px;
    object-fit: contain;
    filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.4));
}

@keyframes splashLogoIn {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(12px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.splash-text-container {
    animation: splashTextIn 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes splashTextIn {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.splash-app-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #f8fafc;
    margin: 0 0 6px 0;
    letter-spacing: 0.4px;
}

.splash-app-desc {
    font-size: 0.85rem;
    color: #94a3b8;
    margin: 0;
    line-height: 1.4;
}

.splash-loader {
    margin-top: 26px;
    display: flex;
    justify-content: center;
}

.splash-spinner {
    width: 26px;
    height: 26px;
    border: 2.5px solid rgba(255, 255, 255, 0.15);
    border-top-color: #38bdf8;
    border-radius: 50%;
    animation: spinSplash 0.75s linear infinite;
}

@keyframes spinSplash {
    to {
        transform: rotate(360deg);
    }
}

/* ========================================================
   Orientation Shield for Mobile Landscape
   ======================================================== */
#orientation-shield {
    display: none;
}

@media screen and (orientation: landscape) and (max-height: 580px) and (max-width: 991px) {
    body:not(.bypass-orientation-shield) #orientation-shield {
        display: flex !important;
        position: fixed;
        inset: 0;
        z-index: 999999;
        align-items: center;
        justify-content: center;
        background: radial-gradient(circle at center, rgba(30, 41, 59, 0.96) 0%, rgba(15, 23, 42, 0.98) 100%);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        padding: 16px;
        box-sizing: border-box;
        animation: orientationFadeIn 0.3s ease-out forwards;
    }
}

@keyframes orientationFadeIn {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.orientation-shield-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
    border-radius: 18px;
    padding: 18px 24px;
    max-width: 440px;
    width: 100%;
    text-align: center;
    color: #ffffff;
    box-sizing: border-box;
}

.orientation-device-mockup {
    position: relative;
    width: 54px;
    height: 54px;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.orientation-phone-icon {
    font-size: 34px;
    color: #38bdf8;
    display: inline-block;
    animation: phoneRotateAnim 2.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    transform-origin: center center;
}

@keyframes phoneRotateAnim {
    0%, 15% {
        transform: rotate(90deg) scale(0.92);
        color: #f87171;
    }
    45%, 70% {
        transform: rotate(0deg) scale(1.06);
        color: #38bdf8;
    }
    90%, 100% {
        transform: rotate(90deg) scale(0.92);
        color: #f87171;
    }
}

.orientation-rotate-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #2563eb;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.orientation-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #f8fafc;
}

.orientation-desc {
    font-size: 0.85rem;
    color: #cbd5e1;
    margin-bottom: 14px;
    line-height: 1.5;
}

.orientation-bypass-btn {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 0.8rem;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.orientation-bypass-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.35);
}

/* Floating Install Prompt Banner */
.pwa-prompt {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #ffffff;
  border-radius: 16px;
  padding: 12px 16px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.12);
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 360px;
  width: calc(100vw - 32px);
  box-sizing: border-box;
}

.pwa-prompt.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.pwa-prompt.hide {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(120px);
}

.pwa-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pwa-icon {
  width: 42px;
  height: 42px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.pwa-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.pwa-text strong {
  font-size: 13.5px;
  font-weight: 600;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pwa-text span {
  font-size: 11.5px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pwa-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.pwa-install, .pwa-close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
}

.pwa-install {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.pwa-install:hover {
  background: #1d4ed8;
  transform: scale(1.05);
}

.pwa-install:active {
  transform: scale(0.95);
}

.pwa-close {
  background: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
}

.pwa-close:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

@media (max-width: 480px) {
  .pwa-prompt {
    bottom: 16px;
    width: calc(100vw - 24px);
    padding: 10px 14px;
  }
}
