/* ============================================================
   LI Post Formatter & Previewer — Custom Styles
   Companion to Tailwind utility classes in index.html
   ============================================================ */

/* ---- Base & Reset Enhancements ---- */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: #f8fafc;
  color: #0f172a;
}

::selection {
  background-color: #0a66c2;
  color: #ffffff;
}

/* ---- Hero Mesh Gradient ---- */
.hero-gradient {
  background:
    radial-gradient(ellipse 80% 60% at 20% 40%, rgba(10, 102, 194, 0.12) 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 80% 30%, rgba(124, 58, 237, 0.10) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 50% 80%, rgba(6, 182, 212, 0.08) 0%, transparent 70%),
    linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

/* ---- Animated Gradient Text ---- */
.gradient-text {
  background: linear-gradient(135deg, #0a66c2 0%, #7c3aed 50%, #06b6d4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 200% 200%;
  animation: gradientShift 6s ease-in-out infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ---- Floating Badge Pulse ---- */
.badge-pulse {
  animation: badgePulse 3s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(10, 102, 194, 0.15); }
  50% { box-shadow: 0 0 0 8px rgba(10, 102, 194, 0); }
}

/* ---- Toolbar Button Styles ---- */
.toolbar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #475569;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  user-select: none;
}

.toolbar-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.toolbar-btn:active {
  transform: translateY(0);
  box-shadow: none;
  background: #e2e8f0;
}

.toolbar-btn.active {
  background: #0a66c2;
  border-color: #0a66c2;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(10, 102, 194, 0.3);
}

.toolbar-btn[title]::after {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 8px;
  background: #0f172a;
  color: #ffffff;
  font-size: 11px;
  font-weight: 500;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 50;
}

.toolbar-btn:hover[title]::after {
  opacity: 1;
}

.toolbar-separator {
  width: 1px;
  height: 24px;
  background: #e2e8f0;
  margin: 0 4px;
  align-self: center;
}

/* ---- Editor Textarea ---- */
.editor-textarea {
  width: 100%;
  min-height: 280px;
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 0 0 12px 12px;
  background: #ffffff;
  color: #0f172a;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.editor-textarea:focus {
  border-color: #0a66c2;
  box-shadow: 0 0 0 3px rgba(10, 102, 194, 0.1);
}

.editor-textarea::placeholder {
  color: #94a3b8;
}

/* ---- Character Counter Progress Bar ---- */
.char-progress {
  height: 3px;
  border-radius: 2px;
  background: #e2e8f0;
  overflow: hidden;
  transition: all 0.3s ease;
}

.char-progress-fill {
  height: 100%;
  border-radius: 2px;
  background: #0a66c2;
  transition: width 0.2s ease, background-color 0.3s ease;
}

.char-progress-fill.warning {
  background: #f59e0b;
}

.char-progress-fill.danger {
  background: #ef4444;
}

/* ---- Action Buttons ---- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: #0a66c2;
  color: #ffffff;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.btn-primary:hover {
  background: #004182;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(10, 102, 194, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: #ffffff;
  color: #475569;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.btn-ghost:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

.btn-ghost:active {
  background: #f1f5f9;
}

/* ---- LinkedIn Preview Card ---- */
.li-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.03);
}

.li-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 16px 0;
}

.li-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid #e2e8f0;
  background: #f1f5f9;
}

.li-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 32%;
  border-radius: 50%;
  display: block;
}

.li-meta {
  flex: 1;
  min-width: 0;
}

.li-name {
  font-size: 14px;
  font-weight: 700;
  color: #000000;
  line-height: 1.3;
}

.li-tagline {
  font-size: 12px;
  color: #666666;
  line-height: 1.3;
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.li-timestamp {
  font-size: 12px;
  color: #666666;
  line-height: 1.3;
  margin-top: 1px;
  display: flex;
  align-items: center;
  gap: 2px;
}

.li-card-body {
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.42;
  color: #000000;
  word-break: break-word;
  white-space: pre-wrap;
  position: relative;
}

.li-see-more {
  color: #666666;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
}

.li-see-more:hover {
  color: #0a66c2;
  text-decoration: underline;
}

/* See-more cut-off indicator */
.see-more-indicator {
  position: relative;
  margin: 0 16px;
  padding: 8px 0;
  text-align: center;
}

.see-more-indicator::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: repeating-linear-gradient(
    90deg,
    #f59e0b 0px,
    #f59e0b 6px,
    transparent 6px,
    transparent 12px
  );
}

