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

:root {
  --primary: #8b5cf6;
  --secondary: #3b82f6;
  --text: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.6);
  --bg: #0a0a0f;
  --bg-card: rgba(255, 255, 255, 0.05);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --button-bg: #8b5cf6;
  --button-text: #ffffff;
  --button-radius: 12px;
  --border-color: rgba(255, 255, 255, 0.1);
  --border-width: 1px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 20px rgba(139, 92, 246, 0.3);
  --blur: 12px;
  --transparency: 0.1;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 50%;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  --max-width: 480px;
  --z-base: 1;
  --z-modal: 100;
  --z-toast: 200;
  --z-editor: 50;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 12px 20px;
  display: flex;
  justify-content: flex-end;
  pointer-events: none;
}

#app-header .header-right {
  display: flex;
  gap: 8px;
  pointer-events: auto;
}

.header-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--border-color);
  border-radius: 50px;
  background: rgba(10, 10, 15, 0.7);
  backdrop-filter: blur(12px);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.header-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

#app {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 60px;
}
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.bg-media {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  object-fit: cover;
  pointer-events: none;
}

.container {
  position: relative;
  z-index: var(--z-base);
  width: 100%;
  max-width: var(--max-width);
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.glass {
  background: rgba(255, 255, 255, var(--transparency, 0.05));
  backdrop-filter: blur(var(--blur, 12px));
  -webkit-backdrop-filter: blur(var(--blur, 12px));
  border: var(--border-width, 1px) solid var(--border-color, rgba(255,255,255,0.1));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.profile-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: center;
}

.profile-avatar {
  width: 100px;
  height: 100px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 3px solid var(--primary);
  box-shadow: var(--shadow-glow);
  transition: var(--transition);
  cursor: pointer;
}

.profile-avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 0 30px var(--primary);
}

.profile-avatar-placeholder {
  width: 100px;
  height: 100px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  cursor: pointer;
  transition: var(--transition);
  border: 3px solid var(--primary);
  box-shadow: var(--shadow-glow);
}

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

.profile-name {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-top: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.profile-name:hover {
  color: var(--primary);
}

.profile-username {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 400;
  cursor: pointer;
  transition: var(--transition);
}

.profile-username:hover {
  color: var(--text);
}

.profile-bio {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 400px;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.profile-bio:hover {
  background: var(--bg-card-hover);
}

.profile-details {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-secondary);
}

.profile-details span {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.profile-details span:hover {
  background: var(--bg-card-hover);
  color: var(--text);
}

.links-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.link-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 16px 20px;
  background: rgba(255, 255, 255, var(--transparency, 0.05));
  backdrop-filter: blur(var(--blur, 12px));
  -webkit-backdrop-filter: blur(var(--blur, 12px));
  border: var(--border-width, 1px) solid var(--border-color, rgba(255,255,255,0.1));
  border-radius: var(--button-radius, var(--radius-md));
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  color: var(--text);
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.link-card:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, calc(var(--transparency, 0.05) + 0.03));
  box-shadow: 0 8px 24px rgba(0,0,0,0.3), var(--shadow-glow);
}

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

.link-card .link-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  border: 1px solid var(--border-color);
}

.link-card .link-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  transition: var(--transition);
}

.link-card .link-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.link-card .link-title {
  font-weight: 600;
  font-size: 15px;
  transition: var(--transition);
}

.link-card .link-url {
  font-size: 12px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 250px;
}

.link-card .link-arrow {
  font-size: 14px;
  opacity: 0.5;
  transition: var(--transition);
}

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

.link-card .link-click-count {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 11px;
  color: var(--text-secondary);
  opacity: 0.6;
}

.link-card .link-drag-handle {
  cursor: grab;
  color: var(--text-secondary);
  opacity: 0.3;
  font-size: 14px;
  transition: var(--transition);
  padding: 4px;
}

.link-card:hover .link-drag-handle {
  opacity: 0.7;
}

.link-card.dragging {
  opacity: 0.5;
  transform: scale(0.98);
}

.link-card.drag-over {
  border-color: var(--primary);
  transform: translateY(4px);
}

.socials-section {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  width: 100%;
  margin-top: 8px;
}

.social-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, var(--transparency, 0.05));
  backdrop-filter: blur(var(--blur, 12px));
  -webkit-backdrop-filter: blur(var(--blur, 12px));
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text);
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
}

.social-icon:hover {
  transform: translateY(-3px);
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}

.social-icon.empty {
  opacity: 0.3;
  cursor: pointer;
  border-style: dashed;
}

.social-icon.empty:hover {
  opacity: 0.6;
  background: var(--bg-card-hover);
  border-color: var(--text-secondary);
  transform: none;
  box-shadow: none;
}

.share-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 4px;
}

.btn-share {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  padding: 8px 20px;
  font-size: 13px;
  border-radius: 50px;
}

.btn-share:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  transform: translateY(-1px);
}

.action-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
  margin-top: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(139, 92, 246, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid var(--border-color);
}

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

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  cursor: pointer;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  transition: var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: var(--transition);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--primary);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

:root.theme-light .toggle-slider {
  background: rgba(0, 0, 0, 0.15);
}

:root.theme-light .toggle-switch input:checked + .toggle-slider {
  background: var(--primary);
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-full);
}

.analytics-bar {
  display: flex;
  gap: 24px;
  width: 100%;
  padding: 16px 20px;
  justify-content: center;
  font-size: 13px;
  color: var(--text-secondary);
}

.analytics-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.analytics-item strong {
  color: var(--text);
  font-weight: 600;
}

.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: scale(0);
  animation: ripple-anim 0.6s ease-out;
  pointer-events: none;
}

@keyframes ripple-anim {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

.page-enter {
  animation: fadeInUp 0.4s ease-out;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
}

.empty-state i {
  font-size: 40px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state p {
  font-size: 14px;
}

.terms-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  cursor: pointer;
}

.terms-checkbox input[type="checkbox"] {
  margin-top: 2px;
  accent-color: var(--primary);
  flex-shrink: 0;
  width: 14px;
  height: 14px;
}

.terms-checkbox a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.terms-checkbox a:hover {
  text-decoration: underline;
}

.footer {
  width: 100%;
  text-align: center;
  padding: 20px;
  font-size: 12px;
  color: var(--text-secondary);
  opacity: 0.5;
}

.footer a:hover {
  opacity: 0.8;
}
