/* Common styles for 퀀텀사주 profile pages */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #F2EDE4;
  color: #333;
}

a {
  text-decoration: none;
  color: inherit;
}

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

/* ── Layout ── */
.container {
  max-width: 500px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #F2EDE4;
}

.header {
  padding: 16px;
  border-bottom: 1px solid #ddd;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
}

.header-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.header-back {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  color: #999;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-back:hover {
  color: #666;
}

.content {
  flex: 1;
  padding: 20px 16px;
  overflow-y: auto;
}

/* ── Login Screen ── */
.login-screen {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

.login-box {
  width: 100%;
  max-width: 360px;
  background: #fff;
  border-radius: 12px;
  padding: 40px 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.login-box-title {
  font-size: 32px;
  text-align: center;
  margin-bottom: 8px;
}

.login-box-subtitle {
  text-align: center;
  color: #999;
  font-size: 14px;
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 12px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #666;
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus {
  border-color: #6A1B9A;
}

.form-error {
  color: #e53e3e;
  font-size: 12px;
  min-height: 16px;
  margin-top: 4px;
}

.login-button {
  width: 100%;
  padding: 12px;
  background: #6A1B9A;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 16px;
  transition: background 0.2s;
  font-family: inherit;
}

.login-button:hover:not(:disabled) {
  background: #5a1580;
}

.login-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.login-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: #999;
}

.login-footer-link {
  color: #6A1B9A;
  text-decoration: none;
  font-weight: 500;
}

.login-footer-link:hover {
  text-decoration: underline;
}

/* ══════════════════════════════════════════════════════
   profile_main.html — Profile Header Row
   ══════════════════════════════════════════════════════ */
.profile-row {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6A1B9A 0%, #8B5CF6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 22px;
  font-weight: 700;
}

.avatar-pro-badge {
  position: absolute;
  bottom: -2px;
  right: -4px;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 8px;
  border: 2px solid #fff;
  line-height: 1;
}

.profile-info {
  flex: 1;
  min-width: 0;
}

.profile-name {
  font-size: 17px;
  font-weight: 700;
  color: #333;
  margin-bottom: 2px;
}

.profile-username {
  font-size: 13px;
  color: #999;
}

.profile-edit-btn {
  background: none;
  border: 1px solid #ddd;
  color: #666;
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  flex-shrink: 0;
}

.profile-edit-btn:hover {
  border-color: #6A1B9A;
  color: #6A1B9A;
}

/* ══════════════════════════════════════════════════════
   profile_main.html — Subscription / Cookie Card
   ══════════════════════════════════════════════════════ */

/* PRO 카드 */
.sub-card.pro {
  background: linear-gradient(135deg, #6A1B9A 0%, #8B5CF6 100%);
  color: #fff;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.sub-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.sub-plan {
  font-size: 15px;
  font-weight: 700;
}

.sub-expires {
  font-size: 11px;
  opacity: 0.85;
  margin-top: 2px;
}

.sub-divider {
  width: 1px;
  height: 36px;
  background: rgba(255,255,255,0.3);
}

.sub-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sub-cookie-count {
  font-size: 16px;
  font-weight: 700;
}

/* FREE 카드 */
.sub-card.free {
  background: #fff;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 12px;
  border: 1px solid #eee;
}

.sub-free-row {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 12px;
}

.sub-free-item {
  flex: 1;
  text-align: center;
}

.sub-free-label {
  font-size: 11px;
  color: #999;
  margin-bottom: 4px;
}

.sub-free-value {
  font-size: 18px;
  font-weight: 700;
}

.sub-free-divider {
  width: 1px;
  height: 36px;
  background: #eee;
}

.sub-upgrade-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  background: #f8f4fc;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #6A1B9A;
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
}

.sub-upgrade-btn:hover {
  background: #f0e8f7;
}

/* ══════════════════════════════════════════════════════
   profile_main.html — Menu Card
   ══════════════════════════════════════════════════════ */
.menu-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 12px;
}

.menu-item {
  padding: 15px 16px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
  color: inherit;
}

.menu-item:last-child {
  border-bottom: none;
}

.menu-item:hover {
  background: #faf9f7;
}

.menu-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.menu-icon {
  font-size: 18px;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}

.menu-label {
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

.menu-arrow {
  color: #ccc;
  font-size: 18px;
  flex-shrink: 0;
}

.menu-item.logout .menu-label {
  color: #e53e3e;
}

.menu-item.logout .menu-arrow {
  color: #e53e3e;
  opacity: 0.4;
}

/* ══════════════════════════════════════════════════════
   profile_main.html — Withdraw
   ══════════════════════════════════════════════════════ */
.withdraw-wrap {
  text-align: center;
  padding: 16px 0 32px;
}

.withdraw-btn {
  background: none;
  border: none;
  color: #bbb;
  font-size: 13px;
  cursor: pointer;
  transition: color 0.2s;
  font-family: inherit;
  text-decoration: underline;
}

.withdraw-btn:hover {
  color: #e53e3e;
}

/* ══════════════════════════════════════════════════════
   cookie_store.html — Store Status
   ══════════════════════════════════════════════════════ */
.store-status {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 0;
}

.store-status-item {
  flex: 1;
  text-align: center;
}

.store-status-label {
  font-size: 12px;
  color: #999;
  margin-bottom: 6px;
}

.store-status-value {
  font-size: 20px;
  font-weight: 700;
}

.store-status-divider {
  width: 1px;
  height: 40px;
  background: #eee;
}

/* cookie_store.html — Notice */
.store-notice {
  background: #fff;
  border-radius: 12px;
  padding: 28px 20px;
  margin-bottom: 16px;
  text-align: center;
}

.store-notice-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.store-notice-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
}

.store-notice-desc {
  font-size: 13px;
  color: #888;
  line-height: 1.6;
}

/* cookie_store.html — Store Link Buttons */
.store-links {
  display: flex;
  gap: 10px;
}

.store-link-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 12px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  text-decoration: none;
  color: #333;
  transition: all 0.2s;
}

