/**
 * Public Styles - DELTRIG YokCash Integration
 * Frontend "Check Name & Buy" UI
 * 
 * @package DELTRIG_YokCash_Integration
 * @since 1.0.0
 */

/* =========================================================
   DELTRIG THEME VARIABLES
   ========================================================= */

:root {
  /* DELTRIG Brand Colors */
  --deltrig-primary: #10B981;
  --deltrig-primary-hover: #059669;
  --deltrig-dark: #065F46;
  --deltrig-darker: #003E29;
  --deltrig-light: #E8FAF4;
  --deltrig-lighter: #D1FAE5;
  
  /* Text & Neutrals */
  --text: #1F2937;
  --text-light: #6B7280;
  --heading: #111827;
  --border: rgba(16, 185, 129, 0.2);
  --overlay: rgba(0, 0, 0, 0.6);

  /* Surfaces */
  --card-bg: rgba(255, 255, 255, 0.98);
  --panel-bg: #F9FAFB;
  --altbox-bg: rgba(255, 255, 255, 0.95);
  --input-bg: #FFFFFF;
  --shadow-1: 0 2px 8px rgba(16, 185, 129, 0.1);
  --shadow-2: 0 8px 24px rgba(0, 0, 0, 0.12);

  /* Accents - DELTRIG Green */
  --accent: var(--deltrig-primary);
  --accent-2: var(--deltrig-primary-hover);
  --accent-border: var(--deltrig-lighter);
  --accent-border-focus: var(--deltrig-primary);
  --accent-focus-ring: rgba(16, 185, 129, 0.2);
  --result: var(--deltrig-primary);
  --brand-link: var(--deltrig-primary);
  --verified: var(--deltrig-primary);

  /* Gradients - DELTRIG */
  --grad-1: linear-gradient(135deg, var(--deltrig-primary), var(--deltrig-primary-hover));
  --grad-2: linear-gradient(135deg, var(--deltrig-primary), var(--deltrig-dark));
}

/* =========================================================
   MAIN WRAPPER
   ========================================================= */

#yokcash-check-buy-wrapper {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 2px solid var(--accent-border);
  border-radius: 12px;
  padding: 24px;
  margin-top: 20px;
  color: var(--text);
  box-shadow: var(--shadow-1);
  transition: box-shadow 0.3s ease-in-out, transform 0.3s ease-in-out, border-color 0.3s ease;
}

#yokcash-check-buy-wrapper:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.15);
  transform: translateY(-2px);
}

#yokcash-check-buy-wrapper.mapped-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-focus-ring), var(--shadow-1);
}

/* Labels */
#yokcash-check-buy-wrapper label {
  display: block;
  margin-bottom: 8px;
  color: var(--deltrig-dark);
  font-weight: 600;
  font-size: 14px;
}

/* =========================================================
   INPUT FIELDS
   ========================================================= */

#yokcash-check-buy-wrapper input[type="text"],
#dyi-uid,
#dyi-zone {
  width: 100%;
  padding: 12px 16px;
  margin: 8px 0;
  border: 2px solid var(--accent-border);
  background: var(--input-bg);
  color: var(--text);
  border-radius: 8px;
  outline: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  font-size: 15px;
  transition: box-shadow 0.2s ease-in-out, border-color 0.2s ease-in-out, transform 0.2s ease-in-out;
}

#yokcash-check-buy-wrapper input[type="text"]::placeholder {
  color: var(--text-light);
  opacity: 0.7;
}

#yokcash-check-buy-wrapper input[type="text"]:focus,
#dyi-uid:focus,
#dyi-zone:focus {
  border-color: var(--accent-border-focus);
  box-shadow: 0 0 0 3px var(--accent-focus-ring);
  transform: translateY(-1px);
}

#yokcash-check-buy-wrapper input[type="text"]:read-only {
  background: var(--panel-bg);
  cursor: not-allowed;
}

/* =========================================================
   PRIMARY BUTTON - Check Name & Buy
   ========================================================= */

