/* LitLink Style System - Inspired by lit.link */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&family=Noto+Sans+JP:wght@400;500;700&display=swap');

:root {
  --font-family: 'Outfit', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #311042 100%);
  --card-bg: rgba(255, 255, 255, 0.09);
  --card-border: 1px solid rgba(255, 255, 255, 0.18);
  --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.25);
  --text-main: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.75);
  --accent-color: #6366f1;
  --badge-bg: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  --badge-text: #ffffff;
  --social-bg: rgba(255, 255, 255, 0.12);
  --social-hover: rgba(255, 255, 255, 0.25);
  --btn-radius: 9999px;
}

/* Theme Presets */
body.theme-glass {
  --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #2e1065 100%);
  --card-bg: rgba(255, 255, 255, 0.08);
  --card-border: 1px solid rgba(255, 255, 255, 0.15);
  --text-main: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.75);
  --social-bg: rgba(255, 255, 255, 0.12);
}

body.theme-sunset {
  --bg-gradient: linear-gradient(135deg, #ff9a9e 0%, #fecfef 50%, #a1c4fd 100%);
  --card-bg: rgba(255, 255, 255, 0.7);
  --card-border: 1px solid rgba(255, 255, 255, 0.5);
  --card-shadow: 0 10px 25px -5px rgba(255, 154, 158, 0.3);
  --text-main: #1e293b;
  --text-muted: #64748b;
  --accent-color: #f43f5e;
  --badge-bg: linear-gradient(135deg, #f43f5e 0%, #fb7185 100%);
  --social-bg: rgba(255, 255, 255, 0.6);
  --social-hover: rgba(255, 255, 255, 0.9);
}

body.theme-dark {
  --bg-gradient: linear-gradient(135deg, #090d16 0%, #0f172a 100%);
  --card-bg: #1e293b;
  --card-border: 1px solid #334155;
  --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent-color: #38bdf8;
  --badge-bg: #38bdf8;
  --badge-text: #0f172a;
  --social-bg: #334155;
  --social-hover: #475569;
}

body.theme-emerald {
  --bg-gradient: linear-gradient(135deg, #064e3b 0%, #059669 50%, #10b981 100%);
  --card-bg: rgba(255, 255, 255, 0.12);
  --card-border: 1px solid rgba(255, 255, 255, 0.25);
  --text-main: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.8);
  --accent-color: #34d399;
  --badge-bg: linear-gradient(135deg, #059669 0%, #34d399 100%);
  --social-bg: rgba(255, 255, 255, 0.15);
}

body.theme-cyberpunk {
  --bg-gradient: linear-gradient(135deg, #180b30 0%, #2e0854 50%, #031b33 100%);
  --card-bg: rgba(20, 10, 40, 0.7);
  --card-border: 1px solid #00f0ff;
  --card-shadow: 0 0 20px rgba(0, 240, 255, 0.25);
  --text-main: #ffffff;
  --text-muted: #00f0ff;
  --accent-color: #ff007f;
  --badge-bg: linear-gradient(135deg, #ff007f 0%, #7928ca 100%);
  --social-bg: rgba(0, 240, 255, 0.15);
  --social-hover: rgba(0, 240, 255, 0.35);
}

body.theme-minimal {
  --bg-gradient: #f8fafc;
  --card-bg: #ffffff;
  --card-border: 1px solid #e2e8f0;
  --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  --text-main: #0f172a;
  --text-muted: #64748b;
  --accent-color: #0f172a;
  --badge-bg: #0f172a;
  --badge-text: #ffffff;
  --social-bg: #f1f5f9;
  --social-hover: #e2e8f0;
}

/* Button Styles */
body.btn-pill { --btn-radius: 9999px; }
body.btn-rounded { --btn-radius: 16px; }
body.btn-glass { --btn-radius: 20px; }
body.btn-sharp { --btn-radius: 6px; }

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

body {
  font-family: var(--font-family);
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 2rem 1rem;
  line-height: 1.6;
}

/* App Container */
.litlink-container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
}

/* Ambient Background Effect */
.ambient-blur {
  position: fixed;
  top: -10%;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.3) 0%, rgba(168, 85, 247, 0.15) 50%, rgba(0,0,0,0) 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(40px);
}

/* Profile Header */
.profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  margin-bottom: 1.75rem;
  animation: fadeInDown 0.6s ease-out;
}

.avatar-wrapper {
  position: relative;
  margin-bottom: 1.2rem;
}

.profile-avatar {
  width: 110px;
  height: 110px;
  object-fit: cover;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  border: 3px solid rgba(255, 255, 255, 0.3);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.profile-avatar:hover {
  transform: scale(1.05);
}

.profile-avatar.shape-circle { border-radius: 50%; }
.profile-avatar.shape-rounded { border-radius: 24px; }
.profile-avatar.shape-square { border-radius: 8px; }

.avatar-fallback {
  width: 110px;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--badge-bg);
  color: #fff;
  font-size: 2.5rem;
  font-weight: 700;
  box-shadow: 0 8px 25px rgba(0,0,0,0.3);
  border: 3px solid rgba(255, 255, 255, 0.3);
}
.avatar-fallback.shape-circle { border-radius: 50%; }
.avatar-fallback.shape-rounded { border-radius: 24px; }
.avatar-fallback.shape-square { border-radius: 8px; }

.profile-name {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
  color: var(--text-main);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.profile-bio {
  font-size: 0.92rem;
  color: var(--text-muted);
  max-width: 90%;
  white-space: pre-line;
  margin-bottom: 1.2rem;
}

/* Social Bar */
.social-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
  animation: fadeInUp 0.7s ease-out;
}

.social-icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--social-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 1.25rem;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.social-icon-btn:hover {
  background: var(--social-hover);
  transform: translateY(-4px) scale(1.1);
  box-shadow: 0 6px 15px rgba(0,0,0,0.25);
  color: var(--text-main);
}

/* Links Container */
.links-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  animation: fadeInUp 0.8s ease-out;
}

/* Link Cards & Buttons */
.link-card {
  width: 100%;
  text-decoration: none;
  color: var(--text-main);
  background: var(--card-bg);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--btn-radius);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: all 0.25s cubic-bezier(0.25, 1, 0.5, 1);
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: 0.9rem 1.2rem;
}

.link-card:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.4);
}

