/* Premium Checkout Modal Styles - Pastel Theme */

/* Modal Overlay */
.premium-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.premium-modal.open {
  opacity: 1;
  visibility: visible;
}

.premium-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  transition: opacity 0.3s ease;
}

/* Modal Container */
.premium-modal-container {
  position: relative;
  width: 90%;
  max-width: 420px;
  max-height: 90vh;
  background: linear-gradient(180deg, #FFF9E6 0%, #FFF5D6 100%);
  border-radius: 24px;
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.5) inset;
  overflow: hidden;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
}

.premium-modal.open .premium-modal-container {
  transform: scale(1) translateY(0);
}

/* Close Button */
.premium-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  color: #666;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.premium-modal-close:hover {
  background: white;
  color: #333;
  transform: scale(1.1);
}

/* Header */
.premium-modal-header {
  text-align: center;
  padding: 32px 24px 20px;
  background: linear-gradient(135deg, #FFE066 0%, #FFD43B 50%, #FCC419 100%);
  position: relative;
  overflow: hidden;
}

.premium-modal-header::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 10px,
    rgba(255, 255, 255, 0.1) 10px,
    rgba(255, 255, 255, 0.1) 20px
  );
  animation: shimmer 20s linear infinite;
}

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

.premium-icon {
  font-size: 48px;
  margin-bottom: 8px;
  animation: bounce 2s ease infinite;
  position: relative;
  z-index: 1;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.premium-modal-header h2 {
  font-family: 'Fredoka One', 'Nunito', sans-serif;
  font-size: 28px;
  color: #5C4033;
  margin: 0 0 8px;
  position: relative;
  z-index: 1;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.5);
}

.premium-subtitle {
  font-size: 15px;
  color: #8B6914;
  margin: 0;
  position: relative;
  z-index: 1;
}

/* Product Selector */
.premium-product-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 20px 24px 16px;
}

.premium-product-option {
  background: white;
  border: 2px solid #E8E8E8;
  border-radius: 16px;
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.premium-product-option:hover {
  border-color: #FFD43B;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 212, 59, 0.3);
}

.premium-product-option.selected {
  border-color: #FF6B9D;
  background: linear-gradient(135deg, #FFF0F3 0%, #FFE4E9 100%);
  box-shadow: 0 4px 16px rgba(255, 107, 157, 0.2);
}

.premium-product-option.featured {
  border-color: #FFD43B;
  background: linear-gradient(135deg, #FFFBEB 0%, #FFF8DC 100%);
}

.premium-product-option.featured.selected {
  border-color: #FF6B9D;
}

.product-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #FF6B9D 0%, #FF8FAB 100%);
  color: white;
  font-size: 10px;
  font-weight: bold;
  padding: 4px 12px;
  border-radius: 12px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(255, 107, 157, 0.4);
}

.product-name {
  font-family: 'Fredoka One', 'Nunito', sans-serif;
  font-size: 14px;
  color: #333;
  margin-bottom: 4px;
}

.product-price {
  font-family: 'Fredoka One', 'Nunito', sans-serif;
  font-size: 28px;
  color: #FF6B9D;
  margin-bottom: 4px;
}

.product-desc {
  font-size: 11px;
  color: #888;
}

/* Payment Container */
.payment-container {
  padding: 0 24px 20px;
  overflow-y: auto;
}

/* Payment Loading State */
.payment-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}

.payment-loading .spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 107, 157, 0.2);
  border-top-color: #FF6B9D;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}

.payment-loading p {
  color: #666;
  font-size: 14px;
  margin: 0;
}

.payment-form {
  width: 100%;
}

.payment-element {
  margin-bottom: 16px;
}

/* Pay Button */
.pay-button {
  width: 100%;
  padding: 16px 24px;
  background: linear-gradient(135deg, #FF6B9D 0%, #FF8FAB 100%);
  color: white;
  border: none;
  border-radius: 14px;
  font-family: 'Fredoka One', 'Nunito', sans-serif;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(255, 107, 157, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
}

.pay-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 157, 0.5);
}

.pay-button:active:not(:disabled) {
  transform: translateY(0);
}

.pay-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.hidden {
  display: none !important;
}

/* Payment Message */
.payment-message {
  text-align: center;
  margin-top: 12px;
  font-size: 14px;
  min-height: 20px;
}

.payment-message.error {
  color: #fa755a;
  background: #FFF0ED;
  padding: 8px 12px;
  border-radius: 8px;
}

.payment-message.success {
  color: #51CF66;
  background: #EBFCEF;
  padding: 12px;
  border-radius: 10px;
  font-weight: 600;
  animation: successPulse 0.5s ease;
}

