/* ============================================================
   TOP IMPEX - Custom Styles (works alongside Tailwind CSS CDN)
   ============================================================ */

/* ----- Base / Reset ----- */
html {
  scroll-behavior: smooth;
}

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

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ----- Custom Animations ----- */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-24px); }
  to   { opacity: 1; transform: translateX(0); }
}

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

@keyframes pulse-slow {
  0%, 100% { opacity: 1; }
  50%      { opacity: .7; }
}

.animate-fadeIn      { animation: fadeIn .6s ease-out both; }
.animate-slideUp     { animation: slideUp .6s ease-out both; }
.animate-slideDown   { animation: slideDown .5s ease-out both; }
.animate-slideInLeft { animation: slideInLeft .6s ease-out both; }
.animate-slideInRight{ animation: slideInRight .6s ease-out both; }
.animate-pulse-slow  { animation: pulse-slow 2s ease-in-out infinite; }

/* Staggered delays for lists / cards */
.delay-100 { animation-delay: .1s; }
.delay-200 { animation-delay: .2s; }
.delay-300 { animation-delay: .3s; }
.delay-400 { animation-delay: .4s; }
.delay-500 { animation-delay: .5s; }

/* Animate-on-scroll helper (hidden until observed) */
.aos-hidden {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .7s cubic-bezier(.4,0,.2,1), transform .7s cubic-bezier(.4,0,.2,1);
}
.aos-visible {
  opacity: 1;
  transform: translateY(0);
}

/* AOS directional variants */
.aos-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity .7s cubic-bezier(.4,0,.2,1), transform .7s cubic-bezier(.4,0,.2,1);
}
.aos-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity .7s cubic-bezier(.4,0,.2,1), transform .7s cubic-bezier(.4,0,.2,1);
}
.aos-zoom {
  opacity: 0;
  transform: scale(.9);
  transition: opacity .7s cubic-bezier(.4,0,.2,1), transform .7s cubic-bezier(.4,0,.2,1);
}
.aos-left.aos-visible,
.aos-right.aos-visible,
.aos-zoom.aos-visible {
  opacity: 1;
  transform: translateX(0) scale(1);
}

/* Stagger children animation */
.stagger-children > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .5s cubic-bezier(.4,0,.2,1), transform .5s cubic-bezier(.4,0,.2,1);
}
.stagger-children.aos-visible > *:nth-child(1) { transition-delay: .05s; opacity: 1; transform: translateY(0); }
.stagger-children.aos-visible > *:nth-child(2) { transition-delay: .1s; opacity: 1; transform: translateY(0); }
.stagger-children.aos-visible > *:nth-child(3) { transition-delay: .15s; opacity: 1; transform: translateY(0); }
.stagger-children.aos-visible > *:nth-child(4) { transition-delay: .2s; opacity: 1; transform: translateY(0); }
.stagger-children.aos-visible > *:nth-child(5) { transition-delay: .25s; opacity: 1; transform: translateY(0); }
.stagger-children.aos-visible > *:nth-child(6) { transition-delay: .3s; opacity: 1; transform: translateY(0); }
.stagger-children.aos-visible > *:nth-child(7) { transition-delay: .35s; opacity: 1; transform: translateY(0); }
.stagger-children.aos-visible > *:nth-child(8) { transition-delay: .4s; opacity: 1; transform: translateY(0); }
.stagger-children.aos-visible > *:nth-child(9) { transition-delay: .45s; opacity: 1; transform: translateY(0); }

/* Card hover lift effect */
.card-hover {
  transition: transform .3s cubic-bezier(.4,0,.2,1), box-shadow .3s cubic-bezier(.4,0,.2,1);
}
.card-hover:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0,0,0,.1);
}

/* Float animation for hero elements */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}
.animate-float { animation: float 3s ease-in-out infinite; }

@keyframes floatSlow {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-8px) rotate(2deg); }
}
.animate-float-slow { animation: floatSlow 4s ease-in-out infinite; }

/* Parallax banner background */
.page-banner {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 60%, #1e40af 100%);
  position: relative;
  overflow: hidden;
  min-height: 220px;
  display: flex;
  align-items: center;
}
.page-banner .banner-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: .35;
  transition: transform .3s ease-out;
}

