/* マイページ - プロフィール編集タブ専用CSS（Instagram風リデザイン） */

/* =========================
   プロフィールカード
========================= */
.profile-card {
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.profile-top-row {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 18px 20px;
}

.profile-section-divider {
  height: 1px;
  background: rgba(226, 232, 240, 0.9);
  margin: 6px 0 14px;
}

.profile-avatar-section {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
}

.avatar-preview-container {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-preview-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.avatar-preview-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(94, 200, 216, 0.1), rgba(143, 140, 243, 0.08));
  border-radius: 50%;
  border: 3px solid white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.avatar-placeholder-icon {
  font-size: 40px;
  opacity: 0.6;
}

.avatar-change-btn {
  position: absolute;
  bottom: -6px;
  right: -6px;
  background: white;
  border: 2px solid rgba(94, 200, 216, 0.3);
  border-radius: 16px;
  padding: 4px 10px;
  font-size: var(--fs-12);
  font-weight: 600;
  color: rgba(94, 200, 216, 0.9);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.avatar-change-btn:hover {
  background: rgba(94, 200, 216, 0.05);
  border-color: rgba(94, 200, 216, 0.5);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

/* =========================
   フォームスタイル
========================= */
.profile-edit-form {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-edit-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-edit-label {
  font-size: var(--fs-13);
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: 0.01em;
}

.profile-edit-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  font-size: var(--fs-14);
  background: white;
  color: var(--text-main);
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.profile-edit-input::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

.profile-edit-input:hover {
  border-color: rgba(0, 0, 0, 0.2);
}

.profile-edit-input:focus {
  border-color: var(--mint);
  box-shadow: 0 0 0 3px rgba(94, 200, 216, 0.08);
}

.profile-edit-input:disabled {
  background: rgba(0, 0, 0, 0.02);
  color: var(--text-muted);
  cursor: not-allowed;
}

.profile-edit-note {
  margin-top: 4px;
  padding: 12px;
  background: rgba(94, 200, 216, 0.04);
  border-radius: 8px;
  border-left: 3px solid rgba(94, 200, 216, 0.3);
}

.profile-edit-note span {
  font-size: var(--fs-12);
  color: var(--text-sub);
  line-height: 1.5;
}

.profile-edit-actions {
  margin-top: 4px;
}

.btn-save-profile {
  width: auto;
  padding: 6px 14px;
  border: none;
  border-radius: 8px;
  font-size: var(--fs-12);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  background: linear-gradient(135deg, var(--mint), rgba(143, 140, 243, 0.9));
  color: white;
  box-shadow: 0 2px 8px rgba(94, 200, 216, 0.2);
}

.btn-save-profile:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(94, 200, 216, 0.35);
}

.btn-save-profile:active {
  transform: translateY(0);
}

.btn-save-profile:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* =========================
   ポイントカード
========================= */
.points-card {
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.points-theme-card .points-display {
  padding: 24px 24px 18px;
}

.points-theme-divider {
  height: 1px;
  background: rgba(226, 232, 240, 0.9);
  margin: 4px 0 16px;
}

.theme-section {
  padding: 0 4px 8px;
}

.points-display {
  padding: 32px 24px;
  text-align: center;
  position: relative;
}

.points-header {
  margin-bottom: 24px;
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(94, 200, 216, 0.12), rgba(143, 140, 243, 0.1));
  transition: all 0.3s ease;
}

.rank-badge.rank-level-1 {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.02));
}

.rank-badge.rank-level-2 {
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.12), rgba(255, 193, 7, 0.08));
}

.rank-badge.rank-level-3 {
  background: linear-gradient(135deg, rgba(33, 150, 243, 0.12), rgba(33, 150, 243, 0.08));
}

.rank-badge.rank-level-4 {
  background: linear-gradient(135deg, rgba(156, 39, 176, 0.12), rgba(156, 39, 176, 0.08));
}

.rank-badge.rank-level-5 {
  background: linear-gradient(135deg, rgba(233, 30, 99, 0.12), rgba(233, 30, 99, 0.08));
}

.rank-badge.rank-level-6 {
  background: linear-gradient(135deg, rgba(94, 200, 216, 0.2), rgba(143, 140, 243, 0.15));
  box-shadow: 0 2px 8px rgba(94, 200, 216, 0.2);
}

.rank-badge.rank-level-7 {
  background: linear-gradient(135deg, rgba(94, 200, 216, 0.3), rgba(143, 140, 243, 0.25));
  box-shadow: 0 4px 12px rgba(94, 200, 216, 0.3);
  animation: sparkle 2s ease-in-out infinite;
}

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

.rank-icon {
  font-size: 20px;
  line-height: 1;
}

