/* ============================================
   Axly URL Shortener — Global Stylesheet
   ============================================ */

/* ---------- CSS Variables / Design Tokens ---------- */
:root {
  /* Primary palette */
  --primary: #6C63FF;
  --primary-hover: #5A52D5;
  --primary-light: rgba(108, 99, 255, 0.1);
  --primary-glow: rgba(108, 99, 255, 0.35);

  /* Accent */
  --accent: #00D4AA;
  --accent-hover: #00B894;
  --accent-light: rgba(0, 212, 170, 0.12);

  /* Neutrals */
  --bg: #0B0D17;
  --bg-card: #12152A;
  --bg-card-hover: #1A1E38;
  --bg-input: #181C33;
  --border: rgba(255, 255, 255, 0.06);
  --border-focus: var(--primary);

  /* Text */
  --text: #E8E8F0;
  --text-muted: #8B8D9E;
  --text-heading: #FFFFFF;

  /* Misc */
  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 40px var(--primary-glow);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

main {
  flex: 1;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent);
}

img {
  max-width: 100%;
  height: auto;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-heading);
  font-weight: 700;
  line-height: 1.25;
}

h1 { font-size: 3rem; }
h2 { font-size: 2.25rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
  color: var(--text-muted);
  line-height: 1.8;
}

.text-gradient {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---------- Navbar ---------- */
.navbar-axly {
  background: rgba(11, 13, 23, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  transition: background var(--transition);
  z-index: 1000;
}

.navbar-axly .navbar-brand {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-heading) !important;
}

.navbar-axly .navbar-brand .brand-highlight {
  color: var(--primary);
}

.navbar-axly .nav-link {
  color: var(--text-muted) !important;
  font-weight: 500;
  padding: 0.5rem 1rem !important;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  font-size: 0.95rem;
}

.navbar-axly .nav-link:hover,
.navbar-axly .nav-link.active {
  color: var(--text-heading) !important;
  background: var(--primary-light);
}

.navbar-toggler {
  border: 1px solid var(--border) !important;
  padding: 0.4rem 0.6rem;
}

.navbar-toggler-icon {
  filter: invert(1);
}

/* ---------- Hero Section ---------- */
.hero {
  padding: 6rem 0 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
  opacity: 0.3;
  pointer-events: none;
  animation: pulse-glow 6s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.2; transform: translateX(-50%) scale(1); }
  50% { opacity: 0.4; transform: translateX(-50%) scale(1.1); }
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin-bottom: 1rem;
  position: relative;
}

.hero .lead {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 2.5rem;
}

/* ---------- Shortener Card ---------- */
.shortener-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow);
  max-width: 680px;
  margin: 0 auto;
  position: relative;
  transition: border-color var(--transition);
}

.shortener-card:hover {
  border-color: rgba(108, 99, 255, 0.15);
}

.shortener-input-group {
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
}

.shortener-input {
  flex: 1;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  color: var(--text);
  font-size: 1rem;
  font-family: var(--font);
  transition: all var(--transition);
  outline: none;
}

.shortener-input::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

.shortener-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* ---------- Buttons ---------- */
.btn-axly {
  background: linear-gradient(135deg, var(--primary), #8B7FFF);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
}

.btn-axly::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transition: left 0.5s;
}

.btn-axly:hover::before {
  left: 100%;
}

.btn-axly:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

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

.btn-secondary-axly {
  background: var(--bg-input);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-secondary-axly:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
  color: var(--text-heading);
}

/* ---------- Result Section ---------- */
.result-section {
  display: none;
  margin-top: 1.5rem;
  animation: slide-up 0.4s ease-out;
}

