@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&display=swap');

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

:root {
  /* High-Contrast Black & White Developer Theme */
  --bg-dark: #000000; /* Pure black background */
  --bg-card: #0a0a0c; /* Very dark charcoal card base */
  --bg-sidebar: #050507; /* Dark sidebar background */
  --border-glow: rgba(255, 255, 255, 0.08); /* Minimal white border line */
  --border-focus: rgba(255, 255, 255, 0.6); /* High-contrast focus border */

  --text-primary: #ffffff; /* Crisp white */
  --text-secondary: #a1a1aa; /* Light gray text */
  --text-muted: #52525b; /* Medium dark gray text */

  /* Neutral dark-mode accents */
  --purple: #ffffff;
  --purple-glow: rgba(255, 255, 255, 0.15);
  --blue: #ffffff;
  --blue-glow: rgba(255, 255, 255, 0.1);
  --orange: #ffffff;
  --orange-glow: rgba(255, 255, 255, 0.15);

  --danger: #ef4444; /* Standard error color */
  --success: #10b981; /* Standard success color */

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;

  --topbar-h: 70px;
  --sidebar-w: 280px;
}

html,
body {
  height: 100%;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  background-color: var(--bg-dark);
  /* Modern white dots background grid */
  background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1.2px, transparent 1.2px);
  background-size: 24px 24px;
  background-attachment: fixed;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

h1,
h2,
h3,
h4 {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
}

a {
  color: #ffffff;
  text-decoration: none;
  border-bottom: 1px dotted rgba(255, 255, 255, 0.4);
  transition: all 0.2s ease;
}
a:hover {
  color: #ffffff;
  border-bottom-color: #ffffff;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

/* ════════════════════════════════════════
   AUTH PAGES (Sign In / Register)
   ════════════════════════════════════════ */
.auth-wrap {
  min-height: 100vh;
  overflow-y: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  z-index: 2;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: cardFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.auth-logo-icon {
  width: 40px;
  height: 40px;
  background: #ffffff;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 19px;
  color: #000000;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.15);
}

.auth-logo-name {
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.auth-logo-name span {
  color: #ffffff;
  opacity: 0.7;
}

.auth-card h2 {
  font-size: 28px;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.auth-card .subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 32px;
  font-weight: 400;
}

.field {
  margin-bottom: 20px;
}

.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.field input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  outline: none;
  transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.field input::placeholder {
  color: rgba(255, 255, 255, 0.2);
}

.field input:focus {
  border-color: var(--border-focus);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  letter-spacing: 0.01em;
}

.btn-primary {
  background: #ffffff;
  color: #000000;
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
  background: #e4e4e7;
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 10px 25px rgba(255, 255, 255, 0.2);
}

.btn-primary:active {
  transform: translateY(1px) scale(0.97);
  box-shadow: 0 4px 10px rgba(255, 255, 255, 0.1);
}

.auth-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 14.5px;
  color: var(--text-secondary);
}

/* ════════════════════════════════════════
   TOAST NOTIFICATION
   ════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  padding: 16px 24px;
  border-radius: var(--radius-md);
  font-size: 14.5px;
  font-weight: 500;
  z-index: 9999;
  transform: translateY(100px) scale(0.9);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  max-width: 360px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #0a0a0c;
  border: 1px solid var(--border-glow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

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

.toast.success {
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.toast.error {
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

/* ════════════════════════════════════════
   SPINNER / LOADING STATE
   ════════════════════════════════════════ */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-top-color: #000000;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  display: none;
  flex-shrink: 0;
}

.btn-generate.loading .spinner {
  display: block;
}

.btn-generate.loading .btn-label {
  display: none;
}

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

/* ════════════════════════════════════════
   DASHBOARD SHELL
   ════════════════════════════════════════ */
.dashboard-wrap {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  height: 100vh;
  overflow: hidden;
  position: relative;
  z-index: 2;
}

/* ── Topbar ── */
.topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: rgba(5, 5, 7, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glow);
  z-index: 100;
}

.topbar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.topbar-logo-icon {
  width: 34px;
  height: 34px;
  background: #ffffff;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 16px;
  color: #000000;
  font-weight: 800;
  box-shadow: 0 2px 10px rgba(255, 255, 255, 0.15);
}

.topbar-logo span {
  color: #ffffff;
  opacity: 0.7;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.btn-ghost:active {
  transform: translateY(1px);
}

/* ════════════════════════════════════════
   SIDEBAR
   ════════════════════════════════════════ */
.sidebar {
  background: var(--bg-sidebar);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--border-glow);
}

.sidebar-header {
  padding: 24px 20px 16px;
  border-bottom: 1px solid var(--border-glow);
}

.sidebar-header h3 {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  font-weight: 700;
}

.sidebar-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 12px 20px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.08) transparent;
}

.sidebar-list::-webkit-scrollbar {
  width: 4px;
}

.sidebar-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
  margin-bottom: 2px;
  border: 1px solid transparent;
}

.history-item:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateX(4px);
}

.history-item.active {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateX(6px);
}

.history-item-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  display: grid;
  place-items: center;
  font-size: 10px;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.history-item.active .history-item-icon {
  background: #ffffff;
  color: #000000;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.25);
}

.history-item-url {
  flex: 1;
  font-size: 13px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  transition: color 0.2s ease;
}

.history-item:hover .history-item-url {
  color: var(--text-primary);
}

.history-item.active .history-item-url {
  color: #ffffff;
}

.history-item-delete {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 4px;
  opacity: 0;
  transition: all 0.2s ease;
  font-size: 14px;
  flex-shrink: 0;
}

.history-item:hover .history-item-delete {
  opacity: 0.6;
}

