/* SignPaperless - Custom CSS Components */
/* Design System: Modern SaaS (Stripe / Linear / Notion inspired) */

/* ==========================================
   CSS VARIABLES & ROOT STYLES
   ========================================== */
:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --success: #10b981;
  --success-light: #d1fae5;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --info: #3b82f6;
  --info-light: #dbeafe;
}

/* Dark mode variables */
.dark {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --border-color: #334155;
}

.sticky-header {
  position: sticky;
  top: 0;
  z-index: 20;
  /* high enough to stay above tbody */
  background-color: inherit;
  /* ensures background covers content */
}

.sticky-header th {
  background-color: #f9fafb;
  /* or your desired opaque background */
}

.dark .sticky-header th {
  background-color: #1e293b;
}

.modal-content {
  border: none !important;
}

/* ==========================================
   PREFERS COLOR SCHEME (OS Level)
   ========================================== */
@media (prefers-color-scheme: dark) {
  html:not(.light) {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #334155;
  }
}

/* ==========================================
   SMOOTH TRANSITIONS
   ========================================== */
* {
  transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

/* ==========================================
   CUSTOM SCROLLBAR
   ========================================== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

.dark ::-webkit-scrollbar-track {
  background: #1e293b;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.dark ::-webkit-scrollbar-thumb {
  background: #475569;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ==========================================
   SIDEBAR STYLES
   ========================================== */
.sidebar {
  transition: transform 0.3s ease-in-out, width 0.3s ease-in-out;
}

.sidebar-collapsed {
  transform: translateX(-100%);
}

.bg-indigo-600 {
  background-color: #1b6dba !important;
}

.focus\:ring-indigo-500:focus {
  border-color: #86b7fe !important;
}

.tailwind-table p {
  text-align: left;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  max-width: 222px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-dialog .flex.items-center.justify-between.p-6.border-b.border-gray-100.dark\:border-slate-700 {
  padding: 10px 20px !important;
}

.modal-footer {
    background: #f6f8fb;
    border-top: 1px solid #dce1e7 !important;
}

.links-btn .rule-class {
  background-color: #fff;
}

.info-tooltip img {
  width: 21px;
  height: 21px;
  cursor: pointer;
}

.accrodian-scroll td.no-rec-found-wrap.rules-not-found {
  position: absolute;
}

.ngx-pagination a,
.ngx-pagination button {
  cursor: pointer;
  display: flex;
  border: 1px solid #e5e7eb;
  font-size: 0.875rem;
  line-height: 1.25rem;
  border-radius: 0.5rem !important;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  /* width: 4rem; */
  height: 2rem;
  margin-left: 6px;
}

li.pagination-next>a {
  display: flex;
  border: 1px solid #e5e7eb;
  font-size: 0.875rem;
  line-height: 1.25rem;
  border-radius: 0.5rem !important;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  width: 4rem;
  height: 2rem;
}

ul.ngx-pagination li.current {
  margin-left: 6px;
}

.ngx-pagination .current {
  padding: .1875rem .625rem;
  background: #1b6dba;
  color: #fefefe;
  cursor: default;
  border-radius: 0.5rem !important;
}

[role=button], button {
    cursor: pointer;
}
a, a * {
    cursor: pointer;
}

.tab-active {
  border-bottom: 2px solid #1b6dba !important;
}

button.px-1.py-4.text-sm.font-medium.border-b-2.-mb-px.tab-active.border-indigo-600.text-indigo-600 {
    color: #1b6dba !important;
}

.border-indigo-600 {
    border-color: #1b6dba !important;
}

.border-indigo-600 {
  border-color: #1b6dba !important;
}

@media (max-width: 768px) {
  .w-\[500px\].relative button {
      bottom: 36px !important;
  }
}

@media (min-width: 1024px) {
  .sidebar-collapsed {
    transform: translateX(0);
    width: 5rem !important;
  }

  .sidebar-collapsed .sidebar-text {
    display: none;
  }

  .sidebar-collapsed .nav-badge {
    display: none;
  }

  .sidebar-collapsed nav {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .sidebar-collapsed .nav-link {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
  }

  .sidebar-collapsed .nav-link i {
    margin-right: 0;
  }

  .sidebar-collapsed .sidebar-collapsed-show {
    display: flex !important;
  }
}

/* Sidebar nav link base */
.nav-link {
  position: relative;
}

/* Sidebar nav item active state - solid blue pill */
.nav-link.active,
.nav-item-active {
  background-color: #1b6dba !important;
  color: white !important;
}

.nav-link.active i,
.nav-item-active i {
  color: white !important;
}

.dark .nav-link.active,
.dark .nav-item-active {
  background-color: #1b6dba !important;
}

/* ==========================================
   CARD HOVER EFFECTS
   ========================================== */
.card-hover {
  transition: all 0.2s ease;
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.15);
}

/* ==========================================
   BUTTON STYLES
   ========================================== */
.btn-primary {
  background: #1b6dba;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.btn-primary:hover {
  /* background: linear-gradient(135deg, #4338ca 0%, #4f46e5 100%); */
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
  transform: translateY(-1px);
}

table.w-full tbody td .flex.items-center.justify-center.space-x-1.opacity-0.group-hover\:opacity-100.transition-opacity.duration-200 {
  opacity: 1 !important;
}

a.feature-card.card-hover {
  padding: 1.25rem !important;
}

nav.tamplate_nav button.nav-link.active {
  text-transform: capitalize !important;
  color: #1b6dba !important;
  background: transparent !important;
  border: none;
  border-bottom: 1px solid #1b6dba !important;
}

.btn-secondary {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.dark .btn-secondary {
  background: #334155;
  border-color: #475569;
  color: #f1f5f9;
}

.dark .btn-secondary:hover {
  background: #475569;
}

/* ==========================================
   TABLE STYLES
   ========================================== */
.table-row-hover {
  transition: background-color 0.15s ease;
}

.table-row-hover:hover {
  background-color: #f8fafc;
}

.dark .table-row-hover:hover {
  background-color: rgba(30, 41, 59, 0.5);
}

/* Improved table header styles */
thead th {
  font-weight: 600;
  letter-spacing: 0.025em;
}

/* Table row selected state */
.table-row-selected {
  background-color: #eef2ff !important;
  border-left: 3px solid #4f46e5;
}

.dark .table-row-selected {
  background-color: rgba(79, 70, 229, 0.1) !important;
}

/* Striped table variant */
.table-striped tbody tr:nth-child(even) {
  background-color: rgba(248, 250, 252, 0.5);
}

.dark .table-striped tbody tr:nth-child(even) {
  background-color: rgba(30, 41, 59, 0.3);
}

/* Table responsive shadow indicators */
.table-scroll-shadow-left {
  box-shadow: inset 12px 0 8px -8px rgba(0, 0, 0, 0.04);
}

.table-scroll-shadow-right {
  box-shadow: inset -12px 0 8px -8px rgba(0, 0, 0, 0.04);
}

/* Sticky header */
.sticky-header {
  position: sticky;
  top: 0;
  z-index: 10;
}

/* ==========================================
   STATUS BADGES
   ========================================== */
.badge-success {
  background-color: #d1fae5;
  color: #065f46;
}

.dark .badge-success {
  background-color: #064e3b;
  color: #6ee7b7;
}

.badge-warning {
  background-color: #fef3c7;
  color: #92400e;
}

.dark .badge-warning {
  background-color: #78350f;
  color: #fcd34d;
}

.badge-danger {
  background-color: #fee2e2;
  color: #991b1b;
}

.dark .badge-danger {
  background-color: #7f1d1d;
  color: #fca5a5;
}

.badge-info {
  background-color: #dbeafe;
  color: #1e40af;
}

.dark .badge-info {
  background-color: #1e3a8a;
  color: #93c5fd;
}

.badge-draft {
  background-color: #f1f5f9;
  color: #475569;
}

.dark .badge-draft {
  background-color: #334155;
  color: #cbd5e1;
}

/* ==========================================
   FORM STYLES
   ========================================== */
.form-input {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* ==========================================
   MODAL STYLES
   ========================================== */
.modal-overlay {
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal-content {
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ==========================================
   OVERLAY PANEL STYLES (Slide-in)
   ========================================== */
.overlay-backdrop {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.overlay-backdrop.active {
  opacity: 1;
}

.overlay-panel {
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.overlay-panel.active {
  transform: translateX(0);
}

/* Left slide variant */
.overlay-panel.from-left {
  left: 0;
  right: auto;
  transform: translateX(-100%);
}

.overlay-panel.from-left.active {
  transform: translateX(0);
}

/* Bottom slide variant */
.overlay-panel.from-bottom {
  top: auto;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 100%;
  height: auto;
  max-height: 90vh;
  transform: translateY(100%);
  border-radius: 1.5rem 1.5rem 0 0;
}

.overlay-panel.from-bottom.active {
  transform: translateY(0);
}

/* ==========================================
   TAB STYLES
   ========================================== */
.tab-active {
  border-bottom: 2px solid #4f46e5;
  color: #4f46e5;
}

.dark .tab-active {
  border-bottom-color: #818cf8;
  color: #818cf8;
}

/* ==========================================
   CHART PLACEHOLDER STYLES
   ========================================== */
.chart-bar {
  animation: chartGrow 0.8s ease-out;
  transform-origin: bottom;
}

@keyframes chartGrow {
  from {
    transform: scaleY(0);
  }

  to {
    transform: scaleY(1);
  }
}

/* ==========================================
   DROPDOWN STYLES
   ========================================== */
.dropdown-menu {
  animation: dropdownFadeIn 0.15s ease-out;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================
   NOTIFICATION DOT
   ========================================== */
.notification-dot {
  animation: pulse 2s infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

/* ==========================================
   LOADING SKELETON
   ========================================== */
.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

.dark .skeleton {
  background: linear-gradient(90deg, #334155 25%, #475569 50%, #334155 75%);
  background-size: 200% 100%;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* ==========================================
   GRADIENT TEXT
   ========================================== */
.gradient-text {
  background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ==========================================
   GLASS EFFECT
   ========================================== */
.glass {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.dark .glass {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(71, 85, 105, 0.3);
}

/* ==========================================
   AVATAR GROUP
   ========================================== */
.avatar-group>* {
  margin-left: -8px;
  border: 2px solid white;
}

.avatar-group>*:first-child {
  margin-left: 0;
}

.dark .avatar-group>* {
  border-color: #1e293b;
}

/* ==========================================
   PROGRESS BAR
   ========================================== */
.progress-bar {
  transition: width 0.5s ease;
}

/* ==========================================
   TIMELINE STYLES
   ========================================== */


.timeline-item:last-child::before {
  display: none;
}

.dark .timeline-item::before {
  background-color: #334155;
}

/* ==========================================
   INLINE QUICK ACTIONS (Table Rows)
   ========================================== */
.table-row-actions {
  opacity: 0;
  transform: translateX(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

tr:hover .table-row-actions {
  opacity: 1;
  transform: translateX(0);
}

.action-btn {
  @apply w-8 h-8 flex items-center justify-center rounded-lg text-gray-400 hover:text-gray-600 hover:bg-gray-100 dark:hover:text-gray-300 dark:hover:bg-slate-700 transition-all;
}

.action-btn:hover {
  transform: scale(1.1);
}

/* ==========================================
   SKELETON LOADING STATES
   ========================================== */
.skeleton {
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 0.375rem;
}

.dark .skeleton {
  background: linear-gradient(90deg, #334155 25%, #475569 50%, #334155 75%);
  background-size: 200% 100%;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

.skeleton-text {
  height: 1em;
  margin-bottom: 0.5em;
}

.skeleton-text:last-child {
  width: 60%;
}

.skeleton-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
}

/* ==========================================
   DOCUMENT WIZARD STYLES
   ========================================== */

/* Wizard step transitions */
.wizard-step {
  animation: wizardFadeIn 0.3s ease-out;
}

@keyframes wizardFadeIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Mode card selection */
.mode-card {
  transition: all 0.2s ease;
}

.mode-card:hover {
  transform: translateY(-2px);
}

.mode-card.selected {
  border-color: #4f46e5 !important;
  background-color: rgba(238, 242, 255, 0.5) !important;
}

.dark .mode-card.selected {
  background-color: rgba(79, 70, 229, 0.1) !important;
}

/* Document type card */
.doc-type-card {
  transition: all 0.2s ease;
}

.doc-type-card:hover {
  transform: translateY(-2px);
}

/* Selection check marks */
.mode-check,
.doctype-check {
  transition: all 0.2s ease;
}

.mode-check.selected,
.doctype-check.selected {
  background-color: #4f46e5 !important;
  border-color: #4f46e5 !important;
}

/* File upload zone */
#file-upload-zone {
  transition: all 0.2s ease;
}

#file-upload-zone.dragover {
  border-color: #4f46e5;
  background-color: rgba(238, 242, 255, 0.5);
}

.dark #file-upload-zone.dragover {
  background-color: rgba(79, 70, 229, 0.1);
}

/* Wizard progress indicators */
.step-indicator {
  transition: all 0.3s ease;
}

.step-connector {
  transition: background-color 0.3s ease;
}

/* Checkbox styles for wizard */
.wizard-step input[type="checkbox"]:checked {
  background-color: #4f46e5;
  border-color: #4f46e5;
}

/* Form field focus within wizard */
.wizard-step input:focus,
.wizard-step textarea:focus,
.wizard-step select:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* Checkbox card hover state */
.wizard-step label:has(input[type="checkbox"]):hover {
  border-color: rgba(79, 70, 229, 0.5);
}

/* ==========================================
   SETTINGS PAGE STYLES
   ========================================== */

/* Settings card hover effects */
.settings-card {
  position: relative;
  overflow: hidden;
}

.settings-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, transparent);
  transition: all 0.3s ease;
  opacity: 0;
}

.settings-card:hover::before {
  opacity: 1;
}

/* Specific gradient borders for each card type */
.settings-card:hover::before {
  background: linear-gradient(90deg, var(--card-accent, #4f46e5), var(--card-accent, #4f46e5));
}

/* Keyboard shortcut badge */
.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.15rem 0.4rem;
  font-size: 0.7rem;
  font-weight: 500;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, monospace;
  color: #64748b;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 1px 0 0 #fff inset;
}

.dark .kbd {
  color: #94a3b8;
  background: linear-gradient(180deg, #334155 0%, #1e293b 100%);
  border-color: #475569;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 1px 0 0 rgba(255, 255, 255, 0.05) inset;
}

/* Security status card pulse animation */
@keyframes securityPulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
  }

  50% {
    box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);
  }
}

.security-pulse {
  animation: securityPulse 2s ease-in-out infinite;
}

/* Settings search input glow effect */
input[placeholder="Search settings..."]:focus {
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

/* Quick settings toggle animation */
.settings-toggle {
  transition: transform 0.2s ease;
}

.settings-toggle:active {
  transform: scale(0.95);
}

/* Recent activity dot animation */
@keyframes activityDot {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.7;
    transform: scale(1.2);
  }
}

.activity-dot-pulse {
  animation: activityDot 2s ease-in-out infinite;
}

/* Settings grid link underline hover effect */
.settings-link-underline {
  position: relative;
}

.settings-link-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: currentColor;
  transition: width 0.3s ease;
}

.settings-link-underline:hover::after {
  width: 100%;
}

/* Staggered animation for settings cards */
@keyframes settingsCardIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.settings-card {
  animation: settingsCardIn 0.4s ease-out backwards;
}

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

.settings-card:nth-child(2) {
  animation-delay: 0.1s;
}

.settings-card:nth-child(3) {
  animation-delay: 0.15s;
}

.settings-card:nth-child(4) {
  animation-delay: 0.2s;
}

.settings-card:nth-child(5) {
  animation-delay: 0.25s;
}

.settings-card:nth-child(6) {
  animation-delay: 0.3s;
}

/* Quick settings card slide-in from right */
@keyframes sidebarSlideIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.lg\:col-span-2+.space-y-6>* {
  animation: sidebarSlideIn 0.5s ease-out backwards;
}

.lg\:col-span-2+.space-y-6>*:nth-child(1) {
  animation-delay: 0.1s;
}

.lg\:col-span-2+.space-y-6>*:nth-child(2) {
  animation-delay: 0.2s;
}

.lg\:col-span-2+.space-y-6>*:nth-child(3) {
  animation-delay: 0.3s;
}

.lg\:col-span-2+.space-y-6>*:nth-child(4) {
  animation-delay: 0.4s;
}

/* Gradient icon backgrounds */
.icon-gradient-indigo {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
}

.icon-gradient-purple {
  background: linear-gradient(135deg, #a855f7 0%, #9333ea 100%);
}

.icon-gradient-emerald {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
}

.icon-gradient-orange {
  background: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
}

.icon-gradient-blue {
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
}

.icon-gradient-rose {
  background: linear-gradient(135deg, #fb7185 0%, #f43f5e 100%);
}

/* Settings form section styles */
.settings-section {
  position: relative;
}

.settings-section::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #4f46e5 0%, transparent 100%);
  border-radius: 3px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.settings-section:hover::before {
  opacity: 1;
}

/* Enhanced focus states for settings inputs */
.settings-input {
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.settings-input:hover {
  border-color: #c7d2fe;
}

.dark .settings-input:hover {
  border-color: #4338ca;
}

.settings-input:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
  background-color: #fafafc;
}

.dark .settings-input:focus {
  background-color: #1e293b;
}

.wizard-step label:has(input[type="checkbox"]:checked) {
  border-color: #4f46e5;
  background-color: rgba(238, 242, 255, 0.5);
}

.dark .wizard-step label:has(input[type="checkbox"]:checked) {
  background-color: rgba(79, 70, 229, 0.1);
}

/* Info box animations */
.wizard-step .bg-blue-50 {
  animation: fadeInUp 0.4s ease-out 0.2s both;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================
   ADVANCE PAGE ENHANCEMENTS
   ========================================== */

/* Feature Card Staggered Animation */
.feature-cards .feature-card {
  opacity: 0;
  transform: translateY(10px);
  animation: fadeInUp 0.4s ease forwards;
}

.feature-cards .feature-card:nth-child(1) {
  animation-delay: 0.02s;
}

.feature-cards .feature-card:nth-child(2) {
  animation-delay: 0.04s;
}

.feature-cards .feature-card:nth-child(3) {
  animation-delay: 0.06s;
}

.feature-cards .feature-card:nth-child(4) {
  animation-delay: 0.08s;
}

.feature-cards .feature-card:nth-child(5) {
  animation-delay: 0.1s;
}

.feature-cards .feature-card:nth-child(6) {
  animation-delay: 0.12s;
}

.feature-cards .feature-card:nth-child(7) {
  animation-delay: 0.14s;
}

.feature-cards .feature-card:nth-child(8) {
  animation-delay: 0.16s;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Feature Card Hover State */
.feature-card {
  position: relative;
}

.feature-card:hover {
  border-color: #d1d5db;
}

.dark .feature-card:hover {
  border-color: #475569;
}

/* Line Clamp Utility */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Scrollbar Thin */
.scrollbar-thin::-webkit-scrollbar {
  height: 4px;
}

.scrollbar-thin::-webkit-scrollbar-track {
  background: transparent;
}

.scrollbar-thin::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 2px;
}

.dark .scrollbar-thin::-webkit-scrollbar-thumb {
  background: #475569;
}

.scrollbar-thumb-gray-300::-webkit-scrollbar-thumb {
  background: #d1d5db;
}

.dark .scrollbar-thumb-gray-600::-webkit-scrollbar-thumb {
  background: #4b5563;
}

/* Hero Gradient Animation */
@keyframes gradientShift {

  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

/* Backdrop Blur Support */
@supports not (backdrop-filter: blur(10px)) {
  .backdrop-blur-sm {
    background-color: rgba(255, 255, 255, 0.95);
  }

  .dark .backdrop-blur-sm {
    background-color: rgba(30, 41, 59, 0.95);
  }
}

/* Keyboard Shortcut Badge */
kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* Progress Bar Animation */
.progress-bar-animated {
  animation: progressGrow 1s ease-out;
}

@keyframes progressGrow {
  from {
    width: 0;
  }
}

/* Floating Action Button */
.fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 40;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 40px rgba(79, 70, 229, 0.4);
  transition: all 0.3s ease;
}

.fab:hover {
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 15px 50px rgba(79, 70, 229, 0.5);
}

/* Tooltip Styles */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  padding: 0.5rem 0.75rem;
  background: #1e293b;
  color: white;
  font-size: 0.75rem;
  white-space: nowrap;
  border-radius: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  pointer-events: none;
}

[data-tooltip]::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #1e293b;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

[data-tooltip]:hover::after,
[data-tooltip]:hover::before {
  opacity: 1;
  visibility: visible;
}

/* Recent Items Horizontal Scroll */
@media (max-width: 640px) {
  .overflow-x-auto {
    scroll-snap-type: x mandatory;
  }

  .overflow-x-auto>a {
    scroll-snap-align: start;
  }
}

/* Mobile Responsive Adjustments for Advance Page */
@media (max-width: 640px) {

  /* Stack stats in 2x2 grid on very small screens */
  .grid-cols-2 {
    gap: 0.75rem;
  }
}

/* Touch-friendly tap targets */
@media (hover: none) {
  .feature-card {
    -webkit-tap-highlight-color: transparent;
  }

  .feature-card:active {
    transform: scale(0.98);
  }
}

.skeleton-badge {
  width: 4rem;
  height: 1.5rem;
  border-radius: 9999px;
}

/* ==========================================
   MICRO-ANIMATIONS
   ========================================== */
/* Button press effect */
.btn-press:active {
  transform: scale(0.97);
}

/* Card lift effect */
.card-lift {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.15);
}

/* Pulse animation for notifications */
.pulse-dot {
  animation: pulse 2s infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

/* Fade in animation */
.fade-in {
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Slide up animation */
.slide-up {
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Toast slide up animation */
.animate-slide-up {
  animation: toastSlideUp 0.3s ease-out forwards;
}

@keyframes toastSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Bounce animation */
.bounce-in {
  animation: bounceIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes bounceIn {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Icon spin on hover */
.icon-spin-hover:hover i {
  animation: spin 0.5s ease-in-out;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* ==========================================
   FOCUS STATES (Accessibility)
   ========================================== */
/* Visible focus ring for keyboard navigation */
.focus-ring:focus,
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #4f46e5;
  outline-offset: 2px;
}

.dark button:focus-visible,
.dark a:focus-visible,
.dark input:focus-visible {
  outline-color: #818cf8;
}

/* Skip to content link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: #4f46e5;
  color: white;
  padding: 0.5rem 1rem;
  z-index: 100;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 0;
}

/* Focus within for interactive groups */
.focus-within-ring:focus-within {
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.3);
}

/* ==========================================
   KEYBOARD SHORTCUTS OVERLAY
   ========================================== */
.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  padding: 0.125rem 0.375rem;
  font-family: ui-monospace, monospace;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 0.25rem;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  color: #475569;
}

.dark .kbd {
  background: #334155;
  border-color: #475569;
  color: #cbd5e1;
}

/* ==========================================
   EMPTY STATE STYLES
   ========================================== */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
}

.empty-state-icon {
  width: 6rem;
  height: 6rem;
  margin: 0 auto 1.5rem;
  opacity: 0.6;
}

/* ==========================================
   TOAST NOTIFICATION STYLES
   ========================================== */
.toast {
  transform: translateX(100%);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.toast.show {
  transform: translateX(0);
}

/* ==========================================
   IMPROVED MOBILE RESPONSIVENESS
   ========================================== */
@media (max-width: 640px) {

  /* Stack elements on mobile */
  .mobile-stack {
    flex-direction: column;
    align-items: stretch;
  }

  .mobile-stack>* {
    width: 100%;
  }

  /* Full width buttons on mobile */
  .mobile-full {
    width: 100%;
    justify-content: center;
  }

  /* Hide on mobile */
  .mobile-hide {
    display: none;
  }

  /* Smaller padding on mobile */
  .mobile-p-sm {
    padding: 0.75rem;
  }

  /* Mobile table scroll indicator */
  .table-container::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 2rem;
    background: linear-gradient(to left, white, transparent);
    pointer-events: none;
  }

  .dark .table-container::after {
    background: linear-gradient(to left, #1e293b, transparent);
  }
}

/* ==========================================
   HIGH CONTRAST COLORS (Accessibility)
   ========================================== */
/* Improved badge contrast */
.badge-completed {
  background-color: #059669;
  color: white;
}

.badge-pending {
  background-color: #d97706;
  color: white;
}

.badge-sent {
  background-color: #2563eb;
  color: white;
}

.badge-declined {
  background-color: #dc2626;
  color: white;
}

/* Dark mode badge adjustments */
.dark .badge-completed {
  background-color: #10b981;
}

.dark .badge-pending {
  background-color: #f59e0b;
}

.dark .badge-sent {
  background-color: #3b82f6;
}

.dark .badge-declined {
  background-color: #ef4444;
}

/* Better text contrast */
.text-contrast {
  color: #1e293b;
}

.dark .text-contrast {
  color: #f8fafc;
}

/* ==========================================
   TIMELINE COMPONENT SYSTEM
   ==========================================
   ENFORCED COLOR PALETTE - Use these classes
   instead of arbitrary Tailwind colors.
   
   Status Colors:
   - completed (green)
   - data-entry (blue/primary)
   - filled (amber/warning)
   - declined (red/danger)
   - pending (gray/neutral)
   ========================================== */

/* --- Timeline Container --- */
.timeline-container {
  --tl-primary: var(--primary);
  --tl-success: var(--success);
  --tl-warning: var(--warning);
  --tl-danger: var(--danger);
  --tl-neutral: #64748b;
}

/* --- Timeline Status Badges --- */
.tl-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.tl-badge-completed {
  background-color: var(--success-light);
  color: #065f46;
}

.dark .tl-badge-completed {
  background-color: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
}

.tl-badge-data-entry {
  background-color: var(--primary-light);
  color: #3730a3;
}

.dark .tl-badge-data-entry {
  background-color: rgba(79, 70, 229, 0.15);
  color: #a5b4fc;
}

.tl-badge-filled {
  background-color: var(--warning-light);
  color: #92400e;
}

.dark .tl-badge-filled {
  background-color: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
}

.tl-badge-declined {
  background-color: var(--danger-light);
  color: #991b1b;
}

.dark .tl-badge-declined {
  background-color: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}

.tl-badge-pending {
  background-color: #f1f5f9;
  color: #475569;
}

.dark .tl-badge-pending {
  background-color: rgba(100, 116, 139, 0.15);
  color: #94a3b8;
}

/* --- Timeline Item Borders --- */
.tl-border-completed {
  border-color: var(--success);
}

.tl-border-data-entry {
  border-color: var(--primary);
}

.tl-border-filled {
  border-color: var(--warning);
}

.tl-border-declined {
  border-color: var(--danger);
}

.tl-border-pending {
  border-color: #94a3b8;
}

/* --- Timeline Icon Backgrounds --- */
.tl-icon-completed {
  background-color: var(--success);
  color: white;
}

.tl-icon-data-entry {
  background-color: var(--primary);
  color: white;
}

.tl-icon-filled {
  background-color: var(--warning);
  color: white;
}

.tl-icon-declined {
  background-color: var(--danger);
  color: white;
}

.tl-icon-pending {
  background-color: #94a3b8;
  color: white;
}

/* --- Timeline Stat Cards --- */
.tl-stat-card {
  border-radius: 0.5rem;
  padding: 0.75rem;
  text-align: center;
}

.tl-stat-primary {
  background-color: var(--primary-light);
}

.dark .tl-stat-primary {
  background-color: rgba(79, 70, 229, 0.1);
}

.tl-stat-success {
  background-color: var(--success-light);
}

.dark .tl-stat-success {
  background-color: rgba(16, 185, 129, 0.1);
}

.tl-stat-warning {
  background-color: var(--warning-light);
}

.dark .tl-stat-warning {
  background-color: rgba(245, 158, 11, 0.1);
}

.tl-stat-danger {
  background-color: var(--danger-light);
}

.dark .tl-stat-danger {
  background-color: rgba(239, 68, 68, 0.1);
}

/* --- Timeline Icon Colors (for stat cards) --- */
.tl-text-primary {
  color: var(--primary);
}

.tl-text-success {
  color: var(--success);
}

.tl-text-warning {
  color: var(--warning);
}

.tl-text-danger {
  color: var(--danger);
}

.tl-text-neutral {
  color: #64748b;
}

/* --- Timeline Action Buttons --- */
.tl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
  transition: all 0.15s ease;
  cursor: pointer;
  border: none;
}

.tl-btn-primary {
  background-color: var(--primary);
  color: white;
}

.tl-btn-primary:hover {
  background-color: var(--primary-hover);
}

.tl-btn-secondary {
  background-color: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.dark .tl-btn-secondary {
  background-color: #334155;
  color: #cbd5e1;
  border-color: #475569;
}

.tl-btn-secondary:hover {
  background-color: #e2e8f0;
}

.dark .tl-btn-secondary:hover {
  background-color: #475569;
}

.tl-btn-ghost {
  background-color: transparent;
  color: #64748b;
}

.tl-btn-ghost:hover {
  background-color: #f1f5f9;
  color: #334155;
}

.dark .tl-btn-ghost:hover {
  background-color: #334155;
  color: #f1f5f9;
}

/* --- Timeline Deadline Indicators --- */
.tl-deadline-urgent {
  background-color: var(--danger-light);
  color: #991b1b;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.dark .tl-deadline-urgent {
  background-color: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.3);
}

.tl-deadline-soon {
  background-color: var(--warning-light);
  color: #92400e;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.dark .tl-deadline-soon {
  background-color: rgba(245, 158, 11, 0.1);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.3);
}

/* --- Timeline Line Connector --- */
.tl-line {
  position: absolute;
  left: 1.125rem;
  top: 2.5rem;
  bottom: 0;
  width: 2px;
  background-color: #e2e8f0;
}

.dark .tl-line {
  background-color: #334155;
}

/* ==========================================
   HELP PANEL COMPONENT STYLES
   ========================================== */

/* Help button hover effect */
.help-btn {
  position: relative;
}

.help-btn::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, var(--primary), #06b6d4);
  opacity: 0;
  z-index: -1;
  transition: opacity 0.2s ease;
}

.help-btn:hover::after {
  opacity: 0.15;
}

/* Help panel link card hover */
.help-link-card {
  transition: all 0.2s ease;
}

.help-link-card:hover {
  transform: translateX(4px);
}

/* Keyboard shortcut styling */
.help-shortcut kbd {
  min-width: 1.5rem;
  text-align: center;
}

/* Help panel tip card */
.help-tip-card {
  animation: helpTipFadeIn 0.3s ease-out;
}

@keyframes helpTipFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stagger animation for help links */
.help-link-card:nth-child(1) {
  animation-delay: 0.05s;
}

.help-link-card:nth-child(2) {
  animation-delay: 0.1s;
}

.help-link-card:nth-child(3) {
  animation-delay: 0.15s;
}

.help-link-card:nth-child(4) {
  animation-delay: 0.2s;
}

.help-link-card:nth-child(5) {
  animation-delay: 0.25s;
}