.result-section.show {
  display: block;
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-box {
  background: var(--bg-input);
  border: 1.5px solid rgba(0, 212, 170, 0.2);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.result-link {
  flex: 1;
  color: var(--accent);
  font-weight: 500;
  word-break: break-all;
  min-width: 150px;
  font-size: 0.95rem;
}

.result-actions {
  display: flex;
  gap: 0.5rem;
}

/* ---------- Feature Cards ---------- */
.features {
  padding: 5rem 0;
}

.features .section-title {
  text-align: center;
  margin-bottom: 3rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  transition: all var(--transition);
  height: 100%;
}

.feature-card:hover {
  transform: translateY(-6px);
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}

.feature-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  font-size: 1.8rem;
  transition: background var(--transition);
}

.feature-card:hover .feature-icon {
  background: linear-gradient(135deg, var(--primary), var(--accent));
}

.feature-card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.feature-card p {
  font-size: 0.9rem;
}

/* ---------- How It Works ---------- */
.how-it-works {
  padding: 5rem 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.step-card {
  text-align: center;
  position: relative;
  padding: 2rem 1rem;
}

.step-number {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-weight: 800;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
}

.step-card h4 {
  margin-bottom: 0.5rem;
}

.step-card p {
  font-size: 0.9rem;
}

/* ---------- Toast Notification ---------- */
.toast-axly {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 8px 32px rgba(0, 212, 170, 0.2);
  transform: translateY(120%);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 9999;
  pointer-events: none;
}

.toast-axly.show {
  transform: translateY(0);
  opacity: 1;
}

/* ---------- Footer ---------- */
.footer-axly {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 3rem 0 1.5rem;
  margin-top: auto;
}

.footer-brand {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-heading);
  margin-bottom: 0.5rem;
}

.footer-brand .brand-highlight {
  color: var(--primary);
}

.footer-text {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: color var(--transition);
}

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

.footer-title {
  color: var(--text-heading);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.footer-bottom {
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  padding-top: 1.25rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ---------- Page Header (inner pages) ---------- */
.page-header {
  padding: 5rem 0 3rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: '';
  position: absolute;
  top: -40%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
  opacity: 0.15;
  pointer-events: none;
}

.page-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.75rem);
  position: relative;
}

.page-header .lead {
  color: var(--text-muted);
  max-width: 600px;
  margin: 0.75rem auto 0;
  position: relative;
}

/* ---------- Content Card ---------- */
.content-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  margin-bottom: 2rem;
}

.content-card h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--primary);
}

.content-card h3 {
  font-size: 1.15rem;
  margin: 1.5rem 0 0.75rem;
}

.content-card ul,
.content-card ol {
  padding-left: 1.5rem;
  color: var(--text-muted);
}

.content-card li {
  margin-bottom: 0.4rem;
  line-height: 1.7;
}

/* ---------- Contact Form ---------- */
.contact-form .form-label {
  color: var(--text);
  font-weight: 500;
  margin-bottom: 0.4rem;
}

.contact-form .form-control {
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 0.85rem 1rem;
  font-family: var(--font);
  transition: all var(--transition);
}

.contact-form .form-control::placeholder {
  color: var(--text-muted);
  opacity: 0.5;
}

.contact-form .form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
  background: var(--bg-input);
  color: var(--text);
}

/* ---------- Redirect Page ---------- */
.redirect-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
  text-align: center;
  padding: 2rem;
}

.spinner {
  width: 56px;
  height: 56px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 1.5rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.error-state {
  display: none;
}

.error-state.show {
  display: block;
}

.loading-state.hide {
  display: none;
}

/* ---------- Error Page (404) ---------- */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
  text-align: center;
  padding: 2rem;
}

.error-code {
  font-size: 8rem;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 1rem;
}

/* ---------- Utilities ---------- */
.section-title {
  margin-bottom: 1rem;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 550px;
  margin: 0 auto;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .shortener-input-group {
    flex-direction: column;
  }

  .shortener-card {
    padding: 1.5rem;
  }

  .result-box {
    flex-direction: column;
    align-items: stretch;
  }

  .result-actions {
    justify-content: stretch;
  }

  .result-actions button,
  .result-actions a {
    flex: 1;
    justify-content: center;
  }

  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }

  .content-card {
    padding: 1.5rem;
  }

  .footer-axly .row > div {
    margin-bottom: 1.5rem;
  }
}

@media (max-width: 576px) {
  .hero {
    padding: 4rem 0 2.5rem;
  }

  .btn-axly {
    width: 100%;
    justify-content: center;
  }

  .error-code {
    font-size: 5rem;
  }
}
