/* SmartInvoiceGen Custom Styles — CSS-Only Animations */

/* ========== BASE ========== */
html {
  scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #f8fafc;
}
::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* ========== ENTRANCE ANIMATIONS (CSS-only, no JS) ========== */

/* Fade-in-up — triggers on page load via animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Base animation class — applied to elements that should animate on load */

/* Animation classes */
.fade-in {
  animation: fadeInUp 0.7s ease-out both;
}

.stagger-children > * {
  animation: fadeInUp 0.5s ease-out both;
}
.stagger-children > *:nth-child(1) {
  animation-delay: 0.05s;
}
.stagger-children > *:nth-child(2) {
  animation-delay: 0.15s;
}
.stagger-children > *:nth-child(3) {
  animation-delay: 0.25s;
}
.stagger-children > *:nth-child(4) {
  animation-delay: 0.35s;
}
.stagger-children > *:nth-child(5) {
  animation-delay: 0.45s;
}
.stagger-children > *:nth-child(6) {
  animation-delay: 0.55s;
}

/* Card entrance — used standalone or inside stagger containers */
.animate-card {
  animation: fadeInUp 0.6s ease-out both;
}

/* ========== HERO PARTICLES (CSS-only) ========== */
.particles-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.particle {
  position: absolute;
  font-size: 24px;
  animation: floatParticle linear infinite;
  opacity: 0;
}

/* Create 15 static particles via CSS — each with unique position/delay/duration */
.particle:nth-child(1) {
  left: 5%;
  animation-duration: 14s;
  animation-delay: 0s;
  font-size: 20px;
}
.particle:nth-child(2) {
  left: 12%;
  animation-duration: 18s;
  animation-delay: 2s;
  font-size: 26px;
}
.particle:nth-child(3) {
  left: 22%;
  animation-duration: 12s;
  animation-delay: 4s;
  font-size: 18px;
}
.particle:nth-child(4) {
  left: 30%;
  animation-duration: 16s;
  animation-delay: 1s;
  font-size: 28px;
}
.particle:nth-child(5) {
  left: 40%;
  animation-duration: 20s;
  animation-delay: 5s;
  font-size: 22px;
}
.particle:nth-child(6) {
  left: 48%;
  animation-duration: 13s;
  animation-delay: 3s;
  font-size: 24px;
}
.particle:nth-child(7) {
  left: 55%;
  animation-duration: 17s;
  animation-delay: 0s;
  font-size: 20px;
}
.particle:nth-child(8) {
  left: 62%;
  animation-duration: 15s;
  animation-delay: 6s;
  font-size: 30px;
}
.particle:nth-child(9) {
  left: 70%;
  animation-duration: 19s;
  animation-delay: 2s;
  font-size: 18px;
}
.particle:nth-child(10) {
  left: 78%;
  animation-duration: 14s;
  animation-delay: 4s;
  font-size: 22px;
}
.particle:nth-child(11) {
  left: 85%;
  animation-duration: 16s;
  animation-delay: 1s;
  font-size: 26px;
}
.particle:nth-child(12) {
  left: 92%;
  animation-duration: 11s;
  animation-delay: 7s;
  font-size: 20px;
}
.particle:nth-child(13) {
  left: 15%;
  animation-duration: 18s;
  animation-delay: 8s;
  font-size: 24px;
}
.particle:nth-child(14) {
  left: 35%;
  animation-duration: 13s;
  animation-delay: 3s;
  font-size: 28px;
}
.particle:nth-child(15) {
  left: 50%;
  animation-duration: 21s;
  animation-delay: 5s;
  font-size: 16px;
}

/* Alternate animation direction for variety */
.particle:nth-child(odd) {
  animation-name: floatParticle;
}
.particle:nth-child(even) {
  animation-name: floatParticleAlt;
}

@keyframes floatParticle {
  0% {
    transform: translateY(0) translateX(0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.1;
  }
  90% {
    opacity: 0.1;
  }
  100% {
    transform: translateY(-110vh) translateX(40px) rotate(360deg);
    opacity: 0;
  }
}

@keyframes floatParticleAlt {
  0% {
    transform: translateY(0) translateX(0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.08;
  }
  90% {
    opacity: 0.08;
  }
  100% {
    transform: translateY(-110vh) translateX(-30px) rotate(-360deg);
    opacity: 0;
  }
}

/* ========== SKIP LINK ========== */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: #2563eb;
  color: #fff;
  padding: 10px 20px;
  z-index: 99999;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus {
  top: 0;
  outline: 3px solid #93c5fd;
  outline-offset: 2px;
}

/* ========== CARD & BUTTON EFFECTS ========== */
.card-hover {
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}
.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.btn-pulse {
  position: relative;
  z-index: 1;
}

.btn-pulse::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.4);
  pointer-events: none;
  z-index: -1;
  animation: btnPulse 2s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}