@keyframes successPulse {
  0% { transform: scale(0.95); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

/* Security Badge */
.premium-security {
  text-align: center;
  padding: 12px 24px 20px;
  font-size: 12px;
  color: #999;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* Ad Banner - Premium Style */
.premium-ad-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #FFE066 0%, #FFD43B 100%);
  padding: 12px 16px;
  z-index: 1000;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  transform: translateY(0);
  transition: transform 0.3s ease;
}

.premium-ad-banner.hidden {
  transform: translateY(100%);
}

.premium-ad-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  max-width: 600px;
  margin: 0 auto;
}

.premium-ad-icon {
  font-size: 24px;
}

.premium-ad-text {
  font-family: 'Fredoka One', sans-serif;
  font-size: 14px;
  color: #5C4033;
}

.premium-ad-button {
  background: white;
  color: #FF6B9D;
  border: none;
  border-radius: 20px;
  padding: 8px 16px;
  font-family: 'Fredoka One', sans-serif;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.premium-ad-button:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Confetti Animation */
.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  animation: confetti-fall 3s ease-out forwards;
}

@keyframes confetti-fall {
  0% {
    transform: translateY(-100px) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* Success Celebration */
.celebration-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  z-index: 10001;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.celebration-overlay.show {
  opacity: 1;
  visibility: visible;
}

.celebration-icon {
  font-size: 80px;
  animation: celebration-bounce 1s ease infinite;
  margin-bottom: 20px;
}

@keyframes celebration-bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

.celebration-text {
  font-family: 'Fredoka One', sans-serif;
  font-size: 32px;
  color: #FF6B9D;
  text-align: center;
}

.celebration-subtext {
  font-size: 18px;
  color: #666;
  margin-top: 8px;
}

/* Responsive */
@media (max-width: 480px) {
  .premium-modal-container {
    width: 95%;
    max-height: 95vh;
  }
  
  .premium-product-selector {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .premium-modal-header h2 {
    font-size: 24px;
  }
  
  .product-price {
    font-size: 24px;
  }
}

/* Premium User - Hide Ads */
body.premium-user .premium-ad-banner,
body.premium-user .ad-banner {
  display: none !important;
}

body.premium-user .game-content {
  padding-bottom: 20px;
}

/* Restore Purchases Link */
.restore-purchases {
  text-align: center;
  padding: 16px 24px 20px;
  font-size: 13px;
  color: #999;
  border-top: 1px dashed rgba(0, 0, 0, 0.08);
  margin-top: 8px;
}

.restore-purchases p {
  margin: 0;
}

.restore-purchases a {
  color: #FF6B9D;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
  border-bottom: 1px dotted #FF6B9D;
}

.restore-purchases a:hover {
  color: #FF4D8D;
  border-bottom-style: solid;
}

/* Restore Modal */
.restore-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.restore-modal.open {
  opacity: 1;
  visibility: visible;
}

.restore-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.restore-modal-container {
  position: relative;
  width: 90%;
  max-width: 380px;
  background: linear-gradient(180deg, #F0F8FF 0%, #E6F3FF 100%);
  border-radius: 24px;
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.5) inset;
  overflow: hidden;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.restore-modal.open .restore-modal-container {
  transform: scale(1) translateY(0);
}

.restore-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  color: #666;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.restore-modal-close:hover {
  background: white;
  color: #333;
  transform: scale(1.1);
}

.restore-modal-header {
  text-align: center;
  padding: 32px 24px 20px;
  background: linear-gradient(135deg, #B8E6FF 0%, #99D6FF 50%, #7AC8FF 100%);
  position: relative;
}

.restore-icon {
  font-size: 40px;
  margin-bottom: 8px;
  animation: sparkle 2s ease infinite;
}

@keyframes sparkle {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.8; }
}

.restore-modal-header h3 {
  font-family: 'Fredoka One', 'Nunito', sans-serif;
  font-size: 24px;
  color: #2C5F7C;
  margin: 0 0 8px;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.5);
}

.restore-subtitle {
  font-size: 14px;
  color: #4A7A99;
  margin: 0;
}

.restore-form-content {
  padding: 24px;
  text-align: center;
}

.restore-text {
  font-size: 15px;
  color: #555;
  margin-bottom: 16px;
  line-height: 1.5;
}

.restore-input {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid #E0E0E0;
  border-radius: 14px;
  font-size: 16px;
  font-family: 'Nunito', sans-serif;
  transition: all 0.2s ease;
  background: white;
  margin-bottom: 16px;
}

.restore-input:focus {
  outline: none;
  border-color: #7AC8FF;
  box-shadow: 0 0 0 4px rgba(122, 200, 255, 0.2);
}

.restore-input::placeholder {
  color: #BBB;
}

.restore-submit-btn {
  width: 100%;
  padding: 14px 24px;
  background: linear-gradient(135deg, #7AC8FF 0%, #5BB5FF 100%);
  color: white;
  border: none;
  border-radius: 14px;
  font-family: 'Fredoka One', 'Nunito', sans-serif;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(122, 200, 255, 0.4);
}

.restore-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(122, 200, 255, 0.5);
}

.restore-submit-btn:active {
  transform: translateY(0);
}

.restore-note {
  font-size: 12px;
  color: #888;
  margin-top: 16px;
  margin-bottom: 0;
  font-style: italic;
}

/* Restore Success Overlay */
.restore-success {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  z-index: 10002;
  display: flex;
  align-items: center;
  justify-content: center;
}

.restore-success.hidden {
  display: none !important;
}

.restore-success-content {
  text-align: center;
  padding: 40px;
  max-width: 400px;
}

.restore-success-icon {
  font-size: 64px;
  margin-bottom: 20px;
  animation: bounce 1s ease infinite;
}

.restore-success-content h3 {
  font-family: 'Fredoka One', 'Nunito', sans-serif;
  font-size: 28px;
  color: #FF6B9D;
  margin: 0 0 12px;
}

.restore-success-content p {
  font-size: 16px;
  color: #666;
  margin-bottom: 24px;
  line-height: 1.5;
}

.restore-close-btn {
  background: linear-gradient(135deg, #FF6B9D 0%, #FF8FAB 100%);
  color: white;
  border: none;
  border-radius: 14px;
  padding: 14px 32px;
  font-family: 'Fredoka One', 'Nunito', sans-serif;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(255, 107, 157, 0.4);
}

.restore-close-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 157, 0.5);
}

/* Responsive for Restore Modal */
@media (max-width: 480px) {
  .restore-modal-container {
    width: 95%;
  }
  
  .restore-modal-header h3 {
    font-size: 22px;
  }
}
