/**
 * Editora Tools — Modern Responsive Stylesheet
 * Branded as "Editora Tools — A Venture of Solo Entity Group"
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&family=Noto+Sans+Devanagari:wght@400;500;600;700;800&family=Poppins:wght@400;500;600;700&display=swap');

/* Local Bilingual Fonts for Zero-Network Offline Devanagari Hindi Support */
@font-face {
  font-family: 'Noto Sans Devanagari';
  src: url('/fonts/NotoSansDevanagari-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Noto Sans Devanagari';
  src: url('/fonts/NotoSansDevanagari-Bold.ttf') format('truetype');
  font-weight: bold;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Poppins';
  src: url('/fonts/Poppins-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Poppins';
  src: url('/fonts/Poppins-Bold.ttf') format('truetype');
  font-weight: bold;
  font-style: normal;
  font-display: swap;
}

:root {
  --primary-red: #dc2626;
  --primary-red-hover: #b91c1c;
  --primary-red-light: #fef2f2;
  --gold-pro: #f59e0b;
  --gold-pro-glow: rgba(245, 158, 11, 0.35);
  --slate-dark: #0f172a;
}

* {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  box-sizing: border-box;
}

code, pre, .font-mono {
  font-family: 'JetBrains Mono', monospace, monospace;
}

body {
  background-color: #f8fafc;
  color: #0f172a;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Tool Card Modern Transitions & Hover Elevation */
.tool-card {
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.22s ease;
  will-change: transform, box-shadow;
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 30px -8px rgba(220, 38, 38, 0.12),
              0 6px 12px -4px rgba(15, 23, 42, 0.06);
  border-color: #fca5a5;
}

/* Drop Zone Active States */
.drop-zone-active {
  border-color: #dc2626 !important;
  background-color: #fef2f2 !important;
  transform: scale(1.008);
}

/* Custom Scrollbars */
.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}

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

/* Checkerboard Pattern for Transparent Canvases */
.checkerboard {
  background-image: linear-gradient(45deg, #e2e8f0 25%, transparent 25%),
                    linear-gradient(-45deg, #e2e8f0 25%, transparent 25%),
                    linear-gradient(45deg, transparent 75%, #e2e8f0 75%),
                    linear-gradient(-45deg, transparent 75%, #e2e8f0 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}

/* Gold Pro Badge Glow & Shimmer */
.pro-glow {
  box-shadow: 0 0 15px var(--gold-pro-glow);
  animation: pulse-glow 2.5s infinite ease-in-out;
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.25);
  }
  50% {
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.55);
  }
}

/* Modal Smooth Fade In */
.modal-fade-in {
  animation: modalFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.97) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Processing Spinner */
.spinner-spin {
  animation: spin 0.8s linear infinite;
}

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

/* AdSense Slot Styling */
#adSenseHomeSlot {
  transition: all 0.3s ease;
}

/* Ensure .hidden hides elements by default */
.hidden {
  display: none !important;
}

/* Responsive display utilities overriding .hidden */
@media (min-width: 640px) {
  .sm\:flex { display: flex !important; }
  .sm\:inline-flex { display: inline-flex !important; }
  .sm\:block { display: block !important; }
  .sm\:inline-block { display: inline-block !important; }
  .sm\:inline { display: inline !important; }
  .sm\:hidden { display: none !important; }
}

@media (min-width: 768px) {
  header nav[aria-label="Main Navigation"],
  nav.hidden.md\:flex,
  .md\:flex { display: flex !important; }
  .md\:inline-flex { display: inline-flex !important; }
  .md\:block { display: block !important; }
  .md\:inline-block { display: inline-block !important; }
  .md\:inline { display: inline !important; }
  .md\:hidden { display: none !important; }
}

@media (min-width: 1024px) {
  .lg\:flex { display: flex !important; }
  .lg\:inline-flex { display: inline-flex !important; }
  .lg\:block { display: block !important; }
  .lg\:inline-block { display: inline-block !important; }
  .lg\:inline { display: inline !important; }
  .lg\:hidden { display: none !important; }
}

@media (min-width: 1280px) {
  .xl\:flex { display: flex !important; }
  .xl\:inline-flex { display: inline-flex !important; }
  .xl\:block { display: block !important; }
  .xl\:inline-block { display: inline-block !important; }
  .xl\:inline { display: inline !important; }
  .xl\:hidden { display: none !important; }
}

/* Mobile Touch Optimization & Responsive Utilities */
html, body {
  max-width: 100vw;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

/* iOS Safe Area Insets for notch, dynamic island, and home bar */
body {
  padding-bottom: max(0px, env(safe-area-inset-bottom));
}

header {
  padding-top: max(0px, env(safe-area-inset-top));
}

/* Touch Friendly Utilities */
.touch-pan-x {
  touch-action: pan-x;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  overscroll-behavior-x: contain;
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}

.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Prevent iOS Safari auto-zoom on input focus */
@media (max-width: 640px) {
  input[type="text"],
  input[type="search"],
  input[type="number"],
  input[type="password"],
  select,
  textarea {
    font-size: 16px !important;
  }

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

/* Professional Navigation Styling & Animations */
.nav-main-link {
  position: relative;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-main-link:active {
  transform: scale(0.97);
}

.nav-category-btn {
  transition: all 0.15s ease;
}

.mobile-cat-pill {
  transition: all 0.15s ease;
  white-space: nowrap;
}

.mobile-cat-pill:active {
  transform: scale(0.95);
}

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

#mobileNavPanel:not(.hidden),
#mobileSearchPanel:not(.hidden) {
  animation: navSlideDown 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Responsive Modal Scrolling & Max Width Constraints */
@media (max-width: 480px) {
  .modal-dialog-content {
    width: 100% !important;
    max-height: 90vh !important;
  }
}

/* ==============================================================================
   FLOATING BOTTOM-TO-TOP BUTTON (Appears when scrolling down from Hero section)
   ============================================================================== */
#scrollToTopBtn,
.scroll-to-top-btn {
  position: fixed !important;
  bottom: 24px !important;
  right: 24px !important;
  z-index: 99999 !important;
  width: 48px !important;
  height: 48px !important;
  border-radius: 16px !important;
  background-color: #dc2626 !important; /* red-600 */
  color: #ffffff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 10px 25px -5px rgba(220, 38, 38, 0.45), 0 8px 10px -6px rgba(0, 0, 0, 0.15) !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  cursor: pointer !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: translateY(16px) scale(0.95) !important;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              background-color 0.2s ease,
              box-shadow 0.2s ease !important;
  -webkit-tap-highlight-color: transparent;
}

#scrollToTopBtn:hover,
.scroll-to-top-btn:hover {
  background-color: #b91c1c !important; /* red-700 */
  transform: translateY(-2px) scale(1.03) !important;
  box-shadow: 0 16px 30px -4px rgba(220, 38, 38, 0.55), 0 10px 12px -5px rgba(0, 0, 0, 0.2) !important;
}

#scrollToTopBtn:active,
.scroll-to-top-btn:active {
  transform: translateY(0) scale(0.95) !important;
}

/* Visible State triggered when user scrolls down from Hero section */
#scrollToTopBtn.visible,
.scroll-to-top-btn.visible {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: translateY(0) scale(1) !important;
}

/* Elevation adjustment if Cookie Banner is currently active */
body.cookie-banner-open #scrollToTopBtn,
body.cookie-banner-open .scroll-to-top-btn {
  bottom: 110px !important;
}

@media (max-width: 640px) {
  #scrollToTopBtn,
  .scroll-to-top-btn {
    bottom: 20px !important;
    right: 20px !important;
    width: 44px !important;
    height: 44px !important;
    border-radius: 14px !important;
  }
  body.cookie-banner-open #scrollToTopBtn,
  body.cookie-banner-open .scroll-to-top-btn {
    bottom: 160px !important;
  }
}

