/* Hidden class for elements that need to be temporarily hidden */
.hidden {
  display: none !important;
}

/* Reset body and html */
body, html {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden; /* Prevent scrolling */
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: Arial, sans-serif;
  background-color: #f4f4f4;
  touch-action: none; /* Prevent default touch actions like scrolling or zooming */
}

/* General container styling */
.container {
  width: 100vw;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  top: 0;
  left: 0;
  opacity: 1;
  transition: opacity 1s ease;
}

/* Sender Container with Specific Background */
.sender-container, .receiver-container {
  display: flex;
  flex-direction: column;
  justify-content: flex-start; /* Change to flex-start to have more control over positioning */
  align-items: center; /* Center horizontally */
  height: 100%;
  background-size: cover;
  background-position: center top;
}

.sender-container {
  background: url('Images/sender.webp') no-repeat center top;
  background-size: cover;
}

.receiver-container {
  background: url('Images/receiver.webp') no-repeat center top;
  background-size: cover;
}

/* Mobile-first styling (default) */
.sender-container, .receiver-container {
  width: 100vw;
  height: 100%;
}

.logo {
  position: absolute;
  top: .7%;
  right: 1%;
  width: auto; /* Adjust size as needed */
  height: 8%;
  z-index: 100; /* Ensure the logo is on top */
}

.slogo {
  position: absolute;
  bottom: .7%;
  right: 2%;
  width: auto; /* Adjust size as needed */
  height: 20px;
  z-index: 100; /* Ensure the logo is on top */
}

/* Form container positioning */
#rakhiForm {
  margin-top: 50vh; /* Position the form 60% from the top of the screen */
  width: 100%;
  padding: 20px;
  max-width: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Style each form element */
.form-group {
  width: 100%;
  margin-bottom: 1vh;
}

/* Voice recorder UI styling */
#voiceRecorderUI {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100px; /* Give some height to the container */
}

#holdRecordBtn {
  align-self: center;
  margin: auto 0; /* Center vertically */
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  background: #fff;
}

/* Receiver side audio play button positioning */
#playVoiceWrapper {
  position: absolute;
  left: 50%;
  top: 55vh;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#playVoiceBtn {
  background: #fff;
  border: none;
  box-shadow: 0 4px 16px rgba(255,128,0,0.12);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin-bottom: 12px;
  transition: box-shadow 0.2s;
}

#playVoiceMsg {
  font-size: 1.15em;
  color: #ff8000;
  font-weight: 500;
  letter-spacing: 0.5px;
}

#playVoiceText {
  font-family: Trajan;
  color: #6D3900;
  font-size: 1.2em;
  margin-top: 8px;
  text-align: center;
}

/* Submit button styling */
button[type="submit"].submit-button {
  background-color: #6D3900 !important;
  color: white !important;
  font-family: Trajan !important;
}

.security-message {
  font-size: 1vh;
  text-align: center;
  max-width: 300px;
  width: 70%;
  font-size: 12px;
  color: #6D3900;
  font-family: Trajan;
  margin-top: 10px; /* Small gap after the form */
}

/* Add a gap between input fields */
.input-wrapper {
  margin-bottom: 4px;
}

input[type="text"],
input[type="email"],
input[type="tel"] {
  width: 100%;
  padding: 8px;
  border: .5px solid #6D3900;
  border-radius: 8px;
  box-sizing: border-box;
  text-align: center;

}

/* Style for scaling the checkbox */
input[type="checkbox"] {
  transform: scale(1.2);
  margin-right: 5px;
  vertical-align: middle;
}

/* Label styling */
label {
  font-size: 80%;
  display: block;
  margin-top: 15px;
  color: #6D3900;
}

/* Submit button specific style */
.submit-button {
  width: max-content;
  padding: 8px 30px;
  margin: 10px auto;
  display: block;
  background-color: #4D9952;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  letter-spacing: 1px;
  transition: background-color 0.3s;
  min-width: 120px;
  min-height: 40px;
}

.submit-button:hover {
  background-color: #0056b3;
}




/* Placeholder styling */
input::placeholder {
  color: #ccc;
  text-align: center;

}

input:focus::placeholder {
  color: black;
  text-align: center;
}

#output-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

#canvas {
  position: absolute;
  top: 0;
  left: 0;
  align-items: center;
  width: 100%;
  height: 100%;
}

.overlay-message {
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  text-align: center;
  color: #6D3900;
  font-size: 8px;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
  z-index: 10;
  pointer-events: none;
  font-family: 'MyCustomFont', 'Times New Roman', Times, serif;
}

/* Define the custom font using @font-face */
@font-face {
  font-family: 'MyCustomFont';
  src: url('Images/times.ttf') format('truetype'), /* Fallback format for older browsers */
       url('Images/TRAJAN-BOLD.OTF') format('opentype'); /* Fallback format for older browsers */
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'Trajan';
  src: url('Images/TRAJAN-BOLD.OTF') format('opentype'); /* Define a separate font-face for TRAJAN */
  font-weight: normal;
  font-style: normal;
}