.link-card:active {
  transform: translateY(0) scale(0.98);
}

/* Link Type Layouts */
.link-card.type-button {
  min-height: 58px;
  justify-content: space-between;
}

.link-card.type-card {
  min-height: 84px;
  padding: 1.1rem 1.3rem;
}

.link-header-item {
  width: 100%;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 1.2rem 0 0.4rem 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.link-header-item::before,
.link-header-item::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.2);
}

.link-icon-container {
  font-size: 1.35rem;
  margin-right: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.link-icon-img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
}

.link-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.link-title {
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.3;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.link-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  font-weight: 400;
}

.link-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 700;
  border-radius: 9999px;
  background: var(--badge-bg);
  color: var(--badge-text);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.link-arrow {
  font-size: 1rem;
  opacity: 0.6;
  transition: transform 0.2s ease, opacity 0.2s ease;
  margin-left: 0.6rem;
}

.link-card:hover .link-arrow {
  opacity: 1;
  transform: translateX(4px);
}

/* Footer Controls & Share */
.profile-footer {
  margin-top: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: 100%;
}

.share-btn-group {
  display: flex;
  gap: 0.75rem;
}

.footer-btn {
  padding: 0.5rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.footer-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

.copyright {
  font-size: 0.78rem;
  color: var(--text-muted);
  opacity: 0.7;
}

/* Toast Notifications */
.toast-notification {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(15, 23, 42, 0.95);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.7rem 1.4rem;
  border-radius: 9999px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  z-index: 1000;
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast-notification.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Keyframe Animations */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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