.rank-name {
  font-size: var(--fs-14);
  font-weight: 600;
  color: var(--text-main);
}

.points-main {
  margin-bottom: 20px;
}

.points-value {
  font-size: var(--fs-36);
  font-weight: 700;
  color: var(--mint);
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

.points-label {
  font-size: var(--fs-13);
  color: var(--text-sub);
  font-weight: 500;
}

.rank-progress {
  width: 100%;
  max-width: 320px;
  margin: 0 auto 16px;
}

.rank-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}

.rank-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--mint), var(--lavender));
  border-radius: 999px;
  transition: width 0.5s ease;
}

.rank-progress-text {
  font-size: var(--fs-11);
  color: var(--text-muted);
  text-align: center;
  line-height: 1.4;
}

.points-description {
  font-size: var(--fs-12);
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 8px;
}

/* =========================
   テーマ選択
========================= */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.theme-item {
  position: relative;
  border-radius: 12px;
  padding: 0;
  border: 2px solid rgba(0, 0, 0, 0.08);
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
  overflow: hidden;
}

.theme-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: rgba(0, 0, 0, 0.12);
}

.theme-item.active {
  border-color: var(--mint);
  box-shadow: 0 0 0 3px rgba(94, 200, 216, 0.15);
}

.theme-item.locked {
  opacity: 0.6;
  cursor: not-allowed;
}

.theme-item.locked:hover {
  transform: none;
  box-shadow: none;
}

