/* Login Modal Styles - Recreation of AuthPage functionality */

/* Login button in navigation */
.loginButton {
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Montserrat', sans-serif;
  font-size: inherit;
  transition: color 0.3s ease;
}

.loginButton:hover {
  color: var(--secundaryColor);
}

/* Modal overlay */
.auth-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  overflow: hidden;
  padding: 1rem;
}

.auth-modal.active {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Close button */
.auth-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  color: white;
  font-size: 18px;
  font-weight: bold;
  transition: all 0.3s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.auth-modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
  transform: scale(1.1);
}

/* Main auth container */
.auth-modal-content {
  width: 100%;
  max-width: 800px;
  height: 550px; /* Increased from 500px to 550px to accommodate extra padding */
  background: linear-gradient(to bottom right, #50a3a2 0%, #53e3a6 100%);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow:
    0 25px 50px -12px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  position: relative;
  z-index: 2;
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
  transform: scale(0.9);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.auth-modal.active .auth-modal-content {
  transform: scale(1);
  opacity: 1;
}

.auth-modal:not(.active) .auth-modal-content {
  transform: scale(0.95);
  opacity: 0;
}

/* Body styling when modal is open */
body.modal-open {
  overflow: hidden;
}

@media (max-width: 768px) {
  .auth-modal-content {
    height: 600px;
    border: 2px solid #9c27b0;
    margin: 1rem;
    max-width: calc(100% - 2rem);
  }
}

/* Background animated bubbles */
.bg-bubbles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  list-style: none;
  padding: 0;
  margin: 0;
}

.bg-bubbles li {
  position: absolute;
  display: block;
  width: 40px;
  height: 40px;
  background-color: rgba(255, 255, 255, 0.15);
  bottom: -160px;
  animation: squareAnimation 25s infinite linear;
}

.bg-bubbles li:nth-child(1) {
  left: 10%;
  animation-duration: 20s;
}

.bg-bubbles li:nth-child(2) {
  left: 20%;
  width: 80px;
  height: 80px;
  animation-delay: 2s;
  animation-duration: 25s;
}

.bg-bubbles li:nth-child(3) {
  left: 25%;
  animation-delay: 4s;
  animation-duration: 20s;
}

.bg-bubbles li:nth-child(4) {
  left: 40%;
  width: 60px;
  height: 60px;
  animation-duration: 28s;
  background-color: rgba(255, 255, 255, 0.25);
}

.bg-bubbles li:nth-child(5) {
  left: 70%;
  animation-duration: 22s;
}

.bg-bubbles li:nth-child(6) {
  left: 80%;
  width: 120px;
  height: 120px;
  animation-delay: 3s;
  background-color: rgba(255, 255, 255, 0.2);
  animation-duration: 18s;
}

.bg-bubbles li:nth-child(7) {
  left: 32%;
  width: 160px;
  height: 160px;
  animation-delay: 7s;
  animation-duration: 30s;
}

.bg-bubbles li:nth-child(8) {
  left: 55%;
  width: 20px;
  height: 20px;
  animation-delay: 15s;
  animation-duration: 35s;
}

.bg-bubbles li:nth-child(9) {
  left: 25%;
  width: 10px;
  height: 10px;
  animation-delay: 2s;
  animation-duration: 40s;
  background-color: rgba(255, 255, 255, 0.3);
}

.bg-bubbles li:nth-child(10) {
  left: 90%;
  width: 160px;
  height: 160px;
  animation-delay: 11s;
  animation-duration: 25s;
}

/* Bubble animation */
@keyframes squareAnimation {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-1000px) rotate(600deg);
  }
}

/* Mobile Logo */
.mobile-logo {
  margin-bottom: 1rem;
  max-width: 80px;
  position: absolute;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 11;
}

@media (min-width: 768px) {
  .mobile-logo {
    display: none;
  }
}

/* Mobile Layout */
.mobile-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  transition: background-color 0.5s ease;
}

@media (min-width: 768px) {
  .mobile-content {
    display: none;
  }
}

.mobile-content > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 400px;
}

