body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: calc(84px + env(safe-area-inset-top));
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
  overflow-x: hidden;
  background-color: #f8f9fa;
  color: #2d3436;
  overscroll-behavior-y: none;
}

body.is-changing {
  pointer-events: none;
}

main {
  flex: 1;
}

/* Status Bar Styling */
.status-bar {
  height: calc(84px + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  backdrop-filter: blur(20px);
  background: linear-gradient(135deg, #4361ee 0%, #3a56e4 100%) !important;
  box-shadow: 0 4px 24px rgba(67, 97, 238, 0.15);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
}

.status-bar .container-fluid {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  padding: 0 1.25rem;
}

.status-bar .menu-btn {
  position: absolute;
  left: 1.25rem;
  color: white;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.status-bar .menu-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.status-bar .menu-btn:active {
  transform: scale(0.95);
}

.status-bar .menu-btn i {
  font-size: 1.5rem;
  color: white;
}

.status-bar .navbar-brand {
  font-size: 1.5rem;
  font-weight: 600;
  color: white;
  margin: 0;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Offcanvas Styling */
.offcanvas {
  max-width: 90% !important;
  width: 360px;
  border-radius: 0 24px 24px 0;
  border: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.95) 100%);
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(67, 97, 238, 0.12);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  touch-action: pan-x;
}

.offcanvas .offcanvas-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(228, 230, 239, 0.8);
}

.offcanvas .offcanvas-title {
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.5px;
  color: #2d3436;
}

.offcanvas .nav-link {
  color: #2d3436;
  padding: 1rem 1.5rem;
  border-radius: 16px;
  margin: 0.5rem 1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 1rem;
  font-weight: 500;
  display: flex;
  align-items: center;
}

.offcanvas .nav-link i {
  font-size: 1.25rem;
  margin-right: 1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.offcanvas .nav-link:hover {
  background: rgba(67, 97, 238, 0.08);
  transform: translateX(4px);
}

.offcanvas .nav-link.active {
  background: linear-gradient(135deg, #4361ee 0%, #3a56e4 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(67, 97, 238, 0.25);
}

.offcanvas .nav-link.active i {
  color: white;
}

/* Page Container and Pages */
.page-container {
  position: relative;
  width: 100%;
  height: calc(100vh - (84px + env(safe-area-inset-top) + 76px + env(safe-area-inset-bottom)));
  overflow: hidden;
}

.page {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  visibility: hidden;
  display: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1.25rem;
  background-color: #f8f9fa;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

/* Bottom Navigation Styling */
.bottom-nav {
  height: calc(76px + env(safe-area-inset-bottom));
  padding: 0;
  backdrop-filter: blur(20px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.98) 100%) !important;
  border-top: 1px solid rgba(228, 230, 239, 0.8);
  box-shadow: 0 -8px 24px rgba(67, 97, 238, 0.08);
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1020;
}

.bottom-nav .container-fluid {
  padding: 0;
  height: 100%;
}

.bottom-nav .row {
  margin: 0;
  height: 100%;
  width: 100%;
  padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav .col {
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bottom-nav .nav-link {
  color: #94A3B8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 0;
  width: 100%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  height: 100%;
}

.bottom-nav .nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) scale(0);
  width: 24px;
  height: 3px;
  border-radius: 4px;
  background: #4361ee;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bottom-nav .nav-link.active {
  color: #4361ee;
}

.bottom-nav .nav-link.active::after {
  transform: translateX(-50%) scale(1);
}

.bottom-nav .nav-link i {
  font-size: 22px;
  margin-bottom: 4px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.bottom-nav .nav-link:hover i {
  transform: translateY(-2px);
}

.bottom-nav .nav-link.active i {
  transform: translateY(-2px);
}

.bottom-nav .nav-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.2px;
  margin-top: 2px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0.8;
}

.bottom-nav .nav-link.active .nav-label {
  opacity: 1;
  font-weight: 600;
}

/* Camera styles */
.camera-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: calc(76px + env(safe-area-inset-bottom));
  background: #000;
  overflow: hidden;
  touch-action: none;
  z-index: 1;
}

#camera {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.timer-display {
  position: fixed;
  top: calc(84px + env(safe-area-inset-top) + 16px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 1px;
  z-index: 1031;
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Chat Feed Overlay */
.chat-feed {
  position: fixed;
  bottom: calc(180px + env(safe-area-inset-bottom));
  left: 16px;
  right: 16px;
  max-height: 40vh;
  overflow-y: auto;
  z-index: 1032;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  -webkit-overflow-scrolling: touch;
  mask-image: linear-gradient(to top, black 80%, transparent 100%);
  -webkit-mask-image: linear-gradient(to top, black 80%, transparent 100%);
}

.chat-message {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 16px;
  backdrop-filter: blur(10px);
  transform-origin: bottom;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  font-size: 14px;
  line-height: 1.4;
  opacity: 0;
  animation: messageSlideIn 0.2s ease-out forwards;
}

.chat-message.latest {
  opacity: 1;
}

.chat-message.fade-out {
  animation: messageFadeOut 0.5s ease-out forwards;
}

.chat-message.ai {
  background: rgba(255, 255, 255, 0.95);
  color: #1a1a1a;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}

.chat-message.user {
  background: rgba(67, 97, 238, 0.95);
  color: white;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}

@keyframes messageSlideIn {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes messageFadeOut {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(0) scale(0.95);
  }
}

.camera-controls {
  position: absolute;
  bottom: 32px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 24px;
  z-index: 10;
}

.camera-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.camera-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

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

.capture-btn {
  width: 76px;
  height: 76px;
  background: white;
  color: #4361ee;
  position: relative;
}

.capture-btn.active {
  background: #dc3545;
  color: white;
}

.capture-btn:hover {
  background: white;
}

.capture-btn.active:hover {
  background: #dc3545;
}

.capture-btn i {
  font-size: 32px;
}

.flip-btn i,
.flash-btn i {
  font-size: 24px;
}

/* Add page specific styles */
#add.page {
  padding: 0;
  background: #000;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: calc(76px + env(safe-area-inset-bottom));
}