/* ========================================================
   CocoLuna Saju Master & Coupang Banner Styling
   ======================================================== */

/* Coupang Banner Container */
.cocoluna-coupang-section {
  width: 100%;
  max-width: 1180px;
  margin: 32px auto 24px auto;
  padding: 0 16px;
  box-sizing: border-box;
}

.cocoluna-coupang-card {
  background: linear-gradient(135deg, #fffcfd 0%, #f7f1ff 45%, #f1f6ff 100%);
  border: 1.5px solid #ebdcf8;
  border-radius: 26px;
  padding: 22px 20px 18px 20px;
  box-shadow: 0 12px 36px rgba(115, 81, 182, 0.08);
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.cocoluna-coupang-card:hover {
  box-shadow: 0 16px 44px rgba(115, 81, 182, 0.12);
}

.coupang-card-header {
  margin-bottom: 14px;
}

.coupang-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #f1e4ff;
  color: #7351b6;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 6px;
  letter-spacing: -0.2px;
}

.coupang-card-title {
  font-family: 'Jua', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 22px;
  color: #2f2940;
  margin: 0 0 4px 0;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.coupang-card-subtitle {
  font-size: 13px;
  color: #7a708a;
  margin: 0;
  font-weight: 500;
}

/* Responsive Coupang Iframe Scaler */
.coupang-scaler-outer {
  width: 100%;
  max-width: 640px;
  margin: 12px auto 8px auto;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.coupang-scaler-inner {
  width: 640px;
  height: 140px;
  transform-origin: top center;
  transition: transform 0.2s ease;
}

.coupang-scaler-inner iframe {
  width: 640px;
  height: 140px;
  border: none;
  border-radius: 12px;
  display: block;
}

.coupang-legal-disclaimer {
  font-size: 11.5px;
  color: #9c95a8;
  margin: 8px 0 0 0;
  font-weight: 400;
  letter-spacing: -0.3px;
}

/* ========================================================
   3-Cat Special Masters Section
   ======================================================== */
.special-masters-section {
  width: 100%;
  max-width: 1180px;
  margin: 12px auto 36px auto;
  padding: 0 16px;
  box-sizing: border-box;
}

.special-masters-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  margin-bottom: 20px;
}

.special-masters-kicker {
  color: #8d62d4;
  margin: 0 0 6px 0;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.special-masters-head h2 {
  color: #2f2940;
  margin: 0;
  font-family: 'Jua', sans-serif;
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.special-masters-guide {
  color: #9c95a8;
  margin: 0;
  font-size: 13px;
  font-weight: 800;
}

/* 3-Column Grid */
.special-masters-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

/* Master Card Base */
.special-master-card {
  background: #fbf8ff;
  border: 1px solid #ebdcf5;
  border-radius: 28px;
  padding: 24px 20px 22px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease, border-color 0.25s ease;
  min-height: 380px;
  box-shadow: 0 8px 24px rgba(115, 81, 182, 0.05);
}

/* Slot 1: Active Saju Cat Card */
.special-master-card.active-saju {
  background: linear-gradient(180deg, #fbf7ff 0%, #f4ecff 60%, #eee1ff 100%);
  border: 1.5px solid #c9a7f5;
  box-shadow: 0 12px 32px rgba(115, 81, 182, 0.12);
}

.special-master-card.active-saju:hover {
  transform: translateY(-6px);
  border-color: #8d62d4;
  box-shadow: 0 18px 42px rgba(115, 81, 182, 0.2);
}

/* Card Badge */
.master-card-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 14px;
  letter-spacing: -0.2px;
}

.active-saju .master-card-badge {
  background: linear-gradient(90deg, #ff6b8b, #a05ce0);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(255, 107, 139, 0.35);
  animation: sajuPulse 2.5s infinite;
}

@keyframes sajuPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

.empty-slot .master-card-badge {
  background: #eee8f5;
  color: #9c92aa;
}

/* Avatar Area */
.master-avatar-wrap {
  width: 140px;
  height: 140px;
  margin: 0 auto 16px auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.master-avatar-img {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #ffffff;
  box-shadow: 0 8px 22px rgba(115, 81, 182, 0.18);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.active-saju:hover .master-avatar-img {
  transform: scale(1.08) rotate(-2deg);
}

/* Empty Slot Placeholder Visual */
.empty-avatar-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: #f0e8f7;
  border: 2px dashed #cfc2df;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #9b90aa;
  font-size: 38px;
  user-select: none;
}

/* Master Text Content */
.master-card-name {
  font-family: 'Jua', sans-serif;
  font-size: 22px;
  color: #2f2940;
  margin: 0 0 4px 0;
  font-weight: 900;
}

.master-card-subtitle {
  font-size: 13px;
  color: #8d62d4;
  font-weight: 800;
  margin: 0 0 10px 0;
}

.empty-slot .master-card-subtitle {
  color: #a49cb0;
}

.master-card-desc {
  font-size: 13px;
  color: #5d536c;
  line-height: 1.55;
  margin: 0 0 16px 0;
  flex-grow: 1;
  word-break: keep-all;
}

.empty-slot .master-card-desc {
  color: #9f97aa;
}

/* Tags */
.master-card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 18px;
}

.master-card-tags span {
  font-size: 11.5px;
  color: #7b59b8;
  background: rgba(255, 255, 255, 0.7);
  padding: 3px 10px;
  border-radius: 8px;
  border: 1px solid #e5d7f2;
  font-weight: 700;
}

.empty-slot .master-card-tags span {
  color: #a69eb0;
  background: #f4edf9;
  border-color: #e4dceb;
}

/* Action Buttons */
.master-btn-saju {
  width: 100%;
  padding: 13px 20px;
  background: linear-gradient(135deg, #7e52c8 0%, #a25be5 100%);
  color: #ffffff;
  border: none;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(126, 82, 200, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
}

.master-btn-saju:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(126, 82, 200, 0.42);
  filter: brightness(1.05);
}

.master-btn-saju:active {
  transform: translateY(0);
}

.master-btn-disabled {
  width: 100%;
  padding: 13px 20px;
  background: #ede6f5;
  color: #a49bb0;
  border: none;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: not-allowed;
  font-family: inherit;
}

/* ========================================================
   Saju Interactive Modal
   ======================================================== */
.saju-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(25, 18, 38, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.saju-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.saju-modal-container {
  background: #ffffff;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  border-radius: 30px;
  box-shadow: 0 24px 60px rgba(45, 23, 75, 0.25);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transform: scale(0.92) translateY(12px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1.5px solid #ebdcf5;
}

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

/* Modal Header */
.saju-modal-header {
  background: linear-gradient(135deg, #7c4ec4 0%, #9b5ae4 50%, #f47d9d 100%);
  color: #ffffff;
  padding: 20px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.saju-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.saju-header-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.saju-header-title {
  font-family: 'Jua', sans-serif;
  font-size: 21px;
  margin: 0 0 2px 0;
  letter-spacing: -0.3px;
}

.saju-header-subtitle {
  font-size: 12.5px;
  opacity: 0.92;
  margin: 0;
}

.saju-modal-close {
  background: rgba(255, 255, 255, 0.22);
  border: none;
  color: #ffffff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
}

.saju-modal-close:hover {
  background: rgba(255, 255, 255, 0.38);
  transform: rotate(90deg);
}

/* Modal Body */
.saju-modal-body {
  padding: 22px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex-grow: 1;
}

/* Form Groups */
.saju-form-group {
  margin-bottom: 16px;
}

.saju-form-label {
  display: block;
  font-size: 13.5px;
  font-weight: 800;
  color: #3b324d;
  margin-bottom: 6px;
}

.saju-form-input, .saju-form-select {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1.5px solid #ded5e7;
  font-size: 14px;
  font-family: inherit;
  color: #2f2940;
  background: #fbf9fd;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.saju-form-input:focus, .saju-form-select:focus {
  outline: none;
  border-color: #8d62d4;
  box-shadow: 0 0 0 3px rgba(141, 98, 212, 0.15);
  background: #ffffff;
}

/* Segmented Buttons */
.saju-segment-group {
  display: flex;
  gap: 8px;
}

.saju-segment-btn {
  flex: 1;
  padding: 10px;
  border: 1.5px solid #ded5e7;
  background: #fbf9fd;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 700;
  color: #6a5e7c;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.saju-segment-btn.active {
  background: #7e52c8;
  color: #ffffff;
  border-color: #7e52c8;
  box-shadow: 0 4px 12px rgba(126, 82, 200, 0.25);
}

/* Concern Topic Picker */
.saju-topic-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.saju-topic-card {
  border: 1.5px solid #ded5e7;
  background: #fbf9fd;
  border-radius: 14px;
  padding: 12px 10px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
}

.saju-topic-card:hover {
  border-color: #bfa5e8;
  background: #f8f2ff;
}

.saju-topic-card.active {
  background: #f4ebff;
  border-color: #7e52c8;
  box-shadow: 0 4px 14px rgba(126, 82, 200, 0.18);
}

.saju-topic-icon {
  font-size: 20px;
  margin-bottom: 4px;
}

.saju-topic-title {
  font-size: 13.5px;
  font-weight: 800;
  color: #3b324d;
  margin: 0;
}

.saju-topic-sub {
  font-size: 11px;
  color: #8c819c;
  margin: 2px 0 0 0;
}

/* Submit Button */
.saju-submit-btn {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, #774ec2 0%, #aa5be5 100%);
  color: #ffffff;
  border: none;
  border-radius: 18px;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(126, 82, 200, 0.35);
  transition: transform 0.2s ease, filter 0.2s ease;
  margin-top: 10px;
  font-family: inherit;
}

.saju-submit-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
}

/* Loading State View */
.saju-loading-view {
  text-align: center;
  padding: 40px 16px;
}

.saju-loading-spinner {
  width: 70px;
  height: 70px;
  margin: 0 auto 20px auto;
  border-radius: 50%;
  background: #f2e6ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  animation: sajuCoinSpin 1.8s infinite linear;
}

@keyframes sajuCoinSpin {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.15); }
  100% { transform: rotate(360deg) scale(1); }
}

.saju-loading-title {
  font-family: 'Jua', sans-serif;
  font-size: 20px;
  color: #2f2940;
  margin: 0 0 8px 0;
}

.saju-loading-desc {
  font-size: 13.5px;
  color: #7b6f8a;
  margin: 0;
  line-height: 1.5;
}

/* Result State View */
.saju-result-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.saju-result-header-card {
  background: linear-gradient(135deg, #f7f0ff 0%, #faebf2 100%);
  border: 1.5px solid #ebdcf5;
  border-radius: 20px;
  padding: 16px;
  text-align: center;
}

.saju-user-summary {
  font-size: 14px;
  color: #6a5e7c;
  margin: 0 0 6px 0;
  font-weight: 700;
}

.saju-element-badge {
  display: inline-block;
  background: #7e52c8;
  color: #ffffff;
  font-weight: 800;
  font-size: 15px;
  padding: 6px 18px;
  border-radius: 999px;
  margin-bottom: 8px;
  box-shadow: 0 4px 12px rgba(126, 82, 200, 0.25);
}

.saju-pillars-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}

.saju-pillar-tag {
  background: #ffffff;
  border: 1px solid #e1d3ee;
  border-radius: 10px;
  padding: 4px 10px;
  font-size: 12px;
  color: #4f4362;
  font-weight: 700;
}

/* Savage Punch Card */
.saju-punch-card {
  background: #fff8f8;
  border: 1.5px solid #fcdad9;
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 6px 20px rgba(235, 87, 87, 0.08);
}

.saju-punch-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 900;
  color: #e03131;
  background: #ffe3e3;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.saju-punch-content {
  font-size: 14.5px;
  line-height: 1.7;
  color: #382c2c;
  font-weight: 600;
  margin: 0;
  word-break: keep-all;
}

/* Solution / Tsundere Card */
.saju-solution-card {
  background: #f7f9ff;
  border: 1.5px solid #dce4f8;
  border-radius: 20px;
  padding: 18px;
}

.saju-solution-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 900;
  color: #3b5bdb;
  background: #e7f0ff;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.saju-solution-content {
  font-size: 14.5px;
  line-height: 1.7;
  color: #2b3548;
  font-weight: 500;
  margin: 0;
  word-break: keep-all;
}

/* Lucky Items Grid */
.saju-lucky-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.saju-lucky-item {
  background: #ffffff;
  border: 1px solid #dbe2f4;
  border-radius: 12px;
  padding: 10px 8px;
  text-align: center;
}

.saju-lucky-title {
  font-size: 11px;
  color: #79869f;
  margin: 0 0 2px 0;
  font-weight: 700;
}

.saju-lucky-value {
  font-size: 13px;
  font-weight: 800;
  color: #2b3548;
  margin: 0;
}

/* Modal Bottom Action Row */
.saju-action-row {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.saju-btn-retry {
  flex: 1;
  padding: 13px;
  background: #f1e7fc;
  color: #724db8;
  border: none;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.saju-btn-retry:hover {
  background: #e6d5f7;
}

.saju-btn-share {
  flex: 1;
  padding: 13px;
  background: linear-gradient(135deg, #7c4ec4 0%, #9b5ae4 100%);
  color: #ffffff;
  border: none;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.saju-btn-share:hover {
  filter: brightness(1.06);
}

/* ========================================================
   Responsive Media Queries
   ======================================================== */
@media (max-width: 900px) {
  .special-masters-grid {
    grid-template-columns: 1fr;
    max-width: 440px;
    margin: 0 auto;
  }
  .special-masters-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

@media (max-width: 660px) {
  .coupang-card-title {
    font-size: 19px;
  }
  .coupang-card-subtitle {
    font-size: 12px;
  }
  .coupang-scaler-outer {
    height: calc(140px * (100vw - 64px) / 640);
    min-height: 70px;
  }
  .coupang-scaler-inner {
    transform-origin: top left;
  }
  .saju-modal-container {
    max-height: 94vh;
    border-radius: 24px;
  }
  .saju-topic-grid {
    grid-template-columns: 1fr;
  }
}