#dyi-check-btn {
  background: var(--grad-1);
  color: #fff;
  border: 0;
  padding: 12px 28px;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  font-weight: 700;
  font-size: 16px;
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out, filter 0.2s ease-in-out;
  margin-top: 16px;
  width: 100%;
  letter-spacing: 0.5px;
}

#dyi-check-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
  filter: saturate(1.1);
}

#dyi-check-btn:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

#dyi-check-btn:disabled {
  background: #D1D5DB;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* =========================================================
   IGN RESULT
   ========================================================= */

#dyi-ign-result {
  margin-top: 16px;
  font-size: 15px;
  color: var(--result);
  font-weight: 600;
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--deltrig-light);
  border-left: 4px solid var(--deltrig-primary);
}

#dyi-ign-result:empty {
  display: none;
}

#dyi-ign-result .dyi-error {
  color: #DC2626;
  background: #FEE2E2;
  border-left-color: #EF4444;
}

#dyi-ign-result .dyi-loading {
  color: var(--text-light);
  background: var(--panel-bg);
  border-left-color: var(--text-light);
}

/* =========================================================
   ALT BOX (Alternative styling)
   ========================================================= */

.dyi-check-buy-box {
  background: var(--altbox-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 24px;
  border-radius: 12px;
  border: 2px solid var(--accent-border);
  box-shadow: var(--shadow-1);
  margin-top: 20px;
  text-align: center;
  color: var(--text);
}

.dyi-check-buy-box input {
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 12px;
  border-radius: 8px;
  border: 2px solid var(--accent-border);
  background: var(--input-bg);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  outline: none;
}

.dyi-check-buy-box input:focus {
  border-color: var(--accent-border-focus);
  box-shadow: 0 0 0 3px var(--accent-focus-ring);
}

/* =========================================================
   SECONDARY BUTTON
   ========================================================= */

.dyi-check-btn {
  background: var(--grad-2);
  color: #fff;
  padding: 12px 28px;
  border-radius: 10px;
  font-weight: 700;
  border: 0;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
  transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.dyi-check-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35);
}

/* =========================================================
   MODAL - Confirmation Dialog
   ========================================================= */

#dyi-ign-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--overlay);
  z-index: 99999;
  padding: 20px;
}

#dyi-ign-card {
  width: 92%;
  max-width: 520px;
  border-radius: 16px;
  padding: 28px 32px;
  backdrop-filter: blur(20px) saturate(1.04);
  -webkit-backdrop-filter: blur(20px) saturate(1.04);
  background: var(--card-bg);
  border: 2px solid var(--accent-border);
  box-shadow: var(--shadow-2);
  color: var(--text);
  font-size: 14px;
  position: relative;
  transform: scale(0.88);
  opacity: 0;
}

#dyi-ign-card h3 {
  margin: 0 0 16px;
  font-size: 22px;
  color: var(--heading);
  font-weight: 700;
  text-align: center;
}

/* Modal Panel */
#dyi-ign-card .dyi-panel {
  margin-top: 16px;
  padding: 16px;
  border-radius: 12px;
  background: var(--panel-bg);
  border: 1px solid var(--accent-border);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Modal Rows */
#dyi-ign-card .dyi-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 10px 0;
  gap: 16px;
  color: var(--text);
  font-size: 14px;
}

#dyi-ign-card .dyi-row.dyi-heading {
  justify-content: flex-start;
  font-weight: 700;
  color: var(--deltrig-dark);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

#dyi-ign-card .dyi-row strong {
  color: var(--heading);
}

/* =========================================================
   MODAL ACTIONS (Buttons)
   ========================================================= */

#dyi-ign-card .dyi-actions {
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

#dyi-ign-card button {
  border: 0;
  padding: 12px 24px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  font-size: 15px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#dyi-ign-continue,