.history-item:hover .history-item-delete:hover {
  opacity: 1;
  color: var(--danger);
  background: rgba(239, 68, 68, 0.15);
}

.sidebar-empty {
  padding: 40px 20px;
  text-align: center;
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.8;
}

.sidebar-empty-icon {
  font-size: 28px;
  display: block;
  margin-bottom: 12px;
  opacity: 0.2;
}

/* ════════════════════════════════════════
   MAIN PANEL (Dashboard Content)
   ════════════════════════════════════════ */
.main {
  overflow-y: auto;
  padding: 40px 48px 60px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.08) transparent;
}

.main::-webkit-scrollbar {
  width: 5px;
}

.main::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
}

/* Centers the dashboard layout horizontally */
.main-inner {
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

.main-header {
  margin-bottom: 32px;
}

.main-header h2 {
  font-size: 32px;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.main-header p {
  font-size: 14.5px;
  color: var(--text-secondary);
  font-weight: 400;
}

/* ── URL input row ── */
.input-row {
  display: flex;
  gap: 12px;
  margin-bottom: 36px;
  align-items: stretch;
}

.url-input-wrap {
  flex: 1;
  position: relative;
}

.url-input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  pointer-events: none;
  color: var(--text-muted);
}

.url-input-wrap input {
  width: 100%;
  height: 100%;
  min-height: 52px;
  padding: 0 16px 0 44px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  outline: none;
  transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.url-input-wrap input::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

.url-input-wrap input:focus {
  border-color: var(--border-focus);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1);
}

.btn-generate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 32px;
  height: 52px;
  min-width: 140px;
  background: #ffffff;
  color: #000000;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
}

.btn-generate:hover {
  background: #e4e4e7;
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 10px 25px rgba(255, 255, 255, 0.2);
}

.btn-generate:active {
  transform: translateY(1px) scale(0.97);
  box-shadow: 0 4px 10px rgba(255, 255, 255, 0.1);
}

.btn-generate:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ════════════════════════════════════════
   OUTPUT CARDS
   ════════════════════════════════════════ */
.output-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.output-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  animation: itemFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.output-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  transform: translateY(-4px) scale(1.01);
}

.output-card.full-width {
  grid-column: 1 / -1;
}

.output-card.card-twitter {
  border-top: 3px solid #ffffff;
}

.output-card.card-linkedin {
  border-top: 3px solid #a1a1aa;
}

.output-card.card-blog {
  border-top: 3px solid #52525b;
}

.output-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-glow);
  gap: 12px;
  flex-shrink: 0;
}

.output-platform-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  font-family: 'Inter', sans-serif;
}

.badge-twitter {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.badge-linkedin {
  background: rgba(255, 255, 255, 0.06);
  color: #d4d4d8;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.badge-blog {
  background: rgba(255, 255, 255, 0.06);
  color: #a1a1aa;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-glow);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
  white-space: nowrap;
  flex-shrink: 0;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.copy-btn:active {
  transform: scale(0.95);
}

.copy-btn.copied {
  color: var(--success);
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.1);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.15);
}

.output-card-body {
  padding: 22px 20px;
  flex: 1;
  min-height: 140px;
}

.output-card-body p {
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}

.output-card-body .placeholder-text {
  color: var(--text-muted);
  font-style: italic;
}

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

.output-card:nth-child(1) {
  animation-delay: 0.05s;
}

.output-card:nth-child(2) {
  animation-delay: 0.15s;
}

.output-card:nth-child(3) {
  animation-delay: 0.25s;
}

/* ════════════════════════════════════════
   RESPONSIVE DESIGN
   ════════════════════════════════════════ */
@media (max-width: 900px) {

  html,
  body {
    overflow: auto;
  }

  .dashboard-wrap {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .sidebar {
    display: none;
  }

  .main {
    overflow-y: visible;
    padding: 32px 20px 52px;
  }

  .output-grid {
    grid-template-columns: 1fr;
  }

  .output-card.full-width {
    grid-column: 1;
  }

  .btn-generate {
    min-width: 110px;
    padding: 0 20px;
  }
}

/* ── Interactive Dots Grid & Spotlight Styles ── */
body:has(.auth-wrap) {
  background-image: none !important;
}

.dots-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  /* Radial mask: hides dots in the center (register/login forms) and fades in towards the edges */
  -webkit-mask-image: radial-gradient(circle 320px at 50% 50%, transparent 15%, black 90%);
  mask-image: radial-gradient(circle 320px at 50% 50%, transparent 15%, black 90%);
}

.interactive-dot {
  position: absolute;
  width: 3px;
  height: 3px;
  background: rgba(255, 255, 255, 0.16); /* Made dot opacity stronger at the edges */
  border-radius: 50%;
  pointer-events: auto;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.2s, box-shadow 0.2s;
}

@keyframes dotWiggle {
  0%, 100% { transform: translate(0, 0) scale(3.5); }
  20% { transform: translate(-3px, 2px) scale(3.5); }
  40% { transform: translate(3px, -2px) scale(3.5); }
  60% { transform: translate(-2px, -3px) scale(3.5); }
  80% { transform: translate(2px, 3px) scale(3.5); }
}

.interactive-dot:hover {
  background: #ffffff;
  box-shadow: 0 0 10px #ffffff;
  animation: dotWiggle 0.4s linear infinite;
  z-index: 10;
  cursor: pointer;
}

/* Cursor Follow Spotlight Shade for Dashboard Background */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle 250px at var(--mouse-x, -999px) var(--mouse-y, -999px), rgba(255, 255, 255, 0.04), transparent 80%);
  pointer-events: none;
  z-index: 1; /* Above static dot background, below dashboard-wrap */
}