.store-link-btn:hover {
  border-color: #6A1B9A;
  background: #faf6ff;
}

/* ══════════════════════════════════════════════════════
   notices.html — Notice Cards
   ══════════════════════════════════════════════════════ */
.notice-card {
  background: #fff;
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 12px;
}

.notice-date {
  font-size: 12px;
  color: #999;
  margin-bottom: 6px;
}

.notice-title {
  font-size: 15px;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
}

.notice-content {
  font-size: 13px;
  color: #666;
  line-height: 1.7;
}

/* ══════════════════════════════════════════════════════
   Saju Section (사주 팔자 표시)
   ══════════════════════════════════════════════════════ */
.saju-section {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}

.section-title {
  font-size: 14px;
  font-weight: 700;
  color: #333;
  margin-bottom: 16px;
}

.saju-pillars {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 12px;
}

.pillar {
  text-align: center;
}

.pillar-label {
  font-size: 11px;
  color: #999;
  margin-bottom: 4px;
}

.pillar-box {
  aspect-ratio: 1;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: #fff;
  font-weight: 700;
  margin-bottom: 4px;
}

.pillar-gan { font-size: 14px; }
.pillar-ji { font-size: 14px; }

.element-color-목 { background: #4CAF50; }
.element-color-화 { background: #F44336; }
.element-color-토 { background: #FFC107; }
.element-color-금 { background: #9E9E9E; }
.element-color-수 { background: #2196F3; }

.pillar-element {
  font-size: 10px;
  opacity: 0.9;
  margin-top: 2px;
}

.saju-empty {
  text-align: center;
  color: #999;
  font-size: 13px;
  padding: 20px;
}

/* ══════════════════════════════════════════════════════
   Toast Notifications
   ══════════════════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 13px;
  z-index: 2000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: toastIn 0.3s ease;
  max-width: 320px;
  text-align: center;
}

.toast.error {
  background: #e53e3e;
  color: #fff;
}

.toast.success {
  background: #38a169;
  color: #fff;
}

@keyframes toastIn {
  from {
    transform: translateX(-50%) translateY(16px);
    opacity: 0;
  }
  to {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

/* ══════════════════════════════════════════════════════
   Loader
   ══════════════════════════════════════════════════════ */
.loader {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #6A1B9A;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ══════════════════════════════════════════════════════
   Utility Classes
   ══════════════════════════════════════════════════════ */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

/* ══════════════════════════════════════════════════════
   Mobile Responsive
   ══════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .container {
    max-width: 100%;
  }

  .header {
    padding: 12px;
  }

  .content {
    padding: 12px;
  }

  .login-box {
    padding: 24px 16px;
  }

  .profile-row {
    padding: 16px;
  }

  .avatar {
    width: 48px;
    height: 48px;
    font-size: 18px;
  }

  .store-links {
    flex-direction: column;
  }

  .store-link-btn {
    width: 100%;
  }

  .toast {
    left: 12px;
    right: 12px;
    max-width: none;
    transform: none;
  }

  @keyframes toastIn {
    from {
      transform: translateY(16px);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }
}