.dyi-cta-continue {
  background: var(--grad-1);
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

#dyi-ign-cancel,
.dyi-cta-cancel {
  background: #F3F4F6;
  color: var(--text);
  border: 2px solid var(--accent-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

#dyi-ign-continue:hover,
.dyi-cta-continue:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

#dyi-ign-cancel:hover,
.dyi-cta-cancel:hover {
  transform: translateY(-2px);
  background: #E5E7EB;
}

#dyi-ign-continue:active,
#dyi-ign-cancel:active,
.dyi-cta-continue:active,
.dyi-cta-cancel:active {
  transform: translateY(0);
}

/* =========================================================
   BRAND FOOTER
   ========================================================= */

#dyi-brand {
  margin-top: 20px;
  font-size: 12px;
  opacity: 0.8;
  text-align: center;
  color: var(--text-light);
}

#dyi-brand a {
  color: var(--brand-link);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

#dyi-brand a:hover {
  color: var(--deltrig-dark);
  text-decoration: underline;
}

/* =========================================================
   VERIFIED ICON & LINE
   ========================================================= */

.dyi-ign-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--heading);
}

.dyi-verified-svg {
  width: 20px;
  height: 20px;
  color: var(--verified);
  filter: drop-shadow(0 0 4px rgba(16, 185, 129, 0.3));
}

/* =========================================================
   BUTTON SHINE EFFECT (Subtle)
   ========================================================= */

#dyi-ign-continue::before,
.dyi-cta-continue::before {
  content: "";
  position: absolute;
  top: -120%;
  left: -70%;
  width: 60%;
  height: 300%;
  transform: rotate(25deg);
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.4) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: dyiShine 3s linear infinite;
  pointer-events: none;
}

@keyframes dyiShine {
  0% { left: -70%; }
  100% { left: 130%; }
}

/* =========================================================
   MODAL ENTRANCE ANIMATION
   ========================================================= */

#dyi-ign-modal.dyi-bloom #dyi-ign-card {
  animation: dyiBloomIn 420ms cubic-bezier(0.2, 0.9, 0.2, 1.02) forwards;
}

@keyframes dyiBloomIn {
  0% {
    transform: scale(0.88);
    opacity: 0;
    filter: saturate(0.98);
  }
  60% {
    transform: scale(1.02);
    opacity: 1;
    filter: saturate(1.02);
  }
  100% {
    transform: scale(1.0);
    opacity: 1;
  }
}

/* =========================================================
   FOCUS RINGS (Accessibility)
   ========================================================= */

#dyi-ign-card button:focus,
#dyi-check-btn:focus,
.dyi-check-btn:focus,
#yokcash-check-buy-wrapper input[type="text"]:focus {
  outline: 3px solid var(--accent-focus-ring);
  outline-offset: 2px;
}

/* =========================================================
   BODY LOCK (Prevent scrolling when modal open)
   ========================================================= */

html.dyi-lock,
body.dyi-lock {
  overflow: hidden !important;
}

/* =========================================================
   RESPONSIVE DESIGN
   ========================================================= */

@media (max-width: 768px) {
  #yokcash-check-buy-wrapper {
    padding: 20px;
  }

  #dyi-ign-card {
    width: 95%;
    padding: 24px 20px;
  }

  #dyi-ign-card h3 {
    font-size: 20px;
  }

  #dyi-ign-card .dyi-actions {
    flex-direction: column;
    width: 100%;
  }

  #dyi-ign-card button {
    width: 100%;
  }

  #dyi-check-btn {
    padding: 14px 24px;
    font-size: 15px;
  }
}

@media (max-width: 480px) {
  #yokcash-check-buy-wrapper {
    padding: 16px;
  }

  #dyi-ign-card {
    padding: 20px 16px;
  }

  #dyi-ign-card .dyi-row {
    font-size: 13px;
    gap: 12px;
  }

  #dyi-ign-card h3 {
    font-size: 18px;
  }
}

/* =========================================================
   LOADING STATE
   ========================================================= */

.dyi-loading {
  opacity: 0.6;
  pointer-events: none;
}

.dyi-loading::after {
  content: "...";
  animation: dyiLoadingDots 1.2s infinite;
}

@keyframes dyiLoadingDots {
  0%, 20% { content: "."; }
  40% { content: ".."; }
  60%, 100% { content: "..."; }
}

/* =========================================================
   ERROR STATE
   ========================================================= */

.dyi-error {
  color: #DC2626;
  background: #FEE2E2;
  padding: 12px 16px;
  border-radius: 8px;
  border-left: 4px solid #EF4444;
  font-weight: 600;
}