:root,
[data-theme="dark"] {
  --bg-primary: #090b10;
  --bg-card: rgba(17, 21, 32, 0.72);
  --bg-card-border: rgba(255, 255, 255, 0.08);
  --bg-link: rgba(255, 255, 255, 0.04);
  --bg-link-hover: rgba(255, 255, 255, 0.09);
  --bg-link-border: rgba(255, 255, 255, 0.07);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-primary: #6366f1;
  --accent-secondary: #06b6d4;
  --glow-opacity: 0.28;
  --shadow-card: 0 24px 60px -12px rgba(0, 0, 0, 0.65);
}

[data-theme="light"] {
  --bg-primary: #f1f5f9;
  --bg-card: rgba(255, 255, 255, 0.82);
  --bg-card-border: rgba(15, 23, 42, 0.08);
  --bg-link: rgba(255, 255, 255, 0.75);
  --bg-link-hover: #ffffff;
  --bg-link-border: rgba(15, 23, 42, 0.09);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --accent-primary: #4f46e5;
  --accent-secondary: #0891b2;
  --glow-opacity: 0.18;
  --shadow-card: 0 20px 50px -12px rgba(15, 23, 42, 0.12);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Cairo", "Inter", system-ui, -apple-system, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5rem 1rem 2.5rem;
  position: relative;
  overflow-x: hidden;
  transition: background-color 0.35s ease, color 0.35s ease;
}

html[lang="en"] body {
  font-family: "Inter", "Cairo", system-ui, -apple-system, sans-serif;
}

/* Ambient Background */
.bg-glow {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(110px);
  opacity: var(--glow-opacity);
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.4s ease;
}

.bg-glow-1 {
  top: -120px;
  right: -100px;
  background: radial-gradient(circle, var(--accent-primary), transparent 70%);
  animation: floatSlow 12s ease-in-out infinite alternate;
}

.bg-glow-2 {
  bottom: -120px;
  left: -100px;
  background: radial-gradient(circle, var(--accent-secondary), transparent 70%);
  animation: floatSlow 15s ease-in-out infinite alternate-reverse;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(148, 163, 184, 0.12) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
  pointer-events: none;
  z-index: 0;
}

@keyframes floatSlow {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(-30px, 30px) scale(1.08);
  }
}

/* Top Bar */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  max-width: 540px;
  margin: 0 auto;
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 20;
}

.top-actions {
  display: flex;
  gap: 0.55rem;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--bg-card-border);
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.icon-btn:hover {
  transform: translateY(-2px);
  border-color: var(--accent-primary);
}

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

.icon-btn .icon {
  width: 18px;
  height: 18px;
}

.lang-label {
  font-family: "Inter", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

[data-theme="dark"] .moon-icon {
  display: none;
}

[data-theme="light"] .sun-icon {
  display: none;
}

/* Main Container & Card */
.container {
  width: 100%;
  max-width: 480px;
  position: relative;
  z-index: 1;
}

.profile-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: 28px;
  padding: 2.25rem 1.5rem 1.75rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-card);
  text-align: center;
  animation: fadeUp 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* Avatar */
.avatar-wrapper {
  position: relative;
  width: 108px;
  height: 108px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.45);
}

.avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 3px solid var(--bg-primary);
  background-color: var(--bg-primary);
}

.status-dot {
  position: absolute;
  bottom: 5px;
  right: 5px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: #10b981;
  border: 3px solid var(--bg-primary);
}

/* Profile Headings */
.profile-name {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.15rem;
}

.profile-handle {
  font-family: "Inter", sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--accent-secondary);
  margin-bottom: 0.75rem;
}

.profile-bio {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.75;
  max-width: 420px;
  margin: 0 auto 1.65rem;
}

/* Links List */
.links-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.link-item {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  padding: 0.85rem 1.05rem;
  border-radius: 16px;
  background: var(--bg-link);
  border: 1px solid var(--bg-link-border);
  color: var(--text-primary);
  text-decoration: none;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              background-color 0.22s ease,
              border-color 0.22s ease,
              box-shadow 0.22s ease;
  position: relative;
  overflow: hidden;
}

.link-item:hover {
  transform: translateY(-2px) scale(1.01);
  background: var(--bg-link-hover);
  border-color: var(--brand-color, var(--accent-primary));
  box-shadow: 0 10px 24px -10px var(--brand-glow, rgba(99, 102, 241, 0.35));
}

.link-item:active {
  transform: translateY(0) scale(0.995);
}

/* Featured Website Link */
.featured-link {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(6, 182, 212, 0.12));
  border-color: rgba(99, 102, 241, 0.35);
}

/* Brand Accents */
.link-item[data-brand="website"] {
  --brand-color: #6366f1;
  --brand-glow: rgba(99, 102, 241, 0.4);
}
.link-item[data-brand="github"] {
  --brand-color: #94a3b8;
  --brand-glow: rgba(148, 163, 184, 0.3);
}
.link-item[data-brand="linkedin"] {
  --brand-color: #0a66c2;
  --brand-glow: rgba(10, 102, 194, 0.4);
}
.link-item[data-brand="youtube"] {
  --brand-color: #ef4444;
  --brand-glow: rgba(239, 68, 68, 0.4);
}
.link-item[data-brand="x"] {
  --brand-color: #cbd5e1;
  --brand-glow: rgba(203, 213, 225, 0.3);
}
.link-item[data-brand="telegram"] {
  --brand-color: #26a5e4;
  --brand-glow: rgba(38, 165, 228, 0.4);
}
.link-item[data-brand="instagram"] {
  --brand-color: #e1306c;
  --brand-glow: rgba(225, 48, 108, 0.4);
}
.link-item[data-brand="facebook"] {
  --brand-color: #1877f2;
  --brand-glow: rgba(24, 119, 242, 0.4);
}

.link-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--bg-link-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--brand-color, var(--accent-primary));
  transition: transform 0.22s ease, background-color 0.22s ease, color 0.22s ease;
}

[data-theme="light"] .link-icon {
  background: rgba(15, 23, 42, 0.04);
}

.link-item:hover .link-icon {
  transform: scale(1.06);
  background: var(--brand-color, var(--accent-primary));
  color: #ffffff;
  border-color: transparent;
}

.link-icon svg {
  width: 20px;
  height: 20px;
}

.link-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: start;
  flex: 1;
  min-width: 0;
}

.link-title {
  font-size: 0.96rem;
  font-weight: 600;
  line-height: 1.3;
}

.link-subtitle {
  font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  margin-top: 0.1rem;
}

.link-arrow {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: transform 0.22s ease, color 0.22s ease;
}

.link-arrow svg {
  width: 17px;
  height: 17px;
}

html[dir="rtl"] .link-arrow svg {
  transform: scaleX(-1);
}

html[dir="rtl"] .link-item:hover .link-arrow {
  transform: translate(-3px, -3px);
  color: var(--text-primary);
}

html[dir="ltr"] .link-item:hover .link-arrow {
  transform: translate(3px, -3px);
  color: var(--text-primary);
}

/* Footer */
.card-footer {
  margin-top: 1.8rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--bg-card-border);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.card-footer a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.card-footer a:hover {
  color: var(--accent-primary);
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text-primary);
  color: var(--bg-primary);
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 50;
}

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

/* Responsive adjustments */
@media (max-width: 480px) {
  body {
    padding: 4.5rem 0.85rem 2rem;
  }

  .profile-card {
    padding: 1.85rem 1.15rem 1.5rem;
    border-radius: 24px;
  }
}
