@import url(https://fonts.googleapis.com/css2?family=Oswald:wght@700&display=swap);
@import url(https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap);
/* --- Import Oswald font --- */

:root {
  --abhibus-red: #bf2629;
  --abhibus-dark-red: #901d20;
  --abhibus-white: #ffffff;
  --abhibus-grey: #f4f4f4;
  --abhibus-text: #333333;
}

html {
  margin: 0; padding: 0; width: 100%; height: 100%;
  overflow: hidden;
  font-family: 'Roboto', sans-serif;
}

body {
  margin: 0; padding: 0; width: 100%; height: 100%;
  overflow: hidden;
  background-color: var(--abhibus-white);
}

/* --- THEMED MAIN APP CONTAINER (Camera View - No Frame) --- */
#main-app-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: black; /* Canvas background remains black */
}

#canvas {
  z-index: 1;
}


/* --- START SCREEN (Modified with Frame) --- */
#start-screen {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
  z-index: 2000;
  
  /* UPDATED: Added frame.png layered over white background */
  background: url(assets/frame.png) center/100% 100% no-repeat, var(--abhibus-white);
  
  display: flex;
  justify-content: center;
  align-items: center;
}

#start-screen-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 80%;
  max-width: 350px;
}

#start-screen button#start-button {
  background-color: var(--abhibus-red); 
  border: none; 
  cursor: pointer;
  -webkit-tap-highlight-color: transparent; 
  width: 100%; max-width: 250px;
  padding: 15px 0;
  border-radius: 50px;
  box-shadow: 0 4px 10px rgba(191, 38, 41, 0.3);
  
  visibility: visible;
  opacity: 1;
  transition: transform 0.2s ease, background-color 0.2s ease; 
  
  display: flex;
  justify-content: center;
  align-items: center;
}

#start-screen button#start-button span {
  color: var(--abhibus-white);
  font-family: 'Oswald', sans-serif;
  font-size: 1.2rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}

#start-screen button#start-button img { width: 100%; height: auto; display: block; }
#start-screen button#start-button:active { transform: translate(-50%, -50%) scale(0.95); background-color: var(--abhibus-dark-red); }
#start-screen button#start-button:disabled { opacity: 0.7; cursor: not-allowed; }


/* --- BRAND LOADER (With Frame) --- */
#loading-overlay,
#loading-global {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  
  /* UPDATED: Added frame.png layered over white background */
  background: url(assets/frame.png) center/100% 100% no-repeat, var(--abhibus-white);
  
  display: flex;
  justify-content: center;
  align-items: center;
}
#loading-overlay { z-index: 2001; }
#loading-global { z-index: 3000; }

.brand-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.dot {
  width: 15px;
  height: 15px;
  background-color: var(--abhibus-red);
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out both;
}

.dot:nth-child(1) { animation-delay: -0.32s; }
.dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}


/* --- THEMED: CAPTURE BUTTONS --- */
#controls { 
  position: absolute; 
  bottom: 5%; 
  width: 100%; 
  display: flex; 
  justify-content: center; 
  align-items: center; 
  z-index: 999;
  gap: 40px; 
}

/* Common styles for both buttons */
#photo-capture-button,
#video-capture-button {
  height: 80px;
  width: 80px;
  background-color: transparent;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  transform: scale(1);
  padding: 0;
  box-sizing: border-box;
}

#photo-capture-button:active,
#video-capture-button:active {
  transform: scale(0.95);
}

/* Photo Button Style - AbhiBus Theme */
#photo-capture-button {
  border: 4px solid var(--abhibus-white); 
  background-color: rgba(255, 255, 255, 0.2); 
  background-image: url(assets/cam.png); 
  background-size: 60%;
  background-position: center;
  background-repeat: no-repeat;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

#photo-capture-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Video Button Style - AbhiBus Theme */
#video-capture-button {
  border: 4px solid var(--abhibus-white); 
  background-color: var(--abhibus-red); /* Red fill */
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

/* Inner dot for video button */
#video-capture-button::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 25px;
  height: 25px;
  border-radius: 50%; 
  background-color: var(--abhibus-white); 
  transition: all 0.3s ease;
}

/* Recording state for Video Button */
#video-capture-button.recording::after {
  width: 20px;
  height: 20px;
  border-radius: 4px; /* Square for stop */
  animation: pulse-red-dot 1.2s infinite;
}