/* Apply the custom font to the .message class */
.message {
  text-transform: uppercase;
  position: absolute;
  top: 20%; /* Changed from 25vh to 20vh to move it higher */
  width: 30%;
  text-align: center;
  color: #6D3900;
  font-size: 0.5vh;
  z-index: 10;
  pointer-events: none;
  font-family: 'MyCustomFont', 'Times New Roman', Times, serif; /* Use custom font with fallback */
}

.greeting-title {
  color: #4D9952;
  font-size: 16px;
  font-family: 'Trajan';
  max-width: 100%;
  line-height: 0.7;
  /* Allow proper text flow */
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  /* Keep as block element */
  display: block;
}

.greeting-message {
  font-size: 12px;
  color: #6D3900; 
  font-family: 'Trajan', 'Times New Roman', Times, serif; /* Use TRAJAN font with fallback */
}

/* Capture button styling */
.capture-button {
  position: absolute;
  bottom: 15%; /* Moved higher from 5% to 15% */
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 60px;
  cursor: pointer;
  z-index: 100;
  transition: transform 0.2s ease;
}

.capture-button:hover {
  transform: translateX(-50%) scale(1.1);
}

/* Preview container styling */
#preview-container {
  width: 100vw;
  height: 100%;
  max-width: 56.4vh;
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start; /* Changed from center to flex-start */
  align-items: center;
  background-color: #000;
  z-index: 200; /* Ensure it's above other elements */
  box-sizing: border-box;
  padding: 20px 10px 100px; /* Increased bottom padding */
  overflow: hidden; /* Prevent scrolling */
}

.preview-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start; /* Changed from space-between to flex-start */
  align-items: center;
  padding-top: 15%;
  padding-bottom: 10%;
}

.preview-image {
  max-width: 100%;
  max-height: 65%;
  width: auto;
  object-fit: contain;
  margin-bottom: 30px; /* Added margin to create space between image and buttons */
}

.preview-actions {
  position: relative;
  bottom: auto;
  left: auto;
  right: auto;
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 10px;
  width: 100%;
  margin-top: 0; /* Removed top margin */
  margin-bottom: 20px;
}

.preview-button {
  padding: 14px 28px; /* Increased padding */
  border: none;
  border-radius: 25px; /* Increased border radius */
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s ease;
  min-width: 120px;
  -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
}

#shareButton {
  background-color: #6D3900;
  color: white;
}

#retakeButton {
  background-color: #f5f5f5;
  color: #333;
}

.preview-button:hover {
  transform: scale(1.05);
}

/* Audio player compact styling */
.audio-player-compact {
  width: 90%;
  max-width: 320px;
  margin: 0 auto;
  display: block;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(255,128,0,0.10);
  background: #fff8f0;
  height: 40px;
}

.audio-player-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-bottom: 12px;
  /* position: relative; */
}

#speedMenuBtn {
  /* position: absolute; */
  /* right: 12px; */
  /* top: 8px; */
  margin-right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 22px;
  color: #ff8000;
}

#recordActionRow {
  display: none;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 18px;
  margin-bottom: 16px;
  width: 100%;
}
#recordActionRow button {
  transition: box-shadow 0.2s, border 0.2s;
}
#recordActionRow button:active {
  box-shadow: 0 4px 16px rgba(255,128,0,0.18);
}

#reRecordBtn {
  margin-left: 12px;
  background: #fff;
  border: 2px solid #ff8000;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #ff8000;
  box-shadow: 0 2px 8px rgba(255,128,0,0.10);
  cursor: pointer;
  /* position: static; */
  transition: box-shadow 0.2s, border 0.2s;
}
#reRecordBtn:active {
  box-shadow: 0 4px 16px rgba(255,128,0,0.18);
}

/* Camera loading indicator */
.camera-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  color: white;
  z-index: 150;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid #ff8000;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 15px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.camera-loading p {
  margin: 0;
  font-size: 16px;
  font-weight: bold;
  text-align: center;
}

/* Audio player compact styling */
#camera-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100%;
  background-color: #000; /* Black background to prevent white screen */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
}

#openCameraBtn {
  background-color: #6D3900;
  color: white;
  border: none;
  border-radius: 25px;
  padding: 15px 20px;
  font-size: 1.8vh;
  margin-top: 15px;
  cursor: pointer;
  font-family: 'Trajan', 'TRAJAN-BOLD', serif;
  display: none; /* Hidden by default */
  transition: background-color 0.3s;
  min-width: 140px;
  min-height: 45px;
}

#openCameraBtn:hover {
  background-color: #8a4a00;
}
