/* Shared styles for all tool pages */
/* Falcon-Inspired Bootstrap 5 Elegant Layout */

/* Ensure disabled buttons don't interfere with enabled state */
button:not(:disabled) {
  cursor: pointer !important;
  pointer-events: auto !important;
}

button[disabled],
button.disabled {
  cursor: not-allowed !important;
  pointer-events: none !important;
}

/* Navigation styles - No visible scrollbar */
nav {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

nav::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

/* Navigation item styles - Elegant with animations */
.nav-item {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  border-radius: 8px;
}

.nav-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 3px;
  background: var(--bs-primary);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item:hover:not(.active) {
  transform: translateX(4px);
  background-color: rgba(255, 255, 255, 0.08) !important;
}

.nav-item:hover:not(.active)::before {
  transform: scaleY(0.3);
}

.nav-item.active {
  color: var(--bs-primary) !important;
  background-color: rgba(59, 130, 246, 0.15) !important;
  transform: translateX(4px);
}

.nav-item.active::before {
  transform: scaleY(1);
}

/* Smooth icon animation */
.nav-item span {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item:hover span {
  transform: scale(1.1);
}

/* Staggered fade-in animation for nav items */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nav-item {
  animation: fadeInUp 0.4s ease-out backwards;
}

.nav-item:nth-child(1) { animation-delay: 0.05s; }
.nav-item:nth-child(2) { animation-delay: 0.1s; }
.nav-item:nth-child(3) { animation-delay: 0.15s; }
.nav-item:nth-child(4) { animation-delay: 0.2s; }
.nav-item:nth-child(5) { animation-delay: 0.25s; }
.nav-item:nth-child(6) { animation-delay: 0.3s; }
.nav-item:nth-child(7) { animation-delay: 0.35s; }
.nav-item:nth-child(8) { animation-delay: 0.4s; }
.nav-item:nth-child(9) { animation-delay: 0.45s; }
.nav-item:nth-child(10) { animation-delay: 0.5s; }
.nav-item:nth-child(11) { animation-delay: 0.55s; }
.nav-item:nth-child(12) { animation-delay: 0.6s; }
.nav-item:nth-child(13) { animation-delay: 0.65s; }
.nav-item:nth-child(14) { animation-delay: 0.7s; }
.nav-item:nth-child(15) { animation-delay: 0.75s; }
.nav-item:nth-child(n+16) { animation-delay: 0.8s; }

/* Category header animation */
nav h2 {
  animation: fadeInUp 0.3s ease-out;
}

/* Smooth text color transitions */
.nav-item div {
  transition: color 0.3s ease;
}

/* Dropzone hover effects */
.dropzone:hover {
  border-color: var(--bs-primary) !important;
  background-color: rgba(30, 41, 59, 0.6) !important;
}

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

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.2) !important;
}

/* Navigation positioning */
nav {
  height: auto;
  overflow-y: visible;
}

/* Mobile menu with smooth animations */
@media (max-width: 991.98px) {
  /* Force all columns to col-12 on mobile */
  [class*="col-"] {
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }
  
  nav {
    position: fixed !important;
    top: 0;
    left: 0;
    z-index: 1050;
    width: 100% !important;
    max-height: 100vh;
    overflow-y: auto;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease, border-color 0.3s ease;
    background-color: var(--nav-bg) !important;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--card-border) !important;
  }
  
  #mobile-menu {
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  #mobile-menu.d-none {
    opacity: 0;
    transform: translateY(-10px);
  }
  
  #mobile-menu:not(.d-none) {
    opacity: 1;
    transform: translateY(0);
  }
  
  #main-content {
    padding-top: 70px !important;
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
    transition: padding-top 0.3s ease;
  }
  
  #nav-container {
    height: auto;
    overflow: visible;
  }
  
  /* Hide ads on mobile */
  #left-ad,
  #right-ad {
    display: none !important;
  }
  
  /* Mobile content adjustments */
  #tool-content {
    width: 100% !important;
    max-width: 100% !important;
  }
  
  /* Mobile form controls */
  .form-control {
    font-size: 16px !important; /* Prevents zoom on iOS */
  }
  
  /* Mobile toastr positioning */
  #toast-container {
    top: 10px !important;
    right: 10px !important;
    left: 10px !important;
    width: calc(100% - 20px) !important;
    max-width: calc(100% - 20px) !important;
  }
  
  #toast-container > div {
    width: 100% !important;
    max-width: 100% !important;
  }
  
  /* Mobile button full width on small screens */
  @media (max-width: 576px) {
    .btn-lg {
      width: 100% !important;
    }
    
    .dropzone {
      min-height: 160px !important;
      padding: 1.5rem 1rem !important;
    }
    
    h1 {
      font-size: 1.75rem !important;
    }
    
    h2 {
      font-size: 1.25rem !important;
    }
  }
}