@keyframes pulse-red-dot {
  0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7); }
  70% { box-shadow: 0 0 5px 10px rgba(255, 255, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}


/* --- THEMED: PREVIEW POPUP (With Frame) --- */
#video-preview-container, #photo-preview-container { 
  position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
  background-color: var(--abhibus-white);
  z-index: 2500; display: flex; justify-content: center; align-items: center; 
  padding: 0;
}

#video-preview-popup, #photo-preview-popup { 
  position: relative; display: block;
  width: 100%; height: 100%;
  
  /* UPDATED: Added frame.png layered over white background */
  background: url(assets/frame.png) center/100% 100% no-repeat, var(--abhibus-white);

  border: none; padding: 0; box-shadow: none;
}

.preview-media-wrapper { 
  position: absolute;
  top: 20%; 
  left: 50%;
  transform: translateX(-50%);
  width: 65%; 
  max-width: 400px;
  aspect-ratio: 9 / 16;
  border-radius: 20px;
  overflow: hidden; 
  box-shadow: 0 10px 30px rgba(0,0,0,0.15); 
  background: black;
}

#preview-video, #preview-image { 
  width: 100%; height: 100%; object-fit: cover; border-radius: 20px; 
}

#close-video-preview-button, #close-photo-preview-button { 
  position: absolute; top: 3%; right: 5%;
  width: 40px; height: 40px;
  background: var(--abhibus-grey); 
  color: var(--abhibus-text);
  border: none; border-radius: 50%; 
  font-family: sans-serif; font-size: 24px; font-weight: bold;
  display: flex; align-items: center; justify-content: center; line-height: 0; padding-bottom: 2px;
  cursor: pointer; z-index: 2505; transition: all 0.2s ease; user-select: none;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1); 
}
#close-video-preview-button:hover, #close-photo-preview-button:hover { 
    background: #e0e0e0; transform: rotate(90deg); 
}

#popup-actions, #photo-popup-actions { 
  position: absolute;
  bottom: 10%;
  left: 10%;
  width: 80%;
  display: flex; justify-content: center; 
  gap: 15px;
  flex-shrink: 0; 
}
.popup-cta-button { 
  font-family: 'Oswald', sans-serif; 
  font-size: 1rem;
  padding: 14px 24px;
  max-width: 160px;
  flex-grow: 1; 
  background-color: var(--abhibus-red); 
  color: var(--abhibus-white);
  border: none; border-radius: 50px; text-transform: uppercase;
  cursor: pointer; font-weight: 700;
  transition: all 0.2s ease;
  box-shadow: 0 4px 6px rgba(191, 38, 41, 0.2);
}
.popup-cta-button:active { background: var(--abhibus-dark-red); transform: translateY(2px); }


/* --- UNCHANGED SECTIONS --- */
.poweredbysnap-logo { position: absolute; bottom: 15px; left: 15px; z-index: 2; }
.poweredbysnap-logo > img { width: 100px; opacity: 0.8; filter: drop-shadow(0 0 4px rgba(0,0,0,0.5)); }

#switch-cam { display: none; }
.desktop #switch-cam { display: none; }

/* --- THEMED KEYBOARD INPUT UI --- */
.keyboard-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none; 
  flex-direction: column;
  align-items: center;
  width: 90%;
  max-width: 480px;
  gap: 15px;
  background: var(--abhibus-white); 
  border: 2px solid var(--abhibus-red); 
  border-radius: 20px;
  padding: 25px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2); 
  z-index: 9999;
  box-sizing: border-box;
}
.keyboard-container input[type="text"] {
  width: 100%;
  font-family: 'Roboto', sans-serif;
  font-size: 1.1em;
  padding: 15px 20px;
  color: var(--abhibus-text); 
  background: var(--abhibus-grey); 
  border: 1px solid #ccc;
  border-radius: 50px;
  outline: none;
  text-align: left;
  box-sizing: border-box;
}
.keyboard-container input[type="text"]:focus {
    border-color: var(--abhibus-red);
}
.keyboard-container button {
  white-space: nowrap;
  font-family: 'Oswald', sans-serif;
  font-size: 1.1em;
  padding: 15px 40px;
  color: var(--abhibus-white); 
  background: var(--abhibus-red); 
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  font-weight: 700;
}
.keyboard-container button:active {
    transform: scale(0.95);
    background: var(--abhibus-dark-red);
}