.theme-preview {
  width: 100%;
  height: 100px;
  border-radius: 10px 10px 0 0;
  margin-bottom: 0;
  background: radial-gradient(circle at 0% 0%, var(--theme-bg-start, #fdf2ff), transparent 60%),
              radial-gradient(circle at 100% 0%, var(--theme-bg-mid, #e4f4ff), transparent 60%),
              radial-gradient(circle at 50% 100%, var(--theme-bg-end, #fbe9f1), #f5f7ff 70%);
}

.theme-item-content {
  padding: 12px;
}

.theme-name {
  font-size: var(--fs-13);
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
}

.theme-cost {
  font-size: var(--fs-11);
  color: var(--text-muted);
}

.theme-lock-icon {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: var(--fs-14);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* =========================
   レスポンシブ
========================= */
@media (max-width: 1024px) {
  .theme-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
  }
}

/* スマホ版（768px以下）の最適化 */
@media (max-width: 768px) {
  .profile-top-row {
    flex-direction: column;
    align-items: stretch;
    padding: 16px 16px 18px;
    gap: 12px;
  }

  .profile-section-divider {
    margin: 4px 0 12px;
  }

  .profile-avatar-section {
    justify-content: flex-end;
  }

  .avatar-preview-container {
    width: 84px;
    height: 84px;
  }

  .avatar-placeholder-icon {
    font-size: 34px;
  }

  .avatar-change-btn {
    bottom: -5px;
    right: -5px;
    padding: 4px 8px;
    font-size: var(--fs-11);
  }

  .profile-edit-form {
    gap: 10px;
  }

  .profile-edit-field {
    gap: 6px;
  }

  .profile-edit-label {
    font-size: var(--fs-12);
  }

  .profile-edit-input {
    padding: 10px 14px;
    font-size: var(--fs-13);
  }

  .profile-edit-note {
    padding: 10px;
  }

  .profile-edit-note span {
    font-size: var(--fs-11);
  }

  .btn-save-profile {
    padding: 6px 12px;
    font-size: var(--fs-12);
  }

  .points-display {
    padding: 24px 20px;
  }

  .points-theme-card .points-display {
    padding: 20px 18px 14px;
  }

  .points-theme-divider {
    margin: 4px 0 12px;
  }

  .theme-section {
    padding: 0 2px 6px;
  }

  .points-header {
    margin-bottom: 20px;
  }

  .rank-badge {
    padding: 6px 14px;
    gap: 6px;
  }

  .rank-icon {
    font-size: 18px;
  }

  .rank-name {
    font-size: var(--fs-13);
  }

  .points-main {
    margin-bottom: 16px;
  }

  .points-value {
    font-size: var(--fs-28);
  }

  .points-label {
    font-size: var(--fs-12);
  }

  .rank-progress {
    max-width: 280px;
    margin-bottom: 12px;
  }

  .rank-progress-text {
    font-size: var(--fs-11);
  }

  .points-description {
    font-size: var(--fs-11);
    margin-top: 6px;
  }

  .theme-grid {
    gap: 10px;
    margin-top: 12px;
  }

  .theme-preview {
    height: 80px;
  }

  .theme-item-content {
    padding: 10px;
  }

  .theme-name {
    font-size: var(--fs-12);
  }

  .theme-cost {
    font-size: var(--fs-11);
  }
}

/* =========================
   LINE連携カード
========================= */
.line-link-card {
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.profile-line-link {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

.profile-line-link .line-link-header {
  padding: 0 4px 12px;
  border-bottom: none;
}

.profile-line-link .line-link-content {
  padding: 0 4px 6px;
}

.profile-line-link .line-link-description {
  margin-bottom: 14px;
}

.profile-line-link .btn-generate-link-code,
.profile-line-link .btn-regenerate-code {
  width: auto;
  padding: 8px 16px;
  font-size: var(--fs-12);
  box-shadow: 0 2px 6px rgba(6, 199, 85, 0.18);
}

.line-link-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.line-link-title {
  font-size: var(--fs-16);
  font-weight: 600;
  color: var(--text-main);
  margin: 0;
}

.line-link-status {
  display: flex;
  align-items: center;
}

.line-link-badge {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: var(--fs-12);
  font-weight: 600;
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-sub);
}

.line-link-badge.linked {
  background: linear-gradient(135deg, rgba(0, 200, 83, 0.15), rgba(0, 200, 83, 0.1));
  color: #00c853;
}

.line-login-badge {
  margin-left: 8px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: var(--fs-11);
  font-weight: 600;
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-sub);
}

.line-link-content {
  padding: 24px;
}

.line-link-description {
  font-size: var(--fs-14);
  color: var(--text-sub);
  line-height: 1.6;
  margin-bottom: 20px;
}

.btn-generate-link-code,
.btn-regenerate-code {
  width: 100%;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: var(--fs-14);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  background: linear-gradient(135deg, #06c755, #00b04f);
  color: white;
  box-shadow: 0 2px 8px rgba(6, 199, 85, 0.25);
}

.btn-generate-link-code:hover,
.btn-regenerate-code:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(6, 199, 85, 0.35);
}

.btn-generate-link-code:active,
.btn-regenerate-code:active {
  transform: translateY(0);
}

.btn-generate-link-code:disabled,
.btn-regenerate-code:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.link-code-box {
  background: linear-gradient(135deg, rgba(6, 199, 85, 0.08), rgba(0, 176, 79, 0.06));
  border: 2px solid rgba(6, 199, 85, 0.2);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  margin-bottom: 16px;
  position: relative;
}

.link-code-label {
  font-size: var(--fs-12);
  color: var(--text-sub);
  margin-bottom: 12px;
  font-weight: 600;
}

.link-code-value {
  font-size: var(--fs-32);
  font-weight: 700;
  color: #06c755;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
  font-family: 'Courier New', monospace;
}

.btn-copy-code {
  padding: 8px 16px;
  border: 1px solid rgba(6, 199, 85, 0.3);
  border-radius: 6px;
  font-size: var(--fs-12);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  background: white;
  color: #06c755;
}

.btn-copy-code:hover {
  background: rgba(6, 199, 85, 0.05);
  border-color: rgba(6, 199, 85, 0.5);
}

.link-code-expires {
  text-align: center;
  font-size: var(--fs-12);
  color: var(--text-muted);
  margin-bottom: 20px;
}

.link-code-instructions {
  margin-bottom: 20px;
}

.link-code-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: step-counter;
}

.link-code-steps li {
  counter-increment: step-counter;
  padding: 12px 0 12px 32px;
  font-size: var(--fs-14);
  color: var(--text-main);
  line-height: 1.6;
  position: relative;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.link-code-steps li:last-child {
  border-bottom: none;
}

.link-code-steps li::before {
  content: counter(step-counter);
  position: absolute;
  left: 0;
  top: 12px;
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, var(--mint), rgba(143, 140, 243, 0.9));
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-12);
  font-weight: 600;
}

.line-link-linked {
  text-align: center;
  padding: 20px 0;
}

.line-link-success-message {
  font-size: var(--fs-16);
  font-weight: 600;
  color: #00c853;
  margin-bottom: 12px;
}

.line-link-info {
  font-size: var(--fs-14);
  color: var(--text-sub);
  line-height: 1.6;
}

/* レスポンシブ */
@media (max-width: 768px) {
  .line-link-header {
    padding: 16px 20px;
  }

  .line-link-content {
    padding: 20px;
  }

  .profile-line-link .line-link-header {
    padding: 0 2px 10px;
  }

  .profile-line-link .line-link-content {
    padding: 0 2px 4px;
  }

  .link-code-box {
    padding: 20px;
  }

  .link-code-value {
    font-size: var(--fs-28);
  }

  .link-code-steps li {
    padding-left: 28px;
    font-size: var(--fs-13);
  }

  .link-code-steps li::before {
    width: 20px;
    height: 20px;
    font-size: var(--fs-11);
  }
}