/* Desktop layout adjustments */
@media (min-width: 992px) {
  nav {
    position: sticky !important;
    top: 0;
    height: auto; /* Auto height to show all items */
    max-height: none; /* Remove max-height constraint */
    width: 100% !important;
    overflow-y: visible; /* No scrolling on desktop */
  }
  
  #main-content {
    padding-top: 0 !important;
  }
  
  #nav-container {
    position: relative;
    height: auto;
  }
}

/* Ad sidebar styles */
#left-ad, #right-ad {
  scrollbar-width: thin;
  scrollbar-color: #475569 #1e293b;
}

#left-ad::-webkit-scrollbar,
#right-ad::-webkit-scrollbar {
  width: 4px;
}

#left-ad::-webkit-scrollbar-track,
#right-ad::-webkit-scrollbar-track {
  background: #1e293b;
}

#left-ad::-webkit-scrollbar-thumb,
#right-ad::-webkit-scrollbar-thumb {
  background: #475569;
  border-radius: 2px;
}

/* Ensure content doesn't overflow */
body {
  overflow-x: hidden;
}

/* Smooth transitions - refined */
* {
  transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
              color 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
              border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Tool content fade-in animation */
#tool-content {
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
              transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Navigation header animation */
nav h1 {
  animation: fadeInUp 0.4s ease-out;
}

/* Category sections animation */
nav > div > div {
  animation: fadeInUp 0.5s ease-out backwards;
}

nav > div > div:nth-child(1) { animation-delay: 0.1s; }
nav > div > div:nth-child(2) { animation-delay: 0.2s; }
nav > div > div:nth-child(3) { animation-delay: 0.3s; }
nav > div > div:nth-child(4) { animation-delay: 0.4s; }

/* Mobile-first responsive improvements */
@media (max-width: 640px) {
  /* Smaller padding on mobile */
  #main-content {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  
  /* Compact navigation on mobile */
  nav {
    font-size: 0.875rem;
  }
}

/* Tablet adjustments */
@media (min-width: 640px) and (max-width: 1023px) {
  #main-content {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* Large desktop adjustments */
@media (min-width: 1280px) {
  #grid-container {
    max-width: 1920px;
    margin: 0 auto;
  }
}

/* Prevent horizontal scroll */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

/* Ad container styling */
.adsbygoogle {
  display: block;
  text-align: center;
}

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
}

