/* ==== CSS CUSTOM PROPERTIES ==== */
:root {
  --brand-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

@font-face {
  font-family: "Gabarito";
  src: url("Gabarito.ttf") format("truetype");
  font-weight: 400 900;
  font-style: normal;
}

@font-face {
  font-family: "InterTight";
  src: url("InterTight.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal italic;
}

/* ==== RESET ==== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  background: #fff;
}

/* ==== SWIPE WRAPPER ==== */
.swipe-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 300vw;
  height: 100dvh;
  display: flex;
  transform: translateX(-100vw); /* start centered */
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  touch-action: pan-x;
}

/* ==== EACH VIEW ==== */
.view {
  width: 100vw;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: relative;
}

/* ==== BACKGROUND COLORS ==== */
.camera-view   { background: #000; }
.gallery-view  { background: #f9f9f9; }
.settings-view { background: #f9f9f9; } 


/* Apply shadow to icons and capture logo */
.action-left i,
.action-right i{
  filter: drop-shadow(var(--brand-shadow));
}

/* ==== TOP MENU ==== */
.top-menu {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0px 20px;
  padding-top: max(14px, env(safe-area-inset-top, 14px));
  color: #fff;
  font-weight: 600;
  font-size: 18px;
  z-index: 10;
}

.gallery-view .top-menu { color: #000; }
.top-center { flex: 1; text-align: center; }

/* ==== MAIN CONTENT ==== */
.main-content {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.main-content.fixed {
  overflow: hidden;
}

.main-content.scrollable {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0; /* ensure no padding */
  margin: 0;
}

.title {
  font-family: "Gabarito", sans-serif;
  font-size: 31px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -1px;
  text-align: center;
  text-shadow: var(--brand-shadow);
}

/* ==== ACTION BUTTONS (BOTTOM BAR) ==== */
.action-buttons {
  position: absolute;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding-inline: 40px;
  pointer-events: none;
  z-index: 20;
}


.action-left,
.action-right {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  pointer-events: auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

.action-left i,
.action-right i {
  font-size: 28px; 
  color: #fff;
  pointer-events: none;
}

/* Ensure icons are white even in gallery view */
.gallery-view .action-left i,
.gallery-view .action-right i {
  color: #fff;
}

.action-center {
  width: 140px;
  height: 140px;
  margin: 0 18px;
  pointer-events: auto;
  display: flex;
  justify-content: center;
  align-items: center;
  background: transparent;
}

/* ==== CAPTURE LOGO (HTML/CSS version) ==== */
/* Container – no background, just centers the button */
  .capture-button {
    display: inline-block;          /* shrink-wrap to content */
    position: relative;             /* stacking context for children */
    width: 110px;                   /* matches outer-rim total size */
    height: 110px;
    padding: 0;
    margin: 0;
    background: transparent;
  }


  /* Outer rim – behind the inner circle */
  .outer-rim {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 107px;                   /* size BEFORE border */
    height: 107px;
    border: 4px solid white;        /* 5 px white border */
    border-radius: 50%;             /* perfect circle */
    background: transparent;
    z-index: 1;                     /* behind inner circle */
  }

  /* Inner circle – sits on top */
  .inner-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 92px;
    height: 92px;
    background: white;
    border-radius: 50%;
    z-index: 2;                     /* in front of rim */
  }

  .capture-button {
  /* allow shadows to show outside the container */
  overflow: visible;
}
.capture-button .outer-rim {
  box-shadow: var(--brand-shadow);
}

/* Pressed state for capture button */
.capture-button.pressed {
  transform: scale(0.82);
  transition: transform 0.2s ease;
}

/* Optional: smooth return when released */
.capture-button {
  transition: transform 0.2s ease;
}


/* === Virtual Gallery Grid === */
#virtualGallery {
  position: relative;
  width: 100%;
  background: #f9f9f9;
  /* height is set by JS – total rows × (tile + 1px) */
  padding: 0;
  margin: 0;
}

#virtualGallery .tile {
  position: absolute;
  background: #f3f3f3;          
  border-radius: 0;          
  box-shadow: none;
  border: 0;
  overflow: hidden;
  image-rendering: -webkit-optimize-contrast; /* sharp on retina */
}

/* ==== MAGIC CAMERA PREVIEW ==== */
#magicCamera {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
}

/* Video fills the container and crops to cover */
#magicCamera video {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Fallback message */
.camera-error {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(0, 0, 0, 0.8);
  text-align: center;
  font-size: 18px;
  padding: 20px;
}

/* ==== EMPTY STATE STYLES ==== */
#no-photos,
#no-friends {
  position: absolute;
  top: calc(50% - (env(safe-area-inset-bottom, 0px) + 40px));
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: "Gabarito", sans-serif;
  font-size: 27px;
  font-weight: 600;
  color: #bdbdbd;
  text-align: center;
  opacity: 0.8;
  display: none;
  pointer-events: none;
}

#no-photos span,
#no-friends span {
  display: block;
  max-width: 95%;
  margin: 0 auto;
  line-height: 1.2;
}


@keyframes slideInFriction {
  0% {
    transform: translate(-50%, calc(-50% - 40px));
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  60% {
    transform: translate(-50%, calc(-50% + 5px));
  }
  80% {
    transform: translate(-50%, calc(-50% - 2px));
  }
  100% {
    transform: translate(-50%, -50%);
  }
}

@keyframes slideOutFriction {
  0% {
    transform: translate(-50%, -50%);
    opacity: 1;
  }
  20% {
    transform: translate(-50%, calc(-50% - 3px));
  }
  100% {
    transform: translate(-50%, calc(-50% - 40px));
    opacity: 0;
  }
}



.example-enter {
  animation: slideInFriction 0.4s cubic-bezier(0.22, 1.0, 0.36, 1.0);
}

.example-exit {
  animation: slideOutFriction 0.3s cubic-bezier(0.55, 0.06, 0.68, 0.19);
}




/* ==== INVITE LINK MODAL STYLES ==== */
.invite-link-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 360px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
  z-index: 999;
  animation: slideInFriction 0.4s cubic-bezier(0.22, 1.0, 0.36, 1.0);
  overflow: hidden;
  transition: transform 0.25s ease;
}

.invite-link-modal.modal-adjust {
  transform: translate(-50%, -60%);
}

.invite-link-modal-content {
  padding: 20px 24px;
  text-align: center;
  font-family: "InterTight", sans-serif;
}

.invite-link-modal-title {
  font-family: "Gabarito", sans-serif;
  font-size: 27px;
  font-weight: 600;
  margin-bottom: 14px;
  letter-spacing: -1px;
}

/* === Profile Section === */
.invite-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 16px;
}

