/**
 * RPM Popup Styles
 * 
 * Styles for login/register popup modals
 * 
 * @package Rental_Property_Manager
 * @subpackage Assets
 * @since 1.0.0
 * @version 2.0.0
 */

/* ==========================================================================
   Popup Overlay
   ========================================================================== */
.rpm-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  padding: 20px;
  backdrop-filter: blur(4px);
  animation: rpmFadeIn 0.2s ease;
}

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

/* ==========================================================================
   Popup Container
   ========================================================================== */
.rpm-popup-container {
  background: #ffffff;
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: rpmPopupIn 0.3s ease;
}

@keyframes rpmPopupIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Custom scrollbar for popup */
.rpm-popup-container::-webkit-scrollbar {
  width: 8px;
}

.rpm-popup-container::-webkit-scrollbar-track {
  background: #f3f4f6;
  border-radius: 0 16px 16px 0;
}

.rpm-popup-container::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 4px;
}

.rpm-popup-container::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* ==========================================================================
   Popup Close Button
   ========================================================================== */
.rpm-popup-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  background: #f3f4f6;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  z-index: 10;
  transition: all 0.2s ease;
}

.rpm-popup-close:hover {
  background: #e5e7eb;
  color: #374151;
  transform: rotate(90deg);
}

.rpm-popup-close:active {
  transform: rotate(90deg) scale(0.95);
}

.rpm-popup-close svg {
  width: 20px;
  height: 20px;
}

/* ==========================================================================
   Popup Content
   ========================================================================== */
.rpm-popup-content {
  padding: 32px;
}

/* Popup Header */
.rpm-popup-header {
  text-align: center;
  margin-bottom: 24px;
}

.rpm-popup-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 28px;
}

.rpm-popup-title {
  margin: 0 0 8px 0;
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  line-height: 1.3;
}

.rpm-popup-subtitle {
  margin: 0;
  font-size: 14px;
  color: #6b7280;
  line-height: 1.5;
}

/* Popup Divider */
.rpm-popup-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 20px 0;
  position: relative;
}

.rpm-popup-divider span {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #ffffff;
  padding: 0 12px;
  font-size: 13px;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Popup Text */
.rpm-popup-text {
  margin: 0 0 15px 0;
  font-size: 14px;
  color: #374151;
  text-align: center;
  line-height: 1.5;
}

.rpm-popup-subtext {
  margin: 0 0 15px 0;
  font-size: 13px;
  color: #6b7280;
  text-align: center;
  line-height: 1.5;
}

/* ==========================================================================
   Popup Form
   ========================================================================== */
.rpm-popup-form .rpm-form {
  gap: 16px;
}

.rpm-popup-form .rpm-form-group {
  display: flex;
  flex-direction: column;
}

.rpm-popup-form .rpm-form-group label {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
  display: block;
}

.rpm-popup-form .rpm-form-group input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 15px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  transition: all 0.2s ease;
}

.rpm-popup-form .rpm-form-group input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.rpm-popup-form .rpm-form-group input::placeholder {
  color: #9ca3af;
}

/* Form Row */
.rpm-popup-form .rpm-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Buttons */
.rpm-popup-form .rpm-btn {
  width: 100%;
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  text-transform: none;
  letter-spacing: normal;
}

.rpm-popup-form .rpm-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.rpm-popup-form .rpm-btn-primary {
  background: #2563eb;
  color: #ffffff;
  border: none;
}

.rpm-popup-form .rpm-btn-primary:hover:not(:disabled) {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.rpm-popup-form .rpm-btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.rpm-popup-form .rpm-btn-outline {
  background: transparent;
  color: #374151;
  border: 2px solid #d1d5db;
}

.rpm-popup-form .rpm-btn-outline:hover:not(:disabled) {
  border-color: #2563eb;
  color: #2563eb;
  background: rgba(37, 99, 235, 0.05);
}

/* Google Button */
.rpm-popup-form .rpm-btn-google {
  background: #ffffff;
  color: #374151;
  border: 1px solid #d1d5db;
}

.rpm-popup-form .rpm-btn-google:hover:not(:disabled) {
  background: #f9fafb;
  border-color: #9ca3af;
}

/* ==========================================================================
   Social Login Section
   ========================================================================== */
.rpm-popup-social {
  margin-bottom: 16px;
}

.rpm-google-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.rpm-google-icon svg {
  width: 18px;
  height: 18px;
}

/* ==========================================================================
   Popup Messages
   ========================================================================== */
.rpm-popup-message {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-top: 16px;
  text-align: center;
  display: none;
  animation: rpmSlideDown 0.3s ease;
}

@keyframes rpmSlideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.rpm-popup-message.rpm-message-success {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.rpm-popup-message.rpm-message-error {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ==========================================================================
   Loading State
   ========================================================================== */
.rpm-popup-form .rpm-btn.loading {
  position: relative;
  color: transparent;
}

.rpm-popup-form .rpm-btn.loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: rpmSpin 0.6s linear infinite;
}

@keyframes rpmSpin {
  to {
    transform: rotate(360deg);
  }
}

/* ==========================================================================
   Form Hint
   ========================================================================== */
.rpm-form-hint {
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 480px) {
  .rpm-popup-container {
    max-width: 100%;
    margin: 10px;
    border-radius: 12px;
  }

  .rpm-popup-content {
    padding: 24px 20px;
  }

  .rpm-popup-form .rpm-form-row {
    grid-template-columns: 1fr;
  }

  .rpm-popup-icon {
    width: 56px;
    height: 56px;
    font-size: 24px;
  }

  .rpm-popup-title {
    font-size: 18px;
  }

  .rpm-popup-form .rpm-btn {
    padding: 12px 16px;
  }
}

/* Extra small devices */
@media (max-width: 360px) {
  .rpm-popup-overlay {
    padding: 10px;
  }

  .rpm-popup-content {
    padding: 20px 16px;
  }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */
@media print {
  .rpm-popup-overlay {
    display: none !important;
  }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */
.rpm-popup-close:focus {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.rpm-popup-form input:focus {
  outline: none;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  .rpm-popup-overlay,
  .rpm-popup-container,
  .rpm-popup-close,
  .rpm-popup-message {
    animation: none;
  }

  .rpm-popup-form .rpm-btn,
  .rpm-popup-close {
    transition: none;
  }
}
