/*
 * WPCNY Border Upload – Frontend styles
 * Version: 0.0.2
 */

/* ===== WPCNY Border Upload (UI) ===== */
.custom-border{ margin-top:10px; padding:0 6px; }
.custom-border-showbtn{
  display:flex; align-items:center; gap:8px;
  padding:7px 10px;
  border:1px solid #e7e7e7;
  border-radius:12px;
  background:#fafafa;
  cursor:pointer;
  user-select:none;
}
/* Use pure CSS chevron so themes can't hide <img> */
.custom-border-showbtn .wpcny-chevron{
  margin-left:auto;
  width:10px;
  height:10px;
  border-right:2px solid rgba(0,0,0,.45);
  border-bottom:2px solid rgba(0,0,0,.45);
  transform:rotate(45deg);
  transition:transform .2s ease;
  flex:0 0 auto;
}
.custom-border-showbtn.is-open .wpcny-chevron{ transform:rotate(-135deg); }
.custom-border-showbtn .title{
  font-weight:800;
  letter-spacing:.1px;
  white-space:nowrap;
  line-height:1.1;
  font-size:15px;
  flex:1 1 auto;
  min-width:0;
}
.custom-content{ display:none; margin-top:10px; }
.custom-content.is-open{ display:block; }

.wpcny-upload-card{
  border:1px solid #ededed;
  border-radius:16px;
  background:#fff;
  padding:14px;
  box-shadow:0 8px 24px rgba(0,0,0,.04);
}
.wpcny-upload-head{ margin-bottom:10px; }
.wpcny-upload-head .h1{ font-size:16px; font-weight:800; margin:0 0 2px; }
.wpcny-upload-head .h2{ font-size:13px; color:#444; font-weight:800; margin:0 0 6px; line-height:1.25; }
.wpcny-upload-head .p{ font-size:12px; color:#666; margin:0 0 10px; line-height:1.45; }
.wpcny-bullets{ margin:0; padding:0 0 0 18px; color:#555; font-size:12px; line-height:1.45; }
.wpcny-bullets li{ margin:6px 0; }
.wpcny-bullets a{ color:#111; text-decoration:underline; }

.wpcny-upload-grid{ display:flex; gap:12px; align-items:stretch; }
.wpcny-preview{
  width:132px; min-width:132px;
  border-radius:14px;
  border:1px dashed #dcdcdc;
  background:#fafafa;
  display:flex; align-items:center; justify-content:center;
  position:relative;
  overflow:hidden;
}
.wpcny-preview img{ width:100%; height:100%; object-fit:cover; display:none; }
.wpcny-preview .ph{ padding:10px; text-align:center; font-size:12px; color:#888; line-height:1.25; }

.wpcny-actions{ flex:1; display:flex; flex-direction:column; gap:8px; }
.wpcny-btn{
  position:relative;
  display:inline-flex; align-items:center; justify-content:center;
  gap:8px;
  height:40px;
  padding:0 14px;
  border-radius:12px;
  border:1px solid #d9d9d9;
  background:#ededed;
  color:#222;
  font-weight:800;
  cursor:pointer;
  box-shadow:0 6px 16px rgba(0,0,0,.06);
}
.wpcny-btn:active{ transform:translateY(1px); }
.wpcny-btn.small{ height:34px; padding:0 12px; font-weight:700; }
.wpcny-btn.secondary{ background:#f7f7f7; }
.wpcny-actions-row{ display:none; gap:8px; flex-wrap:wrap; }
.wpcny-help{ font-size:12px; color:#777; }
.wpcny-status{ font-size:12px; color:#b00020; min-height:16px; }
.wpcny-status.ok{ color:#0b7a2b; }

/* Light sweep animation */
@media (prefers-reduced-motion: no-preference){
  .wpcny-btn.shine{ overflow:hidden; }
  .wpcny-btn.shine::after{
    content:"";
    position:absolute;
    top:-60%;
    left:-40%;
    width:30%;
    height:220%;
    background: linear-gradient(120deg,
      rgba(255,255,255,0) 0%,
      rgba(255,255,255,.60) 48%,
      rgba(255,255,255,0) 100%);
    transform: rotate(20deg);
    pointer-events:none;
    animation: wpcny_shine 2s ease-in-out infinite;
  }
  @keyframes wpcny_shine{
    0%   { transform: translateX(-140%) rotate(20deg); opacity: 0; }
    10%  { opacity: 1; }
    50%  { transform: translateX(520%) rotate(20deg); opacity: 0; }
    100% { transform: translateX(520%) rotate(20deg); opacity: 0; }
  }
}

.border-remark label{ display:block; margin-top:12px; margin-bottom:6px; font-size:13px; font-weight:800; }
.border-remark #border-remark-text{
  width:100%;
  margin-top:0;
  min-height:78px;
  border:1px solid #e3e3e3;
  border-radius:12px;
  padding:10px 12px;
  background:#fafafa;
}
.wpcny-note-hint{ margin-top:6px; font-size:12px; color:#777; }

.wpcny-copy{
  margin-top:10px;
  border:1px solid #efefef;
  border-radius:12px;
  padding:10px 12px;
  background:#fcfcfc;
}

/* Upload overlay on main image box */
.upload-loading{
  position:absolute;
  width:100%;
  height:100%;
  top:0;
  left:0;
  background:rgba(0,0,0,0.65);
  display:none;
  justify-content:center;
  align-items:center;
  z-index:9;
}
.upload-loading .text{
  color:#fff;
  font-size:14px;
  font-weight:800;
  display:flex;
  align-items:center;
  gap:10px;
}
.upload-loading .spinner{
  width:18px;
  height:18px;
  border-radius:50%;
  border:2px solid rgba(255,255,255,.35);
  border-top-color:#fff;
  animation:wpcny_spin .9s linear infinite;
}
@keyframes wpcny_spin{ to{ transform:rotate(360deg);} }

@media (max-width: 680px){
  .wpcny-upload-grid{ flex-direction:column; }
  .wpcny-preview{ width:100%; min-width:unset; height:160px; }
  .custom-border-showbtn{ padding:7px 10px; }
  .custom-border-showbtn .title{ font-size:13px; }
}
