/* CSS Variables for Theming */
:root {
  --bg-color-1: #f8fafc;
  --bg-color-2: #e2e8f0;
  --text-main: #0f172a;
  --text-sec: #475569;
  --card-bg: rgba(255, 255, 255, 0.7);
  --card-border: rgba(255, 255, 255, 0.5);
  --card-hover-border: rgba(99, 102, 241, 0.5);
  --btn-hover-transform: translateY(-4px);
  --shadow-color: rgba(0, 0, 0, 0.05);
  --shadow-hover: rgba(99, 102, 241, 0.15);
  --gradient-1: #c7d2fe;
  --gradient-2: #fbcfe8;
}

[data-theme="dark"] {
  --bg-color-1: #0f172a;
  --bg-color-2: #1e293b;
  --text-main: #f8fafc;
  --text-sec: #cbd5e1;
  --card-bg: rgba(30, 41, 59, 0.7);
  --card-border: rgba(255, 255, 255, 0.1);
  --card-hover-border: rgba(129, 140, 248, 0.5);
  --shadow-color: rgba(0, 0, 0, 0.3);
  --shadow-hover: rgba(129, 140, 248, 0.2);
  --gradient-1: #312e81;
  --gradient-2: #4c1d95;
}

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

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  color: var(--text-main);
  background-color: var(--bg-color-1);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem 1rem;
  position: relative;
  overflow-x: hidden;
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

/* Animated Gradient Background */
.bg-gradient {
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(circle at 50% 50%, var(--gradient-1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, var(--gradient-2) 0%, transparent 50%);
  opacity: 0.5;
  z-index: -1;
  animation: rotateBg 20s linear infinite;
  transition: background 0.5s ease;
}

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

/* Layout */
.container {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  z-index: 1;
}

/* Header & Profile */
.profile {
  text-align: center;
  position: relative;
}

.theme-btn {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  color: var(--text-main);
  transition: all 0.3s ease;
  z-index: 10;
}

.theme-btn:hover {
  transform: scale(1.1);
  background: var(--card-hover-border);
}

.theme-icon {
  width: 20px;
  height: 20px;
}

.hidden {
  display: none;
}

.avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1rem;
  border: 4px solid var(--card-bg);
  box-shadow: 0 8px 20px var(--shadow-color);
  transition: transform 0.3s ease;
}

.avatar:hover {
  transform: scale(1.05) rotate(2deg);
}

.name {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.bio {
  font-size: 1rem;
  color: var(--text-sec);
  margin-bottom: 1rem;
}

.tags {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tag {
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: var(--text-sec);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

/* Link Cards */
.links-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.link-card {
  display: flex;
  align-items: center;
  padding: 1rem 1.25rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 16px;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 6px var(--shadow-color);
  position: relative;
  overflow: hidden;
}

/* Glass shine effect */
.link-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.3) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: skewX(-25deg);
  transition: all 0.7s ease;
  z-index: 1;
}

[data-theme="dark"] .link-card::before {
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.05) 50%,
    rgba(255, 255, 255, 0) 100%
  );
}

.link-card:hover {
  transform: var(--btn-hover-transform);
  border-color: var(--card-hover-border);
  box-shadow: 0 10px 20px var(--shadow-hover);
}

.link-card:hover::before {
  left: 200%;
}

.link-icon {
  width: 24px;
  height: 24px;
  margin-right: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.link-title {
  flex-grow: 1;
  text-align: center;
  margin-right: 24px; /* Offset icon to perfectly center text */
  z-index: 2;
}

/* Footer */
.footer {
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-sec);
  margin-top: 2rem;
}

.last-updated {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  opacity: 0.8;
}

/* Responsive */
@media (min-width: 640px) {
  .container {
    padding: 0;
  }
}