/* Mobile Forms */
.mobile-form {
  display: none;
  width: 100%;
  max-width: 400px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-form.active {
  display: flex;
  opacity: 1;
}

/* Desktop Container */
.desktop-container {
  display: none;
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

@media (min-width: 768px) {
  .desktop-container {
    display: block;
  }
}

/* Form Panel - sliding panel */
.form-panel {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  border-radius: 0.5rem;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.09),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0;
  overflow: hidden;
  background-color: #fff;
  left: 0%;
  transition: all 0.5s ease-in-out;
}

.form-panel.register-mode {
  left: 50%;
  border-radius: 0 0.5rem 0.5rem 0;
  background-color: rgba(142, 154, 175, 1);
}

.form-panel.login-mode {
  left: 0%;
  border-radius: 0.5rem 0 0 0.5rem;
  background-color: rgba(234, 199, 204, 1);
}

/* Desktop Layout - Info panels container */
.desktop-layout {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  z-index: 1;
}

.desktop-layout > div {
  width: 50%;
  flex-basis: 50%;
  flex-grow: 0;
  flex-shrink: 0;
}

/* Desktop Forms */
.desktop-form {
  display: none;
  width: 100%;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.desktop-form.active {
  display: flex;
  opacity: 1;
}

/* Info Panel */
.info-panel {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  padding-bottom: 3rem; /* Increase bottom padding to prevent button cutoff */
  background:
    radial-gradient(
      circle at center,
      rgba(255, 255, 255, 0.15) 20%,
      rgba(255, 255, 255, 0.05) 100%
    ),
    rgba(255, 248, 248, 0.1);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-sizing: border-box;
  overflow: hidden;
}

/* Panel Logo */
.panel-logo {
  margin-bottom: 0.75rem;
  max-width: 120px;
}

/* Brand Title */
.brand-title {
  font-size: 1.875rem;
  font-family: serif;
  margin-bottom: 1rem;
  text-align: center;
  line-height: 1.2;
  width: 100%;
}

.brand-text.pink {
  color: #ec4899;
}

.brand-text.blue {
  color: #3b82f6;
}

/* Info Text */
.info-text {
  color: #4b5563;
  font-size: 0.875rem;
  margin-bottom: 2rem;
  text-align: center;
}

/* Social Buttons */
.social-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.social-button {
  color: #4b5563;
  transition: color 300ms;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.social-button.pink:hover {
  color: #ec4899;
}

.social-button.blue:hover {
  color: #3b82f6;
}

/* Toggle Buttons */
.mobile-toggle-button,
.desktop-toggle-button {
  background-color: white;
  border: 1px solid #3b82f6;
  color: #3b82f6;
  padding: 0.5rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  transition: all 300ms;
  cursor: pointer;
  margin-top: 0.5rem;
  margin-bottom: 1rem; /* Add bottom margin to ensure button is not cut off */
}

.mobile-toggle-button.register-mode,
.desktop-toggle-button.register-mode {
  border-color: #ec4899;
  color: #ec4899;
}

.mobile-toggle-button:hover,
.desktop-toggle-button:hover {
  background-color: #3b82f6;
  color: white;
}

.mobile-toggle-button.register-mode:hover,
.desktop-toggle-button.register-mode:hover {
  background-color: #ec4899;
  color: white;
}

/* Form Container */
.form-container {
  padding: 2rem;
  padding-bottom: 3rem; /* Increase bottom padding to prevent button cutoff */
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
}

/* Form Title */
.form-title {
  color: white;
  font-size: 1.875rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  text-align: center;
}

/* Error and Success Messages */
.error-message {
  color: #ef4444;
  margin-bottom: 1rem;
  display: none;
}

.error-message.show {
  display: block;
}

.success-message {
  color: #22c55e;
  margin-bottom: 1rem;
  display: none;
}

.success-message.show {
  display: block;
}

/* Form */
.styled-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

/* Input */
.styled-input {
  width: 100%;
  background-color: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
  padding: 0.5rem;
  color: white;
  font-family: 'Montserrat', sans-serif;
}

.styled-input::placeholder {
  color: rgba(255, 255, 255, 0.75);
}

.styled-input:focus {
  outline: none;
  border-bottom: 1px solid white;
}

/* Select */
.styled-select {
  width: 100%;
  background-color: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
  padding: 0.5rem;
  color: white;
  appearance: none;
  font-family: 'Montserrat', sans-serif;
}

.styled-select:focus {
  outline: none;
  border-bottom: 1px solid white;
}

.styled-select option {
  background-color: #8e9aaf;
  color: white;
}

/* Button */
.styled-button {
  width: 100%;
  background-color: white;
  color: #ec4899;
  padding: 0.75rem 0;
  border-radius: 0.5rem;
  font-weight: 600;
  transition: all 300ms;
  border: none;
  cursor: pointer;
  font-family: 'Montserrat', sans-serif;
}

.styled-button:hover {
  background-color: #fce7f3;
}

/* Google Login Button */
.google-login-button {
  width: 100%;
  background-color: #4285f4;
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  transition: all 300ms;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  cursor: pointer;
  margin: 0.5rem 0;
  font-family: 'Montserrat', sans-serif;
}

.google-login-button:hover {
  background-color: #357ae8;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(66, 133, 244, 0.3);
}

.google-login-button:active {
  transform: translateY(0);
}

.google-login-button svg {
  width: 20px;
  height: 20px;
}

/* Form Content */
.form-content {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  height: 100%;
  padding: 2rem;
  justify-content: center;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .auth-modal-content {
    margin: 1rem;
    height: calc(100vh - 2rem);
    max-height: 600px;
  }

  .form-container {
    padding: 1rem;
    padding-bottom: 2rem; /* Ensure bottom padding on mobile */
  }

  .mobile-content {
    padding: 1rem;
    padding-bottom: 2rem; /* Ensure bottom padding on mobile */
  }

  .info-panel {
    padding-bottom: 2rem; /* Ensure bottom padding on mobile */
  }

  .auth-modal-close {
    top: 0.5rem;
    right: 0.5rem;
    width: 30px;
    height: 30px;
    font-size: 1.2rem;
  }
}

/* Smooth modal transitions */
.auth-modal {
  transition: opacity 0.3s ease;
  opacity: 0;
}

.auth-modal.active {
  opacity: 1;
}

/* Prevent body scroll when modal is open */
body.modal-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
}
