/* CatCam Clean Edge-to-Edge Responsive CSS */
:root {
  --bg-primary: #000000;
  --bg-secondary: #090a10;
  --border-glass: rgba(255, 255, 255, 0.1);
  --accent-pink: #ff2a85;
  --accent-cyan: #00f0ff;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html, body {
  width: 100vw;
  height: 100vh;
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-sans);
  overflow: hidden;
  position: fixed;
  inset: 0;
  touch-action: none;
}

/* App Shell */
.app-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  overflow: hidden;
}

/* Workspace Container - Default Desktop Side-by-Side (50/50 Split) */
.workspace-container {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: row;
  overflow: hidden;
}

/* Pane Base Styles */
.pane {
  position: relative;
  flex: 1;
  height: 100%;
  width: 50%;
  background: #000;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pane-camera {
  background: #000;
}

.pane-meme {
  background: #000;
  border-left: 1px solid var(--border-glass);
}

/* Camera Video & Canvas Overlay */
.video-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#cameraVideo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* Mirror selfie cam */
}

#landmarkCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  transform: scaleX(-1); /* Match mirrored video */
}

/* Meme Media Box */
.meme-media-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #000;
}

#memeImg, #memeVideo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pop-animation {
  animation: memePop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes memePop {
  0% { transform: scale(0.94); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

/* Mobile & Portrait Layout (Stacked 50/50 Top & Bottom) */
@media (max-width: 768px), (orientation: portrait) {
  .workspace-container {
    flex-direction: column;
  }

  .pane {
    width: 100%;
    height: 50%;
    flex: 1;
  }

  .pane-meme {
    border-left: none;
    border-top: 1px solid var(--border-glass);
  }
}

/* Fullscreen Loading Overlay */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: #050508;
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  transition: opacity 0.4s ease;
}

.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 42, 133, 0.2);
  border-top-color: var(--accent-pink);
  border-radius: 50%;
  animation: spin 0.9s infinite linear;
}

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

.loading-text {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}
