/* ============================================================
   Custom Mood & Tone Theme:
   #363051 (Deep Twilight Indigo)
   #E693DA (Pastel Neon Orchid)
   #B49CD8 (Muted Soft Lavender)
   #AAD3F4 (Pastel Sky Cyan)
   ============================================================ */

:root {
  /* User Color Palette */
  --c-twilight: #363051;
  --c-orchid: #E693DA;
  --c-lavender: #B49CD8;
  --c-sky: #AAD3F4;

  /* Theme tokens */
  --bg-primary: #151322;
  --card-bg: rgba(54, 48, 81, 0.45);
  --card-border: rgba(180, 156, 216, 0.28);
  --accent-color: #E693DA;
  --accent-hover: #ffb4f6;
  --accent-secondary: #B49CD8;
  --accent-cool: #AAD3F4;
  --text-main: #fbfbfe;
  --text-muted: #B49CD8;

  --radius-lg: 24px;
  --radius-sm: 12px;
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: 'Outfit', 'Noto Sans Thai', sans-serif;
  background-color: var(--bg-primary);
  background-image: radial-gradient(at 10% 20%, rgba(54, 48, 81, 0.7) 0px, transparent 50%),
    radial-gradient(at 90% 85%, rgba(170, 211, 244, 0.08) 0px, transparent 50%);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 50px 20px 24px;
  position: relative;
  overflow-x: hidden;
}

/* เอฟเฟกต์แสงไฟเรืองแสงด้านหลัง (Dual Glow: Orchid & Sky) */
.bg-glow {
  position: fixed;
  top: -15%;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(230, 147, 218, 0.16) 0%, rgba(170, 211, 244, 0.06) 45%, rgba(21, 19, 34, 0) 70%);
  z-index: -1;
  pointer-events: none;
}

.container {
  width: 100%;
  max-width: 540px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  z-index: 1;
}

/* กล่องโปรไฟล์หลัก (Glassmorphism ด้วยเฉดสี #363051) */
.profile-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  padding: 40px 28px;
  text-align: center;
  box-shadow: 0 16px 40px rgba(15, 12, 26, 0.5),
    0 0 0 1px rgba(230, 147, 218, 0.08) inset;
  animation: fadeIn 0.6s ease-out;
}

/* กรอบรูป Avatar ประกาย Orchid & Sky */
.avatar-wrapper {
  width: 116px;
  height: 116px;
  border-radius: 50%;
  margin: 0 auto 20px;
  border: 2px solid var(--c-orchid);
  padding: 4px;
  background: linear-gradient(135deg, rgba(230, 147, 218, 0.25), rgba(170, 211, 244, 0.2));
  overflow: hidden;
  box-shadow: 0 0 25px rgba(230, 147, 218, 0.35);
  transition: var(--transition);
}

.avatar-wrapper:hover {
  transform: scale(1.05);
  border-color: var(--c-sky);
  box-shadow: 0 0 30px rgba(170, 211, 244, 0.45);
}

.avatar-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.avatar-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  color: var(--c-orchid);
}

/* หัวข้อและชื่อโปรไฟล์ */
h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
  background: linear-gradient(135deg, #ffffff 30%, var(--c-sky) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.headline {
  color: var(--c-orchid);
  font-size: 1.05rem;
  font-weight: 500;
  margin-bottom: 14px;
}

.bio {
  color: var(--c-lavender);
  font-size: 0.95rem;
  line-height: 1.65;
  white-space: pre-line;
  margin-bottom: 28px;
}

/* ปุ่มลิงก์โซเชียล */
.social-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.social-button {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(54, 48, 81, 0.6);
  border: 1px solid rgba(180, 156, 216, 0.22);
  color: var(--text-main);
  text-decoration: none;
  padding: 15px 22px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.3px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.social-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, rgba(230, 147, 218, 0.15), rgba(170, 211, 244, 0.15));
  opacity: 0;
  transition: var(--transition);
}

