/* =============================================
   VidyaVerse PWA Styles v1.0
   Install Banner, Offline Banner, Update Notice
   ============================================= */

/* ─── INSTALL BANNER ───────────────────────── */
#vv-install-banner {
  position: fixed;
  bottom: -120px;
  left: 0;
  right: 0;
  z-index: 10000;
  padding: 0 16px 16px;
  transition: bottom 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

#vv-install-banner.vv-install-visible {
  bottom: 0;
  pointer-events: auto;
}

/* iOS safe area */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  #vv-install-banner {
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }
}

.vv-install-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border, rgba(0,0,0,0.08));
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
  max-width: 480px;
  margin: 0 auto;
}

.vv-install-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.vv-install-text {
  flex: 1;
  min-width: 0;
}

.vv-install-text strong {
  display: block;
  font-size: 0.95rem;
  color: var(--text, #1a1a2e);
  margin-bottom: 2px;
}

.vv-install-text span {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted, #666);
  line-height: 1.3;
}

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

.vv-install-btn {
  background: linear-gradient(135deg, #F97316, #FB923C);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s, box-shadow 0.15s;
}

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

.vv-install-btn:hover {
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.35);
}

.vv-install-dismiss {
  background: none;
  border: none;
  color: var(--text-muted, #999);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background 0.15s;
}

.vv-install-dismiss:hover {
  background: var(--hover-bg, rgba(0,0,0,0.05));
}


/* ─── OFFLINE BANNER ───────────────────────── */
#vv-offline-banner {
  position: fixed;
  top: -50px;
  left: 0;
  right: 0;
  z-index: 10001;
  background: linear-gradient(135deg, #374151, #4B5563);
  color: white;
  text-align: center;
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: top 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#vv-offline-banner.vv-offline-visible {
  top: 0;
}

/* iOS safe area */
@supports (padding-top: env(safe-area-inset-top)) {
  #vv-offline-banner.vv-offline-visible {
    padding-top: calc(10px + env(safe-area-inset-top));
  }
}


/* ─── UPDATE BANNER ────────────────────────── */
#vv-update-banner {
  position: fixed;
  top: -80px;
  left: 0;
  right: 0;
  z-index: 10001;
  padding: 0 16px;
  transition: top 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#vv-update-banner.vv-update-visible {
  top: 16px;
}

.vv-update-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 20px;
  background: linear-gradient(135deg, #1E40AF, #3B82F6);
  color: white;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(30, 64, 175, 0.3);
  max-width: 480px;
  margin: 0 auto;
  font-size: 0.85rem;
}

#vv-update-btn {
  background: white;
  color: #1E40AF;
  border: none;
  padding: 6px 16px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s;
}

#vv-update-btn:active {
  transform: scale(0.95);
}


/* ─── DARK THEME OVERRIDES ─────────────────── */
[data-theme="dark"] .vv-install-inner,
.theme-dark .vv-install-inner {
  background: #1e293b;
  border-color: rgba(255,255,255,0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .vv-install-text strong,
.theme-dark .vv-install-text strong {
  color: #f1f5f9;
}

[data-theme="dark"] .vv-install-text span,
.theme-dark .vv-install-text span {
  color: #94a3b8;
}

[data-theme="dark"] .vv-install-dismiss,
.theme-dark .vv-install-dismiss {
  color: #94a3b8;
}

[data-theme="dark"] .vv-install-dismiss:hover,
.theme-dark .vv-install-dismiss:hover {
  background: rgba(255,255,255,0.08);
}


/* ─── RESPONSIVE ───────────────────────────── */
@media (max-width: 400px) {
  .vv-install-inner {
    flex-wrap: wrap;
  }
  
  .vv-install-text {
    flex-basis: calc(100% - 50px);
  }
  
  .vv-install-actions {
    flex-basis: 100%;
    justify-content: flex-end;
  }
}