@keyframes btnPulse {
  0% {
    transform: scale(0.95);
    opacity: 1;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: scale(1.15);
    opacity: 0;
  }
}

/* ========== FAQ — Native <details>/<summary> Accordion ========== */
details.faq-item {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  background: white;
  margin-bottom: 4px;
  transition: border-color 0.2s;
}
details.faq-item[open] {
  border-color: #2563eb;
}
details.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  font-weight: 500;
  color: #1e293b;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: color 0.2s;
}
details.faq-item summary:hover {
  color: #2563eb;
}
details.faq-item summary::-webkit-details-marker {
  display: none;
}
details.faq-item summary::after {
  content: "+";
  font-size: 22px;
  font-weight: 700;
  color: #2563eb;
  flex-shrink: 0;
  margin-left: 16px;
  transition: transform 0.25s ease;
}
details.faq-item[open] summary::after {
  content: "\2212";
  transform: rotate(0deg);
}
details.faq-item .faq-body {
  padding: 0 24px 20px;
  font-size: 14px;
  color: #64748b;
  line-height: 1.7;
}

/* ========== NAVBAR SCROLL (CSS-only) ========== */
#navbar {
  transition:
    background-color 0.3s ease,
    box-shadow 0.3s ease;
}

/* ========== INVOICE PREVIEW STYLES ========== */
.invoice-preview {
  background: white;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  padding: 32px;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #1e293b;
  font-size: 14px;
  line-height: 1.6;
}
.invoice-preview h2 {
  font-size: 28px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 8px;
}
.invoice-preview table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}
.invoice-preview table th {
  background: #2563eb;
  color: white;
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.invoice-preview table td {
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 13px;
}
.invoice-preview table tr:last-child td {
  border-bottom: none;
}
.invoice-preview .total-row {
  font-weight: 700;
  font-size: 16px;
  color: #2563eb;
}
.invoice-preview .preview-logo {
  max-width: 120px;
  max-height: 60px;
  object-fit: contain;
}

/* ========== FORMS & UPLOAD ========== */
.logo-upload-area {
  border: 2px dashed #cbd5e1;
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease;
}
.logo-upload-area:hover {
  border-color: #2563eb;
  background-color: #eff6ff;
}
.logo-upload-area.has-logo {
  border-style: solid;
  border-color: #22c55e;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ========== PRINT STYLES ========== */
@media print {
  body * {
    visibility: hidden;
  }
  .print-area,
  .print-area * {
    visibility: visible;
  }
  .print-area {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    padding: 20px;
  }
  .no-print {
    display: none !important;
  }
}

/* ========== MOBILE MENU ========== */
/* .mobile-menu {
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.mobile-menu.open {
  transform: translateX(0);
  opacity: 1;
} */

/* ========== TOOLTIP ========== */
/* .tooltip {
  position: relative;
}
.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #1E293B;
  color: white;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.tooltip:hover::after {
  opacity: 1;
} */

/* ========== AD PLACEMENTS ========== */
.ad-container {
  position: relative;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  overflow: hidden;
  margin: 24px 0;
}
.ad-container[data-ad]::before {
  content: "Advertisement";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  pointer-events: none;
  z-index: 0;
}
.ad-banner {
  min-height: 90px;
}
.ad-rectangle {
  min-height: 250px;
}
.ad-native {
  min-height: 120px;
}
/* .ad-inline   { min-height: 60px; margin: 16px 0; } */
.ad-label {
  font-size: 10px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  text-align: center;
  margin-bottom: 4px;
  user-select: none;
}
@media (max-width: 640px) {
  .ad-container {
    min-height: 60px;
    margin: 16px 0;
  }
  .ad-banner {
    min-height: 60px;
  }
  .ad-rectangle {
    min-height: 200px;
  }
}
.ad-container[aria-hidden="true"] {
  display: none;
  min-height: 0;
  margin: 0;
}
