/**
 * Custom Login Modal Styles
 * Matches modern design with dark blue gradient background
 *
 * @package StreamTube Core
 */

/* Modal Backdrop */
#modal-login.show {
  backdrop-filter: blur(8px);
}

#modal-login .modal-backdrop {
  background-color: rgba(0, 0, 0, 0.7);
}

/* Modal Container */
#modal-login .modal-content {
  background: linear-gradient(135deg, #1e3a5f 0%, #2d4a6f 100%);
  border-radius: 12px;
  border: none;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Close Button */
#modal-login .btn-close-white {
  filter: brightness(0.8);
  transition: all 0.3s ease;
}

#modal-login .btn-close-white:hover {
  filter: brightness(1.2);
  transform: rotate(90deg);
}

/* Title */
#modal-login h2 {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  letter-spacing: -0.02em;
}

/* Error Alert */
#modal-login .alert-danger {
  animation: shake 0.5s ease;
  font-size: 0.9rem;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-5px);
  }
  20%,
  40%,
  60%,
  80% {
    transform: translateX(5px);
  }
}

/* Form Controls */
#modal-login .form-control {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

#modal-login .form-control::placeholder {
  color: rgba(255, 255, 255, 0.4);
  font-weight: 400;
}

#modal-login .form-control:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(65, 105, 225, 0.1);
}

#modal-login .form-control:-webkit-autofill,
#modal-login .form-control:-webkit-autofill:hover,
#modal-login .form-control:-webkit-autofill:focus {
  -webkit-text-fill-color: #fff;
  -webkit-box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.08) inset;
  transition: background-color 5000s ease-in-out 0s;
}

/* Input Icons */
#modal-login .input-icon {
  pointer-events: none;
}

/* Password Toggle */
#modal-login .password-toggle {
  cursor: pointer;
  transition: color 0.3s ease;
}

#modal-login .password-toggle:hover {
  color: #fff !important;
}

#modal-login .password-toggle:focus {
  outline: none;
  box-shadow: none;
}

/* Sign In Button */
#modal-login button[type="submit"] {
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

#modal-login button[type="submit"]::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

#modal-login button[type="submit"]:hover::before {
  width: 300px;
  height: 300px;
}

#modal-login button[type="submit"]:active {
  transform: scale(0.98);
}

/* Divider */
#modal-login hr {
  margin: 1.5rem 0;
}

/* Social Login Container */
#modal-login .nsl-container {
  display: flex !important;
  justify-content: center !important;
  gap: 1rem !important;
  flex-wrap: wrap !important;
}

#modal-login .nsl-container-block {
  display: flex !important;
  flex-direction: row !important;
  justify-content: center !important;
}

/* Social Login Buttons */
#modal-login .nsl-button {
  width: 56px !important;
  height: 56px !important;
  min-width: 56px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  margin: 0 !important;
  transition: all 0.3s ease !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

#modal-login .nsl-button:hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15) !important;
}

#modal-login .nsl-button-default {
  background-color: #fff !important;
}

#modal-login .nsl-button-icon {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

#modal-login .nsl-button-icon img,
#modal-login .nsl-button-icon svg {
  width: 24px !important;
  height: 24px !important;
}

#modal-login .nsl-button-label {
  display: none !important;
}

/* Google Button */
#modal-login .nsl-button-google {
  background-color: #fff !important;
}

/* Facebook Button */
#modal-login .nsl-button-facebook {
  background-color: #1877f2 !important;
}

/* Apple Button */
#modal-login .nsl-button-apple {
  background-color: #000 !important;
}

/* Twitter/X Button */
#modal-login .nsl-button-twitter {
  background-color: #000 !important;
}

/* Links */
#modal-login a {
  transition: all 0.3s ease;
}

#modal-login a:hover {
  opacity: 0.8;
  text-decoration: underline !important;
}

/* Sign Up Link */
#modal-login .text-white-50 {
  font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 576px) {
  #modal-login .modal-body {
    padding: 2rem 1.5rem !important;
  }

  #modal-login h2 {
    font-size: 1.5rem !important;
  }

  #modal-login .form-control {
    font-size: 0.9rem !important;
    padding: 12px 16px 12px 44px !important;
  }

  #modal-login button[type="submit"] {
    padding: 12px !important;
    font-size: 0.95rem !important;
  }

  #modal-login .nsl-button {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
  }
}

/* Loading State */
#modal-login button[type="submit"].loading {
  pointer-events: none;
  opacity: 0.7;
  position: relative;
}

#modal-login button[type="submit"].loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid #fff;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Focus Visible (Accessibility) */
#modal-login *:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}