.see-more-indicator span {
  position: relative;
  background: #ffffff;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 600;
  color: #f59e0b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Reaction bar */
.li-reactions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  font-size: 12px;
  color: #666666;
  border-top: 1px solid #e8e8e8;
}

.li-actions {
  display: flex;
  border-top: 1px solid #e8e8e8;
}

.li-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 8px;
  font-size: 13px;
  font-weight: 600;
  color: #666666;
  background: none;
  border: none;
  cursor: default;
  transition: background 0.15s ease;
}

.li-action-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* ---- Mobile Tab Switcher ---- */
.tab-switcher {
  display: flex;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
}

.tab-btn {
  flex: 1;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  color: #475569;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Inter', system-ui, sans-serif;
}

.tab-btn.active {
  background: #0a66c2;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(10, 102, 194, 0.25);
}

/* ---- Toast Notifications ---- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: #0f172a;
  color: #ffffff;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  animation: toastSlideIn 0.3s ease forwards;
  max-width: 360px;
}

.toast.success {
  background: #059669;
}

.toast.error {
  background: #dc2626;
}

.toast.exit {
  animation: toastSlideOut 0.3s ease forwards;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastSlideOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
}

/* ---- FAQ Accordion ---- */
.faq-item {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.faq-item:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.faq-item.open {
  border-color: #93c5fd;
  box-shadow: 0 4px 16px rgba(10, 102, 194, 0.06);
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: #0f172a;
  text-align: left;
  line-height: 1.4;
  transition: color 0.15s ease;
}

.faq-question:hover {
  color: #0a66c2;
}

.faq-question:focus-visible {
  outline: 2px solid #0a66c2;
  outline-offset: -2px;
}

.faq-chevron {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: #94a3b8;
}

.faq-item.open .faq-chevron {
  transform: rotate(180deg);
  color: #0a66c2;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-item.open .faq-answer {
  max-height: 500px;
}

.faq-answer-inner {
  padding: 0 24px 20px;
  font-size: 15px;
  line-height: 1.7;
  color: #475569;
}

/* ---- Feature Cards ---- */
.feature-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 28px;
  transition: all 0.2s ease;
}

.feature-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  transform: translateY(-2px);
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 16px;
}

/* ---- Guide Section Steps ---- */
.guide-step {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.step-number {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0a66c2, #7c3aed);
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ---- Scroll-triggered fade-in ---- */
.fade-in-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Responsive ---- */
@media (max-width: 767px) {
  .desktop-only {
    display: none !important;
  }

  .mobile-only {
    display: block !important;
  }

  #panel-preview {
    display: none;
  }

  .editor-textarea {
    min-height: 200px;
  }

  .toast-container {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }

  .toast {
    max-width: 100%;
  }
}

@media (min-width: 768px) {
  .mobile-only {
    display: none !important;
  }

  .desktop-only {
    display: flex !important;
  }

  #panel-editor, #panel-preview {
    display: block !important;
  }
}

/* ---- Subtle shine animation for CTA ---- */
.btn-shine {
  position: relative;
  overflow: hidden;
}

.btn-shine::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 40%,
    rgba(255, 255, 255, 0.15) 50%,
    transparent 60%
  );
  animation: btnShine 4s ease-in-out infinite;
}

@keyframes btnShine {
  0%, 100% { transform: translateX(-100%); }
  50% { transform: translateX(100%); }
}

/* ---- Dropdown menus for list options ---- */
.toolbar-dropdown {
  position: relative;
  display: inline-flex;
}

.toolbar-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  z-index: 100;
  display: none;
  min-width: 160px;
}

.toolbar-dropdown-menu.show {
  display: block;
  animation: dropdownIn 0.15s ease;
}

@keyframes dropdownIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-4px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'Inter', system-ui, sans-serif;
  transition: all 0.1s ease;
}

.dropdown-item:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.dropdown-item .item-icon {
  font-size: 16px;
  width: 24px;
  text-align: center;
}

/* ---- Navbar scroll shadow ---- */
.navbar {
  transition: box-shadow 0.3s ease, background-color 0.3s ease;
}