.social-button:hover {
  border-color: var(--c-orchid);
  transform: translateY(-3px);
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(230, 147, 218, 0.25),
    0 0 15px rgba(170, 211, 244, 0.2);
}

.social-button:hover::before {
  opacity: 1;
}

/* ส่วนเนื้อหาเพิ่มเติม (Custom Sections / About Box) */
.content-sections {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 24px;
}

.section-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(16px);
  border-radius: var(--radius-sm);
  padding: 24px 28px;
  box-shadow: 0 8px 24px rgba(15, 12, 26, 0.3);
  transition: var(--transition);
}

.section-card:hover {
  border-color: rgba(230, 147, 218, 0.4);
}

.section-card h2 {
  font-size: 1.15rem;
  color: var(--c-sky);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-card h2::before {
  content: '✦';
  color: var(--c-orchid);
  font-size: 0.9rem;
}

.section-card p {
  color: var(--c-lavender);
  font-size: 0.95rem;
  line-height: 1.65;
  white-space: pre-line;
}

footer {
  margin-top: 50px;
  color: var(--c-lavender);
  font-size: 0.85rem;
  text-align: center;
  opacity: 0.8;
}

footer a {
  color: var(--c-sky);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

footer a:hover {
  color: var(--c-orchid);
  text-decoration: underline;
}

/* ============================================================
   Menu Tabs (Profile & Fanart Switcher)
   ============================================================ */
.page-nav {
  display: flex;
  justify-content: center;
  gap: 8px;
  background: rgba(54, 48, 81, 0.45);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(16px);
  padding: 6px;
  border-radius: 40px;
  max-width: 480px;
  width: 100%;
  margin: 0 auto 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.nav-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--c-lavender);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px 18px;
  border-radius: 30px;
  cursor: pointer;
  transition: var(--transition);
}

.nav-tab:hover {
  color: #fff;
}

.nav-tab.active {
  background: linear-gradient(135deg, var(--c-orchid), #c084fc);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(230, 147, 218, 0.4);
}

.tab-view {
  animation: fadeIn 0.4s ease-out;
}

/* ============================================================
   Fanart Gallery Grid
   ============================================================ */
.fanart-header {
  text-align: center;
  margin-bottom: 24px;
}

.fanart-header h2 {
  font-size: 1.7rem;
  color: #fff;
  background: linear-gradient(135deg, #fff 30%, var(--c-sky) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
}

.fanart-subtitle {
  color: var(--c-lavender);
  font-size: 0.95rem;
}

.fanart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
}

.fanart-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.fanart-card:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: var(--c-orchid);
  box-shadow: 0 10px 25px rgba(230, 147, 218, 0.25);
}

.fanart-img-wrapper {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: rgba(0, 0, 0, 0.3);
  overflow: hidden;
  position: relative;
}

.fanart-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.fanart-card:hover .fanart-img-wrapper img {
  transform: scale(1.06);
}

.fanart-info {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fanart-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: #ffffff;
}

.fanart-artist {
  font-size: 0.82rem;
  color: var(--c-sky);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

.fanart-artist:hover {
  text-decoration: underline;
  color: var(--c-orchid);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: var(--card-bg);
  border: 1px dashed var(--card-border);
  border-radius: var(--radius-sm);
  color: var(--c-lavender);
}

.empty-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 12px;
}

.empty-sub {
  margin-top: 8px;
  font-size: 0.85rem;
  opacity: 0.8;
}

.empty-sub a {
  color: var(--c-sky);
  text-decoration: none;
}

/* ============================================================
   Lightbox Modal (Full resolution viewer)
   ============================================================ */
.lightbox-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 8, 20, 0.92);
  backdrop-filter: blur(12px);
  z-index: 100000;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.25s ease-out;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
}

.lightbox-caption {
  margin-top: 14px;
  color: var(--text-main);
  font-size: 1rem;
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: -42px;
  right: -10px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  font-size: 1.2rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.lightbox-close:hover {
  background: var(--c-orchid);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}