/* KiwiCybermonday v1.2.1 - Styles */

#kcm-overlay { 
  display: none; 
  position: fixed; 
  inset: 0; 
  background: rgba(0, 0, 0, 0.7); 
  z-index: 99998; 
}

#kcm-popup { 
  display: none; 
  position: fixed; 
  inset: 0; 
  z-index: 99999; 
  align-items: center; 
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

#kcm-popup .kcm-box { 
  width: 92%; 
  max-width: 520px; 
  /* glassmorphism-style panel */
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 24px; 
  padding: 24px; 
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2),
              0 8px 16px rgba(0, 0, 0, 0.1);
  margin: 20px auto;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

#kcm-popup .kcm-header { 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  margin-bottom: 16px; 
  padding-bottom: 12px;
  border-bottom: 2px solid #e5e7eb;
}

#kcm-popup .kcm-title { 
  font-size: 22px; 
  font-weight: 700; 
  margin: 0;
  color: #111827;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.05);
}

#kcm-popup .kcm-close { 
  border: none; 
  background: #f3f4f6;
  font-size: 24px; 
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  color: #6b7280;
}

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

#kcm-form { 
  display: grid; 
  gap: 12px; 
  margin-bottom: 16px; 
}

#kcm-form input { 
  width: 100%; 
  padding: 12px 16px; 
  border-radius: 12px; 
  border: 2px solid #e5e7eb;
  font-size: 15px;
  transition: all 0.3s ease;
  background: #ffffff;
}

#kcm-form input:focus {
  outline: none;
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

#kcm-form button { 
  padding: 14px 20px; 
  border: none; 
  border-radius: 12px; 
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #fff; 
  cursor: pointer; 
  font-weight: 600;
  font-size: 16px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

#kcm-form button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

#kcm-form button:active {
  transform: translateY(0);
}

#kcm-form button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

#kcm-canvas-wrap { 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  margin-top: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 16px;
}

#kcm-result { 
  text-align: center; 
  font-weight: 700; 
  margin-top: 20px;
  font-size: 20px;
  color: #4c1d95;
  padding: 20px;
  background: linear-gradient(135deg, #f0abfc 0%, #c084fc 100%);
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(192, 132, 252, 0.3);
  animation: slideIn 0.5s ease;
}

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

.kcm-muted { 
  color: #6b7280; 
  font-size: 13px;
  text-align: center;
  margin-top: 8px;
}

.kcm-hidden {
  display: none !important;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  #kcm-popup .kcm-box {
    padding: 20px;
    border-radius: 20px;
  }
  
  #kcm-popup .kcm-title {
    font-size: 18px;
  }
  
  #kcm-result {
    font-size: 18px;
    padding: 16px;
  }
}

/* v1.2.2 Layout fixes: full visibility & centering */
#kcm-popup{
  padding: 6vh 16px !important;   /* top-bottom margins */
  align-items: center !important;
  justify-content: center !important;
}
#kcm-popup .kcm-box{
  margin: 0 auto !important;
  max-height: 88vh;               /* never overflow viewport */
  overflow: auto;
}
#kcm-canvas-wrap canvas{
  width: 100%;
  height: auto;
  max-width: 360px;               /* keep it reasonable on small screens */
}


/* v1.2.3 viewport fit */
#kcm-popup{ padding: 6dvh 16px !important; }
#kcm-popup .kcm-box{ max-height: 88dvh; overflow: visible; }
#kcm-canvas-wrap{ width: 100%; }
#kcm-canvas-wrap canvas{ width: min(360px, 90%); height: auto; }
@media (max-width: 480px){
  #kcm-popup .kcm-box{ max-height: 90dvh; }
}


/* v1.2.4 layout polish */
#kcm-popup{ padding: 6vh 16px !important; display:flex; align-items:center; justify-content:center; }
#kcm-popup .kcm-box{ margin: 0 auto !important; max-height: 92vh; overflow: hidden; }
#kcm-canvas-wrap{ width: 100%; display:flex; align-items:center; justify-content:center; }
#kcm-canvas-wrap canvas{ width: min(380px, 92%); height: auto; }
@media (max-width: 480px){
  #kcm-popup{ padding: 4vh 12px !important; }
  #kcm-popup .kcm-box{ max-height: 92vh; }
  #kcm-canvas-wrap canvas{ width: min(320px, 94%); }
}