.navbar.scrolled {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ---- Smooth panel transitions ---- */
.panel-editor, .panel-preview {
  transition: opacity 0.2s ease;
}

/* ---- Toolbar group label ---- */
.toolbar-label {
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

/* ═══════════════════════════════════════════
   TYPEGROW-STYLE INSTANT FONT CARDS GRID
   ═══════════════════════════════════════════ */
.font-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 2px 6px rgba(0, 0, 0, 0.02);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}

.font-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.font-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.font-card-badge {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #0a66c2;
  font-weight: 700;
  flex-shrink: 0;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.font-card:hover .font-card-badge {
  background: #e0f2fe;
  color: #0284c7;
  transform: scale(1.05);
}

.font-card-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.25;
}

.font-card-tag {
  font-size: 11px;
  font-weight: 500;
  color: #64748b;
  line-height: 1.2;
}

.font-card-preview-wrapper {
  margin-bottom: 14px;
  flex: 1;
}

.font-card-preview {
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.55;
  color: #0f172a;
  min-height: 75px;
  max-height: 125px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.font-card-preview::-webkit-scrollbar {
  width: 5px;
}

.font-card-preview::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 3px;
}

.font-card-preview.is-placeholder {
  color: #94a3b8;
}

.font-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
}

.font-card-copy-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  background: #0a66c2;
  color: #ffffff;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.font-card-copy-btn:hover {
  background: #004182;
  box-shadow: 0 2px 8px rgba(10, 102, 194, 0.3);
  transform: translateY(-1px);
}

.font-card-copy-btn:active {
  transform: translateY(0);
}

/* Green feedback state for quick copy */
.font-card-copy-btn.copied {
  background: #059669 !important;
  border-color: #059669 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 10px rgba(5, 150, 105, 0.4) !important;
  animation: copySuccessPulse 0.4s ease;
}

@keyframes copySuccessPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.font-card-apply-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 12px;
  background: #ffffff;
  color: #475569;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.font-card-apply-btn:hover {
  background: #f1f5f9;
  color: #0a66c2;
  border-color: #0a66c2;
  transform: translateY(-1px);
}

.font-card-apply-btn:active {
  transform: translateY(0);
}

/* Highlight flash animation when applying to editor */
@keyframes editorHighlightPulse {
  0% { box-shadow: 0 0 0 3px rgba(10, 102, 194, 0.5); }
  50% { box-shadow: 0 0 0 5px rgba(10, 102, 194, 0.25); }
  100% { box-shadow: 0 0 0 0 rgba(10, 102, 194, 0); }
}

.editor-highlight {
  animation: editorHighlightPulse 0.8s ease-out;
}

/* ═══════════════════════════════════════════
   EMOJI PICKER & MEDIA ATTACHMENTS
   ═══════════════════════════════════════════ */
.emoji-picker-menu {
  width: 310px !important;
  max-width: 92vw !important;
}

.emoji-tab-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  transition: all 0.15s ease;
}

.emoji-tab-btn.active {
  background: #ffffff !important;
  color: #0a66c2 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.emoji-item-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  font-size: 20px;
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.12s ease;
  user-select: none;
}

.emoji-item-btn:hover {
  background: #f1f5f9;
  transform: scale(1.18);
}

.emoji-item-btn:active {
  transform: scale(0.95);
}

/* Drag-and-drop active feedback */
.drag-active {
  border-color: #0a66c2 !important;
  box-shadow: 0 0 0 3px rgba(10, 102, 194, 0.2) !important;
}

.toolbar-btn:disabled {
  pointer-events: none;
}

/* ============================================================
   DARK MODE THEME EXTENSION
   Activates when html has class 'dark'
   ============================================================ */

html.dark {
  color-scheme: dark;
}



/* Dark Navbar */








/* Dark Hero & Badges */




/* Dark Surface Overrides */










/* Dark Typography */






/* Dark Editor & Toolbar */


















/* Dark Dropdowns & Menus */














/* Dark Font Cards */




















/* Dark FAQ Accordion */








/* Dark LinkedIn Mockup Card (Realistic LinkedIn Dark Mode) */














/* Dark Footer */






/* Dark Code tags */


/* ---- Dropdowns & Language Picker ---- */
.dropdown-menu.show,
.toolbar-dropdown-menu.show {
  display: block !important;
}

#lang-menu-dropdown {
  transform-origin: top right;
}

