/* ==========================================================================
   DESIGN SYSTEM & VARIABLES
   ========================================================================== */
:root {
  --bg-primary: #090d16;
  --bg-secondary: rgba(17, 24, 39, 0.6);
  --bg-card: rgba(30, 41, 59, 0.45);
  --border-color: rgba(255, 255, 255, 0.08);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --color-primary: #8b5cf6; /* Neon Purple */
  --color-secondary: #ec4899; /* Vibrant Pink */
  --color-success: #10b981; /* Green */
  --color-error: #f43f5e; /* Red */
  
  --gradient-main: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  --shadow-neon: 0 0 25px rgba(139, 92, 246, 0.2);
  --shadow-glow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ==========================================================================
   DYNAMIC BACKGROUND BLOBS
   ========================================================================== */
.bg-glow {
  position: absolute;
  width: 600px;
  height: 600px;
  z-index: -1;
  opacity: 0.18;
  pointer-events: none;
}

.blob-1 {
  background: radial-gradient(circle, var(--color-primary) 0%, rgba(139, 92, 246, 0) 70%);
  top: -150px;
  right: -100px;
  animation: float 20s infinite alternate;
}

.blob-2 {
  background: radial-gradient(circle, var(--color-secondary) 0%, rgba(236, 72, 153, 0) 70%);
  bottom: 50px;
  left: -150px;
  animation: float 25s infinite alternate-reverse;
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(50px, 80px) scale(1.1); }
  100% { transform: translate(-20px, 40px) scale(0.9); }
}

/* ==========================================================================
   LAYOUT CONTAINERS
   ========================================================================== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}

header {
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: rgba(9, 13, 22, 0.7);
}

.header-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  letter-spacing: -0.5px;
}

.logo-icon {
  width: 28px;
  height: 28px;
  color: var(--color-secondary);
}

.logo-dot {
  width: 6px;
  height: 6px;
  background-color: var(--color-primary);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px var(--color-primary);
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: var(--transition-smooth);
}

.nav-links a:hover {
  color: var(--text-primary);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero {
  text-align: center;
  padding: 5rem 0 3rem;
  max-width: 800px;
  margin: 0 auto;
}

h1 {
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1.5px;
  margin-bottom: 1.25rem;
}

.gradient-text {
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  font-weight: 400;
  max-width: 600px;
  margin: 0 auto;
}

/* ==========================================================================
   PREMIUM GLASS CARDS
   ========================================================================== */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  box-shadow: var(--shadow-glow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
}

.main-card {
  padding: 2.5rem;
}

.card-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-primary), var(--color-secondary), transparent);
}

/* ==========================================================================
   INTERACTIVE INPUT & BUTTONS
   ========================================================================== */
.input-group {
  display: flex;
  gap: 1rem;
}

.input-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 1.25rem;
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  pointer-events: none;
}

#instagram-url {
  width: 100%;
  padding: 1.1rem 1.1rem 1.1rem 3.25rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 1rem;
  outline: none;
  transition: var(--transition-smooth);
}

#instagram-url:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.25);
  background: rgba(15, 23, 42, 0.85);
}

button {
  cursor: pointer;
  border: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  border-radius: 12px;
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

#btn-convert {
  background: var(--gradient-main);
  color: #fff;
  padding: 0 2rem;
  min-width: 140px;
  box-shadow: var(--shadow-neon);
}

#btn-convert:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(139, 92, 246, 0.45);
}

#btn-convert:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 0.75rem 1.5rem;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
}

.btn-spinner {
  width: 18px;
  height: 18px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.error-msg {
  color: var(--color-error);
  font-size: 0.9rem;
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ==========================================================================
   CONVERTED RESULT & CLIPBOARD
   ========================================================================== */
.result-container {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.divider {
  height: 1px;
  background: linear-gradient(90deg, rgba(255,255,255,0), var(--border-color), rgba(255,255,255,0));
}

.result-box h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.copy-wrapper {
  display: flex;
  gap: 0.75rem;
}

#converted-url {
  flex: 1;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.85rem 1.25rem;
  color: var(--color-primary);
  font-family: monospace;
  font-size: 0.95rem;
  outline: none;
  text-overflow: ellipsis;
}

#btn-copy {
  min-width: 130px;
}

#btn-copy.copied {
  background: rgba(16, 185, 129, 0.15) !important;
  color: var(--color-success) !important;
  border-color: var(--color-success) !important;
}

.copy-icon, .check-icon {
  width: 16px;
  height: 16px;
}

/* ==========================================================================
   REALISTIC DISCORD EMBED SIMULATOR
   ========================================================================== */
.preview-box {
  background: rgba(15, 23, 42, 0.35);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
}

.preview-header {
  background: rgba(15, 23, 42, 0.75);
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-weight: 500;
}

.discord-small-logo {
  width: 18px;
  height: 14px;
  color: #5865F2; /* Discord Blurple */
}

.discord-message {
  background-color: #313338; /* Discord dark theme chat background */
  padding: 1.25rem;
  display: flex;
  gap: 1rem;
}

