/**
 * Multi-Step Popup CSS
 * Анимации и стили для двухшагового popup
 */

/* Popup Steps Container */
.phb-popup-step {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transform: none;
  z-index: 1;
}

/* Calendar step - no padding on desktop, minimal padding on mobile */
.phb-calendar-step {
  padding: 0;
}

/* Mobile padding for calendar step */
@media (max-width: 768px) {
  .phb-calendar-step {
    padding: 0.5rem;
  }

  .phb-calendar-step .phb-calendar-container {
    padding: 0.25rem;
  }
}

/* Form and success steps - with padding */
.phb-form-step,
.phb-success-step {
  padding: 0.5rem;
}

.phb-popup-step.active {
  opacity: 1;
  visibility: visible;
  position: relative;
  z-index: 100;
}

.phb-popup-step.slide-out-left {
  transform: none;
  /* Remove transform to avoid stacking context issues */
  opacity: 0;
  z-index: 1;
}

.phb-popup-step.slide-out-right {
  transform: none;
  /* Remove transform to avoid stacking context issues */
  opacity: 0;
  z-index: 1;
}

/* Ensure inactive steps are properly hidden */
.phb-popup-step:not(.active) {
  pointer-events: none;
}

/* Modal styles are handled in room-card-widget.css */

#phb-booking-modal-overlay .iti--container {
  position: absolute !important;
  z-index: 100000 !important;
}



/* Calendar Step */
.phb-calendar-step {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 0;
  width: 100%;
}

/* Calendar container - full width */
.phb-calendar-step .phb-calendar-container {
  width: 100%;
  flex: 1 1 100%;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  align-items: center;
  justify-content: flex-start;
  position: relative;
}

/* Range calendar - full width */
.phb-calendar-step .phb-range-calendar {
  width: 100%;
  flex: 1 1 100%;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

/* Scaling wrapper for calendar to fit into popup without inner scroll */
.phb-calendar-scale {
  transform-origin: top center;
  will-change: transform;
}

/* Skeleton loader styles */
.phb-calendar-skeleton {
  width: calc(100% - 2rem);
  max-width: 820px;
  border-radius: 0;
  padding: 0.5rem;
  background-color: #7d8083;
  position: relative;
}

.phb-skeleton-block {
  height: 220px;
  border-radius: 5px;
  background-color: #7d8083;
  overflow: hidden;
  position: relative;
}

.phb-skeleton-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.35) 50%, rgba(255,255,255,0.1) 100%);
  animation: phb-shimmer 1.2s infinite;
}

@keyframes phb-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Ensure calendar takes full width of popup */
/* .phb-modal-body styles moved to room-card-widget.css to avoid conflicts */

.phb-popup-step {
  width: 100%;
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  z-index: 1;
}

.phb-popup-step.active {
  opacity: 1;
  visibility: visible;
  position: relative;
  z-index: 100;
}

/* Form Step */
.phb-form-step {
  display: flex;
  flex-direction: column;
}

/* Success Step */
.phb-success-step {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.phb-success-step.active {
  opacity: 1;
  visibility: visible;
  position: relative;
  z-index: 100;
}

/* Step Navigation */
.phb-step-navigation {
  margin-bottom: 0.25rem;
}

.phb-back-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  color: #667eea;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 6px;
}

.phb-back-btn:hover {
  background: rgba(102, 126, 234, 0.1);
  color: #5a6fd8;
}

/* removed empty rule: .phb-back-btn svg {} */

/* removed empty rule: .phb-back-btn:hover svg {} */

/* Selected Dates Summary */
.phb-selected-dates-summary {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 2px solid #e9ecef;
  border-radius: 5px;
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  text-align: center;
}

.phb-dates-info {
  margin-bottom: 0.75rem;
}

.phb-dates-text {
  display: block;
  font-size: 1.1rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 0.25rem;
}

.phb-nights-text {
  display: block;
  font-size: 0.9rem;
  color: #6c757d;
}

.phb-total-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: #27ae60;
  padding: 0.5rem;
  background: rgba(39, 174, 96, 0.1);
  border-radius: 8px;
}

/* Success Content */
.phb-success-content {
  max-width: 400px;
  width: 100%;
}

.phb-success-icon {
  margin-bottom: 0.5rem;
  color: #27ae60;
}

.phb-success-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 0.5rem;
}

.phb-booking-summary {
  background: #f8f9fa;
  border-radius: 5px;
  padding: 0.5rem;
  margin-bottom: 1rem;
  text-align: left;
}

.phb-booking-summary h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 1rem;
  text-align: center;
}

.phb-booking-summary .summary-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #e9ecef;
}

.phb-booking-summary .summary-item:last-child {
  border-bottom: none;
  font-weight: 600;
  font-size: 1.1rem;
  color: #27ae60;
}

.phb-booking-summary .summary-item.total {
  border-bottom: none;
  font-weight: 700;
  font-size: 1.2rem;
  color: #667eea;
  background: #f0f4ff;
  padding: 0.75rem;
  border-radius: 5px;
  margin-top: 1rem;
}

