/* Components: buttons, icons, email form, playback, submit, status, recording animation */
.btn, .btn-record, .btn-play, .btn-playback, .btn-nav, .btn-submit, .btn-stop, .btn-upload, .btn-next, .btn-primary, .btn-email-submit {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Baloo 2', cursive;
  font-weight: 600;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.btn {
  width: 100px;
  height: 100px;
}
.btn-icon {
  font-size: 2rem;
  margin-bottom: 0.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.svg-icon {
  width: 32px;
  height: 32px;
  stroke: currentColor;
}
.btn-record .svg-icon {
  width: 40px;
  height: 40px;
}
.btn-nav .svg-icon {
  width: 36px;
  height: 36px;
}
.btn-text {
  font-size: 1.2rem;
  text-align: center;
  max-width: 100%;
  line-height: 1.1;
  flex-shrink: 0;
}
.btn-record {
  background-color: var(--error-color);
  color: white;
  width: 110px;
  height: 110px;
}
.btn-play, .btn-playback {
  background-color: var(--primary-color);
  color: white;
  width: 200px;
  height: 110px;
  padding: 0.8rem;
  gap: 0.2rem;
}
.btn-nav {
  background-color: var(--secondary-color);
  color: var(--text-color);
  width: 100px;
  height: 100px;
}
.btn-nav .btn-icon {
  margin: 0;
  font-size: 2.5rem;
}
.btn-submit {
  background-color: var(--success-color);
  color: white;
  width: 160px;
  height: 100px;
  margin: 0 auto;
  margin-left: auto;
  margin-right: auto;
  position: relative;
  z-index: 2;
  margin-bottom: 2.5rem;
  /* Ensure enough space below the button */
  box-sizing: border-box;
}
.btn-play {
  background-color: var(--secondary-color);
  color: var(--text-color);
  grid-column: span 2;
}
.btn-stop {
  background-color: #2C3A47;
  color: white;
}
.btn-playback {
  background-color: var(--primary-color);
  color: white;
  grid-column: span 2;
}
.btn-upload {
  background-color: var(--success-color);
  color: white;
  grid-column: span 2;
}
.btn-next {
  background-color: var(--primary-color);
  color: white;
  margin-top: 1.2rem;
}
.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}
.btn:active {
  transform: translateY(0);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  background-color: #999 !important;
}
.btn.active {
  opacity: 0.8;
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.12);
}
.btn-primary {
  background-color: var(--secondary-color);
  color: var(--text-color);
  padding: 0.9rem 2.2rem;
  font-size: 1.25rem;
  min-width: 180px;
  height: 56px;
  line-height: 1;
  font-weight: 600;
  border-radius: 10px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}
@media (max-width: 600px) {
  .btn-primary {
    font-size: 1.05rem;
    min-width: 120px;
    height: 44px;
    padding: 0.7rem 1.2rem;
  }
  .btn-email-submit {
    height: 44px !important;
    min-height: 44px !important;
  }
}
@media (max-width: 375px) {
  .btn-primary {
    font-size: 0.95rem;
    min-width: 90px;
    height: 38px;
    padding: 0.5rem 0.7rem;
  }
  .btn-email-submit {
    height: 36px !important;
    min-height: 36px !important;
  }
}
.btn-email-submit {
  background-color: var(--primary-color);
  color: white;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  font-size: 1.2rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  flex: 1 1 0%;
  min-width: 0;
  max-width: 120px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0;
  margin-bottom: 0;
}
.btn-email-submit:hover {
  background-color: #3a69db;
  transform: translateY(-2px);
}
.playback-row {
  margin-bottom: 3rem;
}
.submit-row {
  margin-top: 0.1.2rem;
  justify-content: center;
  align-items: center;
}
.control-row.submit-row {
  display: flex;
  justify-content: center !important;
  align-items: center;
  width: 100%;
}
.submit-center-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}
#submit-btn {
  margin-left: auto;
  margin-right: auto;
  display: block;
}
.status {
  display: none;
  padding: 0.3rem 0.5rem;
  border-radius: 10px;
  font-weight: 600;
  color: var(--primary-color);
  font-size: 0.8rem;
  background-color: rgba(255, 255, 255, 0.9);
  pointer-events: auto;
  max-width: 90%;
  margin: 0 auto;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
.status.status-has-content {
  display: block;
}
.status.error {
  background-color: rgba(252, 92, 101, 0.1);
  color: var(--error-color);
}
.status.success {
  background-color: rgba(38, 222, 129, 0.1);
  color: var(--success-color);
}
.recording-animation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  margin-top: 0.3rem;
}
.wave {
  width: 4px;
  height: 15px;
  background-color: var(--error-color);
  border-radius: 5px;
  animation: wave 1s infinite ease-in-out;
}
.wave:nth-child(2) {
  animation-delay: 0.2s;
}
.wave:nth-child(3) {
  animation-delay: 0.4s;
}
.upload-progress {
  display: none;
}
/* Large default size for edge buttons */
.edge-btn {
  background-color: #fff !important;
  color: var(--secondary-color) !important;
  border: 2px solid var(--secondary-color) !important;
  width: 110px;
  height: 110px;
  min-width: 110px;
  min-height: 110px;
}
.edge-btn .svg-icon {
  color: var(--secondary-color) !important;
  stroke: var(--secondary-color) !important;
  width: 48px;
  height: 48px;
}