.discord-avatar {
  width: 40px;
  height: 40px;
  background-color: #5865F2;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}

.discord-avatar svg {
  width: 24px;
  height: 24px;
}

.discord-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.discord-user-header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.discord-username {
  color: #f2f3f5;
  font-size: 0.95rem;
  font-weight: 600;
}

.discord-bot-tag {
  background-color: #5865F2;
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.275rem;
  border-radius: 3px;
  line-height: 1.3;
}

.discord-timestamp {
  color: #949ba4;
  font-size: 0.75rem;
  font-weight: 400;
}

.discord-embed {
  background-color: #2b2d31; /* Discord Dark Embed color */
  border-left: 4px solid var(--color-primary); /* Embed accent bar */
  border-radius: 4px;
  margin-top: 0.35rem;
  max-width: 520px;
  display: flex;
}

.discord-embed-inner {
  padding: 0.75rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  width: 100%;
}

.discord-embed-site-name {
  color: #f2f3f5;
  font-size: 0.75rem;
  font-weight: 400;
}

.discord-embed-title {
  color: #00a8fc; /* Discord Link color */
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  margin-top: 0.1rem;
}

.discord-embed-title:hover {
  text-decoration: underline;
}

.discord-embed-description {
  color: #dbdee1;
  font-size: 0.85rem;
  line-height: 1.35;
}

.discord-embed-media {
  margin-top: 0.75rem;
  border-radius: 8px;
  overflow: hidden;
  max-width: 100%;
  display: flex;
  justify-content: flex-start;
  max-height: 380px;
  background-color: #1e1f22;
}

.discord-embed-media img,
.discord-embed-media video {
  max-width: 100%;
  max-height: 380px;
  object-fit: contain;
}

/* ==========================================================================
   GUIDE & STEP-BY-STEP SECTIONS
   ========================================================================== */
.guide-section, .api-section {
  padding: 5rem 0 3rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 3.5rem;
  letter-spacing: -0.75px;
}

.grid-three {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.feature-card {
  padding: 2.5rem 2rem;
  text-align: center;
}

.feature-card:hover {
  transform: translateY(-5px);
  border-color: rgba(139, 92, 246, 0.25);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.step-num {
  width: 48px;
  height: 48px;
  background: var(--gradient-main);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  margin: 0 auto 1.5rem;
  box-shadow: var(--shadow-neon);
}

.feature-card h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* ==========================================================================
   DEVELOPER API DOCS
   ========================================================================== */
.docs-card {
  padding: 3rem;
}

.docs-intro {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 2rem;
}

.endpoint-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  font-family: monospace;
}

.method {
  background-color: rgba(16, 185, 129, 0.15);
  color: var(--color-success);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.path {
  font-size: 1.15rem;
  color: var(--text-primary);
  font-weight: 600;
}

.params-box {
  margin-bottom: 2rem;
}

.params-box h4 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.params-box ul {
  list-style: none;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
}

.params-box li {
  display: flex;
  padding: 1rem 1.25rem;
  background: rgba(15, 23, 42, 0.25);
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
}

.params-box li:last-child {
  border-bottom: none;
}

.param-name {
  font-family: monospace;
  font-weight: 600;
  color: var(--color-primary);
  width: 100px;
}

.param-type {
  font-family: monospace;
  color: var(--text-muted);
  width: 100px;
}

.param-desc {
  color: var(--text-secondary);
  flex: 1;
}

.code-block-wrapper {
  margin-top: 1.5rem;
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
}

.code-header {
  background: rgba(15, 23, 42, 0.8);
  padding: 0.6rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.btn-copy-code {
  background: transparent;
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.btn-copy-code:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.06);
}

pre {
  padding: 1.25rem;
  overflow-x: auto;
}

code {
  font-family: monospace;
  font-size: 0.9rem;
  color: #38bdf8; /* Soft blue */
}

#code-res code {
  color: #a78bfa; /* Soft purple */
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
footer {
  border-top: 1px solid var(--border-color);
  padding: 2.5rem 0;
  background: rgba(15, 23, 42, 0.4);
  margin-top: 5rem;
}

.footer-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.tech-tags {
  display: flex;
  gap: 1rem;
}

.tech-tags span {
  font-size: 0.75rem;
  background: rgba(255,255,255,0.04);
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

/* ==========================================================================
   RESPONSIVE DESIGN INTERPOLATIONS
   ========================================================================== */
@media (max-width: 768px) {
  h1 {
    font-size: 2.5rem;
  }
  
  .hero {
    padding: 3rem 0;
  }
  
  .input-group {
    flex-direction: column;
  }
  
  #btn-convert {
    padding: 1rem 2rem;
  }
  
  .copy-wrapper {
    flex-direction: column;
  }
  
  #btn-copy {
    padding: 0.85rem;
  }
  
  .footer-container {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .tech-tags {
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .docs-card {
    padding: 1.5rem;
  }
}

/* ==========================================================================
   UTILITY ANIMATIONS
   ========================================================================== */
.animate-fade-in {
  animation: fadeIn 0.8s ease-out forwards;
}

.animate-slide-up {
  animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hidden {
  display: none !important;
}
