/* ===== ShipFlow Animations & Micro-interactions ===== */

/* --- Keyframes --- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
@keyframes shimmer {
  0% { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes ripple {
  0% { transform: scale(0); opacity: 0.6; }
  100% { transform: scale(4); opacity: 0; }
}
@keyframes glow {
  0%, 100% { box-shadow: 0 0 5px rgba(255,107,26,0.2); }
  50% { box-shadow: 0 0 20px rgba(255,107,26,0.5); }
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  30% { transform: translateY(-8px); }
  60% { transform: translateY(-4px); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* --- Animation Classes (scroll-triggered) --- */
.animate-fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.animate-fade-up.in-view {
  opacity: 1;
  transform: translateY(0);
}
.animate-scale-in {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.animate-scale-in.in-view {
  opacity: 1;
  transform: scale(1);
}

/* --- Floating cards --- */
.floating-card { animation: float 4s ease-in-out infinite; }
.floating-card.fc2 { animation-delay: 1.5s; }

/* --- Navbar scroll effect --- */
.nav { transition: background 0.3s ease, box-shadow 0.3s ease, padding 0.3s ease; }
.nav.scrolled {
  background: rgba(10, 12, 20, 0.95);
  backdrop-filter: blur(12px);
  box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

/* --- Button micro-interactions --- */
.btn {
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255,107,26,0.25);
}
.btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(255,107,26,0.15);
}
.btn::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  transform: translate(-50%,-50%);
  transition: width 0.4s ease, height 0.4s ease;
}
.btn:active::after {
  width: 200px; height: 200px;
}

/* --- Card hover effects --- */
.service-card, .feature, .price-card, .worker-card, .testimonial-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.service-card:hover, .feature:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.3);
  border-color: var(--accent);
}
.price-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.3);
}
.worker-card:hover {
  transform: translateY(-4px);
}

/* --- Link hover underline --- */
.nav-links a, .footer-grid a {
  transition: color 0.2s ease;
  position: relative;
}
.nav-links a:not(.btn)::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
}
.nav-links a:not(.btn):hover::after {
  width: 100%;
}

/* --- Input focus glow --- */
input, textarea, select {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(255,107,26,0.15);
  outline: none;
}

/* --- Loading skeleton --- */
.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--bg2) 50%, var(--surface) 75%);
  background-size: 1000px 100%;
  animation: shimmer 2s infinite linear;
  border-radius: 8px;
  display: inline-block;
}
.skeleton-line { height: 14px; margin-bottom: 8px; width: 100%; }
.skeleton-line.short { width: 60%; }
.skeleton-box { height: 80px; width: 100%; margin-bottom: 12px; }
.skeleton-circle { height: 40px; width: 40px; border-radius: 50%; }

/* --- Spinner --- */
.spinner {
  width: 24px; height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.spinner-lg { width: 40px; height: 40px; border-width: 4px; }

/* --- Pulse indicator (live status) --- */
.pulse-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #22c55e;
  animation: pulse 1.5s infinite;
  margin-right: 6px;
}

/* --- Modal transitions --- */
.modal {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.modal.open {
  opacity: 1;
  pointer-events: auto;
}
.modal-card {
  transform: scale(0.9) translateY(20px);
  transition: transform 0.25s ease;
}
.modal.open .modal-card {
  transform: scale(1) translateY(0);
}

/* --- View transition --- */
.view {
  animation: fadeIn 0.3s ease;
}

/* --- Table row hover --- */
tbody tr {
  transition: background 0.15s ease;
}
tbody tr:hover {
  background: rgba(255,107,26,0.05);
}

/* --- Tag pill pulse --- */
.tag-pill {
  transition: transform 0.15s ease;
}
.tag-pill:hover {
  transform: scale(1.05);
}

/* --- Glowing accent badge --- */
.hero-badge {
  animation: glow 3s ease-in-out infinite;
}

/* --- Testimonials --- */
.testimonials {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}
.testimonial-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
}
.testimonial-card .stars {
  color: #ffc107;
  font-size: 18px;
  letter-spacing: 2px;
  margin-bottom: 14px;
}
.testimonial-card p {
  color: var(--text);
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 20px;
  font-style: italic;
}
.testimonial-author {
  display: flex;
  align-items: center;
  gap: 12px;
}
.testimonial-author .avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  font-size: 15px;
}
.testimonial-author strong { display: block; color: var(--text); font-size: 14px; }
.testimonial-author span { display: block; color: var(--muted); font-size: 12px; }

/* --- FAQ --- */
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color 0.2s;
}
.faq-item:hover { border-color: rgba(255,107,26,0.3); }
.faq-item.open { border-color: var(--accent); }
.faq-q {
  padding: 18px 22px;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text);
  user-select: none;
}
.faq-icon {
  font-size: 22px;
  color: var(--accent);
  transition: transform 0.3s ease;
  font-weight: 300;
}
.faq-item.open .faq-icon { transform: rotate(45deg); }
.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 22px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}
.faq-item.open .faq-a {
  max-height: 300px;
  padding: 0 22px 18px;
}

/* --- Progress bar --- */
.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar .fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--cyan));
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* --- Notification badge bounce --- */
.badge-bounce {
  animation: bounce 0.5s ease;
}

/* --- Tooltip --- */
[data-tooltip] {
  position: relative;
}
[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%; left: 50%;
  transform: translateX(-50%);
  background: var(--bg);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  border: 1px solid var(--border);
  z-index: 1000;
}
[data-tooltip]:hover::before {
  opacity: 1;
}

/* --- Page load fade --- */
body { animation: fadeIn 0.4s ease; }

/* --- Responsive --- */
@media (max-width: 768px) {
  .testimonials { grid-template-columns: 1fr; }
  .animate-fade-up, .animate-scale-in {
    opacity: 1;
    transform: none;
  }
}

/* --- Print --- */
@media print {
  .animate-fade-up, .animate-scale-in { opacity: 1 !important; transform: none !important; }
}

/* --- Responsive grid layouts for new features --- */
@media (max-width: 900px) {
  .analytics-grid { grid-template-columns: 1fr !important; }
  .analytics-grid3 { grid-template-columns: 1fr !important; }
  .sms-grid { grid-template-columns: 1fr !important; }
}