/* Banner decorative shapes */
.page-banner .banner-decor {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.page-banner .banner-decor .shape {
  position: absolute;
  border-radius: 50%;
}
.page-banner .banner-decor .shape-1 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(49,122,193,.2) 0%, transparent 70%);
  top: -100px; right: -50px;
}
.page-banner .banner-decor .shape-2 {
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(167,0,30,.15) 0%, transparent 70%);
  bottom: -80px; left: 10%;
}
.page-banner .banner-decor .shape-3 {
  width: 120px; height: 120px;
  background: rgba(255,255,255,.03);
  top: 20%; right: 25%;
  border: 1px solid rgba(255,255,255,.06);
}
.page-banner .banner-decor .line-1 {
  position: absolute;
  top: 0; bottom: 0; right: 20%;
  width: 1px;
  background: linear-gradient(to bottom, transparent, rgba(255,255,255,.06), transparent);
}
.page-banner .banner-decor .line-2 {
  position: absolute;
  top: 0; bottom: 0; right: 40%;
  width: 1px;
  background: linear-gradient(to bottom, transparent, rgba(255,255,255,.04), transparent);
}
.page-banner .banner-decor .grid-dots {
  position: absolute;
  top: 10px; right: 60px;
  width: 120px; height: 80px;
  background-image: radial-gradient(circle, rgba(255,255,255,.08) 1px, transparent 1px);
  background-size: 16px 16px;
}

/* Banner icon */
.page-banner .banner-icon-wrap {
  position: absolute;
  right: 8%;
  top: 50%;
  transform: translateY(-50%);
  width: 140px; height: 140px;
  border-radius: 50%;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  justify-content: center;
}
.page-banner .banner-icon-wrap::before {
  content: '';
  position: absolute;
  inset: -15px;
  border-radius: 50%;
  border: 1px dashed rgba(255,255,255,.06);
}
.page-banner .banner-icon-wrap::after {
  content: '';
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  background: rgba(49,122,193,.1);
  border: 1px solid rgba(49,122,193,.15);
}
.page-banner .banner-icon {
  font-size: 2.5rem;
  color: rgba(255,255,255,.25);
  position: relative;
  z-index: 2;
  animation: float 3s ease-in-out infinite;
}
@media (max-width: 768px) {
  .page-banner .banner-icon-wrap { display: none; }
}

/* Gradient text */
.gradient-text {
  background: linear-gradient(135deg, #317AC1, #60a5fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Pulse ring for CTA */
@keyframes pulseRing {
  0% { box-shadow: 0 0 0 0 rgba(167,0,30,.4); }
  70% { box-shadow: 0 0 0 12px rgba(167,0,30,0); }
  100% { box-shadow: 0 0 0 0 rgba(167,0,30,0); }
}
.btn-pulse { animation: pulseRing 2s ease-out infinite; }

/* Typing effect for hero */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0; }
}
.cursor-blink::after {
  content: '|';
  animation: blink 1s step-end infinite;
  margin-left: 2px;
  color: #60a5fa;
}

/* Scroll indicator */
@keyframes scrollBounce {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50%      { transform: translateY(8px); opacity: .5; }
}
.scroll-indicator { animation: scrollBounce 2s ease-in-out infinite; }

/* Service icon spin on hover */
.service-icon-hover:hover .service-icon {
  transform: rotateY(180deg);
  transition: transform .6s ease;
}
.service-icon {
  transition: transform .6s ease;
}

/* Timeline animation */
.timeline-item {
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity .5s ease-out, transform .5s ease-out;
}
.timeline-item.aos-visible {
  opacity: 1;
  transform: translateX(0);
}

/* ----- Section Padding Utility ----- */
.section-padding {
  padding-top: 4rem;    /* py-16 */
  padding-bottom: 4rem;
}
@media (min-width: 768px) {
  .section-padding {
    padding-top: 6rem;  /* md:py-24 */
    padding-bottom: 6rem;
  }
}