/* Responsive resizing for edge buttons */
@media (max-width: 1024px) {
  .edge-btn {
    width: 90px;
    height: 90px;
    min-width: 90px;
    min-height: 90px;
  }
  .edge-btn .svg-icon {
    width: 38px;
    height: 38px;
  }
}
@media (max-width: 600px) {
  .edge-btn {
    width: 70px;
    height: 70px;
    min-width: 70px;
    min-height: 70px;
  }
  .edge-btn .svg-icon {
    width: 28px;
    height: 28px;
  }
}
@media (max-width: 375px) {
  .edge-btn {
    width: 55px;
    height: 55px;
    min-width: 55px;
    min-height: 55px;
  }
  .edge-btn .svg-icon {
    width: 22px;
    height: 22px;
  }
}
.email-input-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  max-width: 420px;
  margin: 1.2rem auto 0 auto;
  box-sizing: border-box;
}
.email-input-container input[type="email"] {
  flex: 4 1 0%;
  min-width: 0;
  height: 54px;
  border-radius: 10px;
  border: 1.5px solid #d1d5db;
  padding: 0.6rem 1.2rem;
  font-size: 1.18rem;
  font-family: 'Baloo 2', cursive;
  box-sizing: border-box;
  outline: none;
  transition: border 0.2s;
}
.email-input-container input[type="email"]:focus {
  border-color: var(--primary-color);
}
@media (max-width: 600px) {
  .email-input-container {
    max-width: 98vw;
    gap: 0.3rem;
  }
  .email-input-container input[type="email"] {
    height: 44px;
    font-size: 1.08rem;
    padding: 0.5rem 0.7rem;
  }
}
@media (max-width: 375px) {
  .email-input-container {
    max-width: 100vw;
    gap: 0.2rem;
  }
  .email-input-container input[type="email"] {
    height: 36px;
    font-size: 1.01.2rem;
    padding: 0.4rem 0.5rem;
  }
}

/* Instructions Popup */
#instructions-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

#instructions-popup .popup-content {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  max-width: 500px;
  margin: 1rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  text-align: center;
  position: relative;
}

#instructions-popup h2 {
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  font-size: 1.4rem;
  font-family: 'Baloo 2', cursive;
}

#instructions-popup .instruction-text {
  text-align: left;
  line-height: 1.6;
  color: var(--text-primary-color);
  margin-bottom: 2rem;
}

#instructions-popup .instruction-text p {
  margin-bottom: 1rem;
}

#instructions-popup .instruction-text p:last-child {
  margin-bottom: 0;
  font-weight: 600;
  color: var(--primary-color);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideIn {
  from { 
    opacity: 0; 
    transform: translateY(-20px) scale(0.95); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0) scale(1); 
  }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes slideOut {
  from { 
    opacity: 1; 
    transform: translateY(0) scale(1); 
  }
  to { 
    opacity: 0; 
    transform: translateY(-20px) scale(0.95); 
  }
}

@media (max-width: 480px) {
  #instructions-popup .popup-content {
    padding: 1.5rem;
    margin: 0.5rem;
    max-width: calc(100vw - 1rem);
  }
  
  #instructions-popup h2 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
  }
  
  #instructions-popup .instruction-text {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
  }
}