.phb-close-success {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

/* Form Error Messages */
.phb-form-error {
  background: #fee2e2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 0.75rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  font-weight: 500;
}

/* removed empty rule: .phb-close-success:hover {} */

/* Responsive Design */
@media (max-width: 768px) {
  .phb-popup-step {
    padding: 0.75rem;
  }

  .phb-selected-dates-summary {
    padding: 0.75rem;
    margin-bottom: 0.7rem;
  }

  .phb-success-content {
    max-width: 100%;
  }

  /* Field Error Styles */
  .phb-error-message {
    color: #e74c3c;
    font-size: 0.9em;
    margin-top: 5px;
    padding: 5px 10px;
    background-color: #fdf2f2;
    border: 1px solid #fecaca;
    border-radius: 4px;
  }

  .phb-form-group input.error,
  .phb-form-group textarea.error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 1px #e74c3c;
  }

  .phb-calendar-error {
    color: #e74c3c;
    font-size: 0.9em;
    margin-top: 10px;
    padding: 10px;
    background-color: #fdf2f2;
    border: 1px solid #fecaca;
    border-radius: 4px;
    text-align: center;
  }

  .phb-booking-summary {
    padding: 0.5rem;
  }

  /* Mobile calendar step */
  .phb-calendar-step {
    padding: 0.5rem;
  }

  .phb-calendar-step .phb-calendar-container {
    padding: 0.25rem;
  }
}

@media (max-width: 480px) {
  .phb-popup-step {
    padding: 0.75rem;
  }

  .phb-calendar-step {
    padding: 0.375rem;
  }

  .phb-calendar-step .phb-calendar-container {
    padding: 0.125rem;
  }

  /* Mobile phone input */
  .phb-phone-input-container {
    flex-direction: column;
    gap: 0.75rem;
  }

  .phb-country-code {
    width: 100%;
    text-align: center;
  }

  .phb-form-group input,
  .phb-form-group textarea {
    padding: 0.75rem;
    font-size: 0.95rem;
  }
}

/* Mobile popup step styles */
@media (max-width: 768px) {
  .phb-popup-step {
    border-radius: 0;
  }
}

/* Animation Classes */
.phb-popup-step.entering {
  animation: slideInRight 0.4s ease-out;
}

.phb-popup-step.exiting {
  animation: slideOutLeft 0.4s ease-in;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOutLeft {
  from {
    opacity: 1;
    transform: translateX(0);
  }

  to {
    opacity: 0;
    transform: translateX(-100%);
  }
}

/* Phone Input with Country Code */
.phb-phone-input-container {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.phb-country-code {
  flex-shrink: 0;
  width: 80px;
  padding: 0.875rem 0.5rem;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-size: 0.9rem;
  background: #ffffff;
  cursor: pointer;
}

.phb-country-code:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Form Inputs with Icons */
.phb-input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.phb-input-icon {
  position: absolute;
  left: 1rem;
  color: #6b7280;
  z-index: 2;
  pointer-events: none;
}

.phb-form-group input,
.phb-form-group textarea {
  width: 100%;
  padding: 0.75rem 0.75rem 0.75rem 3rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 1rem;
  background: #ffffff;
}

.phb-form-group input:focus,
.phb-form-group textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.15);
}

.phb-form-group input:focus+.phb-input-icon,
.phb-form-group textarea:focus+.phb-input-icon,
.phb-input-with-icon:focus-within .phb-input-icon {
  color: #667eea;
}

.phb-form-group input::placeholder,
.phb-form-group textarea::placeholder {
  color: #6b7280;
  font-weight: 500;
  opacity: 1;
}

/* Phone input specific */
.phb-phone-input-container input[type="tel"] {
  flex: 1;
}

/* Textarea icon positioning */
.phb-form-group textarea {
  padding-top: 2.5rem;
}

.phb-form-group textarea+.phb-input-icon {
  top: 1rem;
  align-items: flex-start;
}

/* Focus States for Accessibility */
.phb-back-btn:focus-visible {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

.phb-close-success:focus-visible {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .phb-input-icon {
    width: 18px;
    height: 18px;
    left: 0.875rem;
  }

  .phb-form-group input,
  .phb-form-group textarea {
    padding: 0.625rem 0.625rem 0.625rem 2.5rem;
    font-size: 16px;
  }

  .phb-form-group textarea {
    padding-top: 2.25rem;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .phb-input-icon {
    color: #9ca3af;
  }

  .phb-form-group input:focus+.phb-input-icon,
  .phb-form-group textarea:focus+.phb-input-icon,
  .phb-input-with-icon:focus-within .phb-input-icon {
    color: #60a5fa;
  }

  .phb-selected-dates-summary {
    background: linear-gradient(135deg, #2a2a2a 0%, #333333 100%);
    border-color: #444444;
  }

  .phb-dates-text {
    color: #ffffff;
  }

  .phb-nights-text {
    color: #cccccc;
  }

  .phb-booking-summary {
    background: #2a2a2a;
    border-color: #444444;
  }

  .phb-booking-summary h4 {
    color: #ffffff;
  }

  .phb-success-title {
    color: #ffffff;
  }
}