.profile-pic-wrapper {
  position: relative;
  width: 180px;
  height: 180px;
}

.profile-pic {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #f0f0f0;
}

.edit-icon {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 38px;
  height: 38px;
  background: #007bff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.2);
  cursor: pointer;
}

.username-section {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}

.username {
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.username-edit {
  color: #666;
  font-size: 14px;
  cursor: pointer;
  transition: color 0.2s ease;
}

.username-edit:hover {
  color: #007bff;
}

/* === Body and Link === */
.invite-link-modal-body {
  font-size: 15px;
  color: #444;
  line-height: 1.4;
  margin-bottom: 18px;
}

.invite-link-modal-link {
  font-family: monospace;
  background: #f3f3f3;
  padding: 10px;
  border-radius: 8px;
  user-select: all;
  word-break: break-all;
  margin-bottom: 14px;
}

.invite-link-modal-buttons {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.invite-link-modal-buttons button {
  flex: 1;
  padding: 10px 0;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease;
}

.copy-btn {
  background: #007bff;
  color: #fff;
}

.copy-btn:hover,
.copy-btn.copied {
  background: #0064d6;
}

.exit-btn {
  background: #e0e0e0;
  color: #333;
}

.exit-btn:hover {
  background: #c8c8c8;
}

/* Animate enter/exit */
.invite-link-enter {
  animation: slideInFriction 0.3s cubic-bezier(0.22, 1.0, 0.36, 1.0);
}

.invite-link-exit {
  animation: slideOutFriction 0.4s cubic-bezier(0.55, 0.06, 0.68, 0.19);
}


.photo-viewer {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,1);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  overflow: hidden;
  touch-action: none;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.photo-viewer.hidden {
  opacity: 0;
  pointer-events: none;
}

.photo-viewer canvas {
  width: 100vw;
  height: 100vh;
  object-fit: contain;
}

#switch-camera.pressed,
#switch-camera:active {
  transform: scale(0.9);
  opacity: 0.7;
}


#switch-camera,
#capture-button,
.action-buttons * {
  pointer-events: auto !important;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