/* FAQ Accordion Styling - Theme Aware */
.faq-item {
  background-color: var(--card-bg) !important;
  border: 1px solid var(--card-border) !important;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.accordion-button {
  background-color: var(--card-bg) !important;
  color: var(--text-primary) !important;
  border: none !important;
  box-shadow: none !important;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.accordion-button:not(.collapsed) {
  background-color: rgba(59, 130, 246, 0.15) !important;
  color: var(--bs-primary) !important;
}

.accordion-button:hover {
  background-color: rgba(59, 130, 246, 0.1) !important;
}

.accordion-button:focus {
  border-color: var(--bs-primary) !important;
  box-shadow: 0 0 0 0.25rem rgba(59, 130, 246, 0.25) !important;
}

.accordion-body {
  background-color: var(--card-bg) !important;
  color: var(--text-secondary) !important;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.accordion-item {
  border: 1px solid var(--card-border) !important;
  background-color: var(--card-bg) !important;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* Section animations */
.card {
  animation: fadeInUp 0.5s ease-out backwards;
}

.card:nth-of-type(1) { animation-delay: 0.1s; }
.card:nth-of-type(2) { animation-delay: 0.2s; }
.card:nth-of-type(3) { animation-delay: 0.3s; }
.card:nth-of-type(4) { animation-delay: 0.4s; }
.card:nth-of-type(5) { animation-delay: 0.5s; }

/* Use case cards hover effect */
.card.bg-dark-subtle:hover {
  transform: translateY(-4px);
  box-shadow: 0 0.5rem 1rem rgba(59, 130, 246, 0.2) !important;
  border-color: rgba(59, 130, 246, 0.3) !important;
}

/* Bounce Animation */
@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-25%);
  }
}

.animate-bounce {
  animation: bounce 1s infinite;
  display: inline-block;
}

/* Document Opening Animation */
@keyframes document-open {
  0% {
    transform: perspective(600px) rotateX(0deg) rotateY(0deg) rotateZ(0deg) scale(1);
  }
  25% {
    transform: perspective(600px) rotateX(-8deg) rotateY(-15deg) rotateZ(-2deg) scale(1.08);
  }
  50% {
    transform: perspective(600px) rotateX(-15deg) rotateY(-25deg) rotateZ(-3deg) scale(1.15);
  }
  75% {
    transform: perspective(600px) rotateX(-8deg) rotateY(-15deg) rotateZ(-2deg) scale(1.08);
  }
  100% {
    transform: perspective(600px) rotateX(0deg) rotateY(0deg) rotateZ(0deg) scale(1);
  }
}

/* Picture Frame Zoom Animation */
@keyframes picture-zoom {
  0% {
    transform: scale(1) rotate(0deg);
  }
  50% {
    transform: scale(1.2) rotate(5deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}

/* Compressor Squeeze Animation */
@keyframes compressor-squeeze {
  0%, 100% {
    transform: scaleY(1) scaleX(1);
  }
  25% {
    transform: scaleY(0.85) scaleX(1.1);
  }
  50% {
    transform: scaleY(0.75) scaleX(1.15);
  }
  75% {
    transform: scaleY(0.85) scaleX(1.1);
  }
}

/* Scissors Cut Animation */
@keyframes scissors-cut {
  0%, 100% {
    transform: rotate(0deg) scale(1);
  }
  25% {
    transform: rotate(-15deg) scale(1.1);
  }
  50% {
    transform: rotate(15deg) scale(1.15);
  }
  75% {
    transform: rotate(-10deg) scale(1.1);
  }
}

/* Link Connect Animation */
@keyframes link-connect {
  0%, 100% {
    transform: scale(1) rotate(0deg);
  }
  25% {
    transform: scale(1.1) rotate(-10deg);
  }
  50% {
    transform: scale(1.2) rotate(10deg);
  }
  75% {
    transform: scale(1.1) rotate(-5deg);
  }
}

/* Rotate Animation */
@keyframes rotate-spin {
  0% {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(180deg) scale(1.15);
  }
  100% {
    transform: rotate(360deg) scale(1);
  }
}

/* Eye Blink Animation */
@keyframes eye-blink {
  0%, 90%, 100% {
    transform: scaleY(1);
  }
  45% {
    transform: scaleY(0.1);
  }
}

/* Ruler Extend Animation */
@keyframes ruler-extend {
  0%, 100% {
    transform: scaleX(1) rotate(0deg);
  }
  50% {
    transform: scaleX(1.3) rotate(5deg);
  }
}

/* Camera Flash Animation */
@keyframes camera-flash {
  0%, 100% {
    transform: scale(1) rotate(0deg);
    filter: brightness(1);
  }
  25% {
    transform: scale(1.1) rotate(-5deg);
    filter: brightness(1.5);
  }
  50% {
    transform: scale(1.15) rotate(5deg);
    filter: brightness(2);
  }
  75% {
    transform: scale(1.1) rotate(-3deg);
    filter: brightness(1.5);
  }
}

/* Unlock Animation */
@keyframes unlock-open {
  0% {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(-25deg) scale(1.15);
  }
  100% {
    transform: rotate(0deg) scale(1);
  }
}

/* Lock Secure Animation */
@keyframes lock-secure {
  0%, 100% {
    transform: scale(1) translateY(0);
  }
  25% {
    transform: scale(1.1) translateY(-3px);
  }
  50% {
    transform: scale(1.15) translateY(-5px);
  }
  75% {
    transform: scale(1.1) translateY(-3px);
  }
}

/* Memo Open Animation (similar to document) */
@keyframes memo-open {
  0% {
    transform: perspective(600px) rotateX(0deg) rotateY(0deg) scale(1);
  }
  50% {
    transform: perspective(600px) rotateX(-12deg) rotateY(-20deg) scale(1.12);
  }
  100% {
    transform: perspective(600px) rotateX(0deg) rotateY(0deg) scale(1);
  }
}

/* Document Pages Animation */
@keyframes document-pages {
  0%, 100% {
    transform: scale(1) rotate(0deg);
  }
  25% {
    transform: scale(1.1) rotate(-5deg);
  }
  50% {
    transform: scale(1.15) rotate(5deg);
  }
  75% {
    transform: scale(1.1) rotate(-3deg);
  }
}

/* Palette Mix Animation */
@keyframes palette-mix {
  0%, 100% {
    transform: rotate(0deg) scale(1);
  }
  25% {
    transform: rotate(-10deg) scale(1.1);
  }
  50% {
    transform: rotate(10deg) scale(1.15);
  }
  75% {
    transform: rotate(-5deg) scale(1.1);
  }
}

/* Save/Compress Animation */
@keyframes save-compress {
  0%, 100% {
    transform: scale(1) translateY(0);
  }
  25% {
    transform: scale(1.1) translateY(-3px);
  }
  50% {
    transform: scale(1.15) translateY(-5px);
  }
  75% {
    transform: scale(1.1) translateY(-3px);
  }
}

/* Base emoji styles */
.emoji-document,
.emoji-picture,
.emoji-compressor,
.emoji-scissors,
.emoji-link,
.emoji-rotate,
.emoji-eye,
.emoji-ruler,
.emoji-camera,
.emoji-unlock,
.emoji-lock,
.emoji-memo,
.emoji-document-pages,
.emoji-palette,
.emoji-save {
  display: inline-block;
  transition: transform 0.3s ease, filter 0.3s ease;
  cursor: pointer;
  transform-style: preserve-3d;
  transform-origin: center center;
}

/* Hover effects */
.emoji-document:hover {
  animation: document-open 0.8s ease-in-out;
  filter: drop-shadow(0 6px 12px rgba(59, 130, 246, 0.4));
}

.emoji-picture:hover {
  animation: picture-zoom 0.6s ease-in-out;
  filter: drop-shadow(0 6px 12px rgba(59, 130, 246, 0.4));
}

.emoji-compressor:hover {
  animation: compressor-squeeze 0.7s ease-in-out;
  filter: drop-shadow(0 6px 12px rgba(239, 68, 68, 0.4));
}

.emoji-scissors:hover {
  animation: scissors-cut 0.6s ease-in-out;
  filter: drop-shadow(0 6px 12px rgba(59, 130, 246, 0.4));
}

.emoji-link:hover {
  animation: link-connect 0.7s ease-in-out;
  filter: drop-shadow(0 6px 12px rgba(34, 197, 94, 0.4));
}

.emoji-rotate:hover {
  animation: rotate-spin 0.8s ease-in-out;
  filter: drop-shadow(0 6px 12px rgba(59, 130, 246, 0.4));
}

.emoji-eye:hover {
  animation: eye-blink 0.5s ease-in-out;
  filter: drop-shadow(0 6px 12px rgba(139, 92, 246, 0.4));
}

.emoji-ruler:hover {
  animation: ruler-extend 0.6s ease-in-out;
  filter: drop-shadow(0 6px 12px rgba(59, 130, 246, 0.4));
}

.emoji-camera:hover {
  animation: camera-flash 0.7s ease-in-out;
  filter: drop-shadow(0 6px 12px rgba(251, 191, 36, 0.4));
}

.emoji-unlock:hover {
  animation: unlock-open 0.6s ease-in-out;
  filter: drop-shadow(0 6px 12px rgba(34, 197, 94, 0.4));
}

.emoji-lock:hover {
  animation: lock-secure 0.7s ease-in-out;
  filter: drop-shadow(0 6px 12px rgba(239, 68, 68, 0.4));
}

.emoji-memo:hover {
  animation: memo-open 0.8s ease-in-out;
  filter: drop-shadow(0 6px 12px rgba(59, 130, 246, 0.4));
}

.emoji-document-pages:hover {
  animation: document-pages 0.7s ease-in-out;
  filter: drop-shadow(0 6px 12px rgba(59, 130, 246, 0.4));
}

.emoji-palette:hover {
  animation: palette-mix 0.6s ease-in-out;
  filter: drop-shadow(0 6px 12px rgba(168, 85, 247, 0.4));
}

.emoji-save:hover {
  animation: save-compress 0.7s ease-in-out;
  filter: drop-shadow(0 6px 12px rgba(34, 197, 94, 0.4));
}

