:root {
  --radius: 10px; /* Uniform rounded corner radius everywhere */
  --bg-gradient: linear-gradient(135deg, #0d0b18 0%, #1a0f2e 50%, #0a0512 100%);
  
  /* Default App Theme Fallback */
  --theme-color: #9d4edd; /* Default accent (purple) */
  --card-bg: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
  --card-border: rgba(255, 255, 255, 0.08);
  
  --btn-bg: rgba(255, 255, 255, 0.07);
  --btn-hover: rgba(255, 255, 255, 0.15);
  --text-main: #f1f1f1;
  --text-muted: #a0a0b0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Cairo', sans-serif;
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  text-align: right;
}

.header-title {
  margin-top: -10px;
  font-size: 2rem;
  font-weight: 1000;
  background-image: linear-gradient(135deg, #8471f3 0%, #620efe 50%, #a289c1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  text-align: center;
  line-height: 1.5;
}

.subtitle {
  font-size: 1rem;
  color: var(--text-main);
  text-align: center;
  margin-top: 0px;
  margin-bottom: 24px;
}

.container {
  width: 100%;
  max-width: 480px;
  padding: 32px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Position the container relative so the watermark stays pinned to it */
.container {
  position: relative;
  overflow: hidden; /* Prevents tilted edges from creating horizontal scrollbars */
}

/* Tilted Background Logo Watermark */
.container::after {
  content: "";
  position: fixed;
  bottom: -200px;         /* Positions it near the bottom */
  left: -150px;           /* Pins it to the left side */
  width: 500px;          /* Size of the watermark */
  height: 500px;
  background-image: url('../images/ala nahjen qaweem.svg'); /* Path to your logo */
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.12;         /* Low opacity (5%) for a subtle watermark effect */
  mix-blend-mode: overlay;
  transform: rotate(20deg); /* Tilts the logo */
  pointer-events: none;  /* Allows clicks to pass through to buttons */
  z-index: 0;            /* Keeps it behind all your links and content */
}

/* Profile / Company Logo */
.profile-logo {
  width: 80px;
  height: 110px;
  object-fit: contain;
  border-radius: var(--radius);
  margin-bottom: 20px;
}

/* Base App Section Card */
.app-section {
  width: 100%;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  margin-bottom: 18px;
  padding: 14px 16px;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

/* App Header (Icon + Title) */
.app-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.app-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  border-radius: 4px;
}

.app-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Content Container for Link Rows */
.app-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Link + Copy Pair Row */
.channel-row {
  display: flex;
  gap: 8px;
  width: 100%;
}

/* Primary Link Button */
.link-btn {
  flex: 1;
  background: var(--btn-bg);
  color: var(--text-main);
  text-decoration: none;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  border: 1px solid var(--card-border);
  transition: background 0.2s ease;
}

.link-btn:hover {
  background: var(--btn-hover);
}

/* Update .link-btn to position items independently */
.link-btn {
  position: relative; /* Allows absolute positioning for the icon */
  display: flex;
  align-items: center;
  justify-content: center; /* Keeps the text centered */
  padding: 10px 36px; /* Extra padding on sides so text doesn't overlap the icon */
}

/* Anchor the icon to the far right side */
.btn-icon {
  position: absolute;
  right: 12px; /* Pins it to the right edge */
  width: 16px;
  height: 16px;
  object-fit: contain;
  filter: invert(1); /* Turns black SVG to white for dark mode */
  pointer-events: none;
}

/* Copyable Username Button - Now Dynamic per App Theme! */
.copy-btn {
  background: var(--btn-bg);
  color: var(--theme-color); /* Dynamically matches the app section's color */
  border: 1px solid var(--card-border);
  padding: 10px 12px;
  border-radius: var(--radius);
  font-family: 'Cairo', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  direction: ltr; /* Keeps handles like @username formatted correctly */
}

.copy-btn:hover {
  background: var(--btn-hover);
}

/* State when clicked (Copied) */
.copy-btn.copied {
  background: var(--theme-color); /* Fills with the app's brand color when copied */
  color: #ffffff;
  border-color: var(--theme-color);
}

/* Bottom Footer Phrase */
.footer-phrase {
  margin-top: 28px;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
}

/* ==========================================================================
   APP THEMES (All styles for each app combined right here)
   ========================================================================== */

/* 1. TELEGRAM THEME */
.app-section.telegram-theme {
  --theme-color: #2aabee; /* Telegram Cyan */
  --card-bg: linear-gradient(135deg, rgba(42, 171, 238, 0.12) 0%, rgba(13, 11, 24, 0.2) 100%);
  --card-border: rgba(42, 171, 238, 0.2);
}

/* 2. INSTAGRAM THEME */
.app-section.instagram-theme {
  --theme-color: #e1306c; /* Instagram Pink/Red */
  --card-bg: linear-gradient(135deg, rgba(225, 48, 108, 0.12) 0%, rgba(13, 11, 24, 0.2) 100%);
  --card-border: rgba(225, 48, 108, 0.2);
}

/* 3. ELEMENT THEME (Example ready to use) */
.app-section.element-theme {
  --theme-color: #00cca7; /* Element Blue */
  --card-bg: linear-gradient(135deg, rgba(0, 204, 146, 0.12) 0%, rgba(11, 24, 19, 0.2) 100%);
  --card-border: rgba(0, 204, 146, 0.2);
}

/* 4. FACEBOOK THEME */
.app-section.facebook-theme {
  --theme-color: #1877f2; /* Facebook Blue */
  --card-bg: linear-gradient(135deg, rgba(24, 119, 242, 0.12) 0%, rgba(13, 11, 24, 0.2) 100%);
  --card-border: rgba(24, 119, 242, 0.2);
}