/* ----- Sticky Header ----- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  transition: box-shadow .3s ease, background-color .3s ease;
}
.site-header.scrolled {
  box-shadow: 0 4px 12px rgba(0, 0, 0, .1);
  background-color: rgba(255, 255, 255, .98);
}

/* ----- Custom Scrollbar (Sidebar) ----- */
.sidebar-scroll::-webkit-scrollbar {
  width: 6px;
}
.sidebar-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-scroll::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, .15);
  border-radius: 3px;
}
.sidebar-scroll::-webkit-scrollbar-thumb:hover {
  background-color: rgba(0, 0, 0, .3);
}
/* Firefox */
.sidebar-scroll {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, .15) transparent;
}

/* ----- Form Focus Styles ----- */
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #2563eb; /* blue-600 */
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .2);
  transition: border-color .2s, box-shadow .2s;
}

input.error,
select.error,
textarea.error {
  border-color: #dc2626; /* red-600 */
  box-shadow: 0 0 0 3px rgba(220, 38, 38, .15);
}

.form-error-message {
  color: #dc2626;
  font-size: .8125rem;
  margin-top: .25rem;
}

/* ----- Mobile Menu ----- */
.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .4);
  z-index: 40;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
}
.mobile-menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

.mobile-menu-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 80%;
  max-width: 320px;
  background: #fff;
  z-index: 45;
  transform: translateX(100%);
  transition: transform .35s cubic-bezier(.4, 0, .2, 1);
  overflow-y: auto;
}
.mobile-menu-panel.active {
  transform: translateX(0);
}

/* ----- Dashboard Card Hover ----- */
.dashboard-card {
  transition: transform .25s ease, box-shadow .25s ease;
}
.dashboard-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .08);
}

/* ----- Gradient Backgrounds (Hero) ----- */
.hero-gradient {
  background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 50%, #0ea5e9 100%);
  color: #fff;
}
.hero-gradient-dark {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 60%, #1e40af 100%);
  color: #fff;
}
.hero-gradient-subtle {
  background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
}

/* ----- Dashboard Sidebar ----- */
.dashboard-sidebar {
  transition: transform .3s cubic-bezier(.4, 0, .2, 1);
}
@media (max-width: 1023px) {
  .dashboard-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 50;
    transform: translateX(-100%);
  }
  .dashboard-sidebar.open {
    transform: translateX(0);
  }
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .4);
  z-index: 45;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
}
.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ----- Modal ----- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}
.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}
.modal-content {
  transform: scale(.95);
  transition: transform .25s ease;
}
.modal-backdrop.active .modal-content {
  transform: scale(1);
}

/* ----- Loading Spinner ----- */
.btn-loading {
  position: relative;
  pointer-events: none;
  color: transparent !important;
}
.btn-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid rgba(255, 255, 255, .3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ----- Notification / Toast ----- */
.notification-enter {
  animation: slideInRight .35s ease-out both;
}
.notification-exit {
  animation: fadeIn .25s ease-in both reverse;
}

/* ----- Table Sorting ----- */
th.sortable {
  cursor: pointer;
  user-select: none;
}
th.sortable::after {
  content: '\2195'; /* up-down arrow */
  margin-left: .375rem;
  opacity: .3;
  font-size: .75rem;
}
th.sortable.asc::after {
  content: '\2191'; /* up arrow */
  opacity: .7;
}
th.sortable.desc::after {
  content: '\2193'; /* down arrow */
  opacity: .7;
}

/* ----- Print Styles (Invoices) ----- */
@media print {
  /* Hide non-printable elements */
  .no-print,
  .site-header,
  .dashboard-sidebar,
  .mobile-menu-panel,
  .mobile-menu-overlay,
  nav,
  footer,
  button,
  .btn {
    display: none !important;
  }

  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 12pt;
    line-height: 1.5;
  }

  /* Invoice layout */
  .invoice-container {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
  }

  .invoice-header {
    border-bottom: 2px solid #000;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
  }

  .invoice-table {
    width: 100%;
    border-collapse: collapse;
  }
  .invoice-table th,
  .invoice-table td {
    border: 1px solid #ccc;
    padding: .5rem .75rem;
    text-align: left;
  }
  .invoice-table th {
    background: #f3f4f6 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .invoice-total {
    font-weight: bold;
    font-size: 14pt;
  }

  /* Avoid page breaks inside important blocks */
  .invoice-table,
  .invoice-header,
  .invoice-summary {
    page-break-inside: avoid;
  }

  a[href]::after {
    content: none !important;
  }
}
