
/* ==========================================================================
   EASYEDIT AI TOOLS SECTION STYLES
   ========================================================================== */

.ai-tools-section {
  position: relative;
  width: 100%;
  padding: 64px 0 72px;
  background: linear-gradient(180deg, rgba(255, 241, 242, 0.4) 0%, rgba(255, 255, 255, 1) 100%);
  overflow: hidden;
}

:is([data-theme="dark"], body:not(.theme-light), body.theme-dark) .ai-tools-section {
  background: linear-gradient(180deg, rgba(24, 24, 27, 0.8) 0%, rgba(9, 9, 11, 1) 100%);
}

.ai-tools-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.ai-tools-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 48px;
}

.ai-tools-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: #ffe4e6;
  color: #e11d48;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(225, 29, 72, 0.06);
}

:is([data-theme="dark"], body:not(.theme-light), body.theme-dark) .ai-tools-badge {
  background: rgba(225, 29, 72, 0.15);
  color: #fb7185;
}

.ai-tools-title {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin: 0 0 14px;
}

:is([data-theme="dark"], body:not(.theme-light), body.theme-dark) .ai-tools-title {
  color: #f8fafc;
}

.ai-tools-subtitle {
  font-size: clamp(15px, 2vw, 17px);
  color: #475569;
  line-height: 1.55;
  margin: 0;
}

:is([data-theme="dark"], body:not(.theme-light), body.theme-dark) .ai-tools-subtitle {
  color: #94a3b8;
}

/* Grid Layout */
.ai-tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

@media (max-width: 1023px) {
  .ai-tools-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
}

@media (max-width: 600px) {
  .ai-tools-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .ai-tools-section {
    padding: 44px 0 52px;
  }
  .ai-tools-container {
    padding: 0 16px;
  }
  .ai-tools-header {
    margin-bottom: 32px;
  }
}

/* Card Shell */
.ai-tool-card {
  background: #ffffff;
  border: 1px solid #fecdd3;
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease;
  box-shadow: 0 4px 20px -2px rgba(244, 63, 94, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
}

.ai-tool-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px -4px rgba(244, 63, 94, 0.12), 0 4px 12px -2px rgba(15, 23, 42, 0.05);
  border-color: #fda4af;
}

:is([data-theme="dark"], body:not(.theme-light), body.theme-dark) .ai-tool-card {
  background: #18181b;
  border-color: #27272a;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.4);
}

:is([data-theme="dark"], body:not(.theme-light), body.theme-dark) .ai-tool-card:hover {
  border-color: #3f3f46;
  box-shadow: 0 16px 32px -4px rgba(0, 0, 0, 0.6);
}

/* Comparison Preview Area */
.ai-card-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #0f172a;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
  cursor: ew-resize;
}

.ai-preview-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.ai-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

/* Underlay shows RESULT (revealed as handle moves left) */
.ai-preview-underlay {
  z-index: 1;
}

/* Overlay shows ORIGINAL / PROMPT (clipped by handle position) */
.ai-preview-overlay {
  z-index: 2;
  clip-path: inset(0 calc(100% - var(--pos, 50%)) 0 0);
  will-change: clip-path;
}

/* Prompt Card Overlay for Art Generator */
.ai-prompt-overlay {
  background: linear-gradient(135deg, #fff1f2 0%, #fdf2f8 50%, #fef3c7 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

:is([data-theme="dark"], body:not(.theme-light), body.theme-dark) .ai-prompt-overlay {
  background: linear-gradient(135deg, #27272a 0%, #1f1f23 50%, #18181b 100%);
}

.ai-prompt-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px;
  max-width: 80%;
}

.ai-prompt-bubble {
  background: #ffffff;
  border: 1px solid #fecdd3;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  color: #e11d48;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.1);
  white-space: nowrap;
}

:is([data-theme="dark"], body:not(.theme-light), body.theme-dark) .ai-prompt-bubble {
  background: #18181b;
  border-color: #fda4af;
  color: #fda4af;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.ai-prompt-sparkle {
  font-size: 16px;
}

.ai-prompt-quotes {
  color: #fda4af;
  font-family: Georgia, serif;
}

.ai-prompt-text {
  font-style: italic;
  letter-spacing: 0.01em;
}

.ai-prompt-caption {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
}

/* Checkerboard for Transparent Background */
.ai-checkerboard-bg {
  background-image: linear-gradient(45deg, #cbd5e1 25%, transparent 25%),
                    linear-gradient(-45deg, #cbd5e1 25%, transparent 25%),
                    linear-gradient(45deg, transparent 75%, #cbd5e1 75%),
                    linear-gradient(-45deg, transparent 75%, #cbd5e1 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-color: #f1f5f9;
}

:is([data-theme="dark"], body:not(.theme-light), body.theme-dark) .ai-checkerboard-bg {
  background-image: linear-gradient(45deg, #27272a 25%, transparent 25%),
                    linear-gradient(-45deg, #27272a 25%, transparent 25%),
                    linear-gradient(45deg, transparent 75%, #27272a 75%),
                    linear-gradient(-45deg, transparent 75%, #27272a 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-color: #18181b;
}

/* Draggable Divider & Handle */
.ai-slider-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos, 50%);
  width: 2px;
  transform: translateX(-50%);
  background: #ffffff;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.45);
  z-index: 4;
  pointer-events: none;
  will-change: left;
}

.ai-slider-handle {
  position: absolute;
  top: 50%;
  left: var(--pos, 50%);
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  background: #ffffff;
  border: 2.5px solid #e11d48;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28), 0 0 0 2px rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  cursor: ew-resize;
  color: #e11d48;
  outline: none;
  touch-action: pan-y;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  will-change: left;
}

.ai-slider-handle:hover {
  transform: translate(-50%, -50%) scale(1.08);
  box-shadow: 0 6px 18px rgba(225, 29, 72, 0.35), 0 0 0 2px rgba(255, 255, 255, 1);
}

.ai-slider-handle:focus-visible {
  box-shadow: 0 0 0 4px rgba(225, 29, 72, 0.35), 0 4px 14px rgba(0, 0, 0, 0.3);
}

.ai-handle-arrows {
  pointer-events: none;
  stroke: #e11d48;
}

/* Floating Comparison Tags */
.ai-tag {
  position: absolute;
  bottom: 12px;
  z-index: 3;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(15, 23, 42, 0.72);
  color: #ffffff;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.ai-tag-left {
  left: 12px;
}

.ai-tag-right {
  right: 12px;
}

/* Card Body */
.ai-card-body {
  padding: 22px 20px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.ai-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.ai-card-title {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.015em;
  margin: 0;
}

:is([data-theme="dark"], body:not(.theme-light), body.theme-dark) .ai-card-title {
  color: #f8fafc;
}

.ai-status-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.ai-status-pill.available {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

:is([data-theme="dark"], body:not(.theme-light), body.theme-dark) .ai-status-pill.available {
  background: rgba(22, 163, 74, 0.2);
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.3);
}

.ai-status-pill.coming-soon {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

:is([data-theme="dark"], body:not(.theme-light), body.theme-dark) .ai-status-pill.coming-soon {
  background: #27272a;
  color: #a1a1aa;
  border-color: #3f3f46;
}

.ai-card-desc {
  font-size: 14px;
  color: #64748b;
  line-height: 1.5;
  margin: 0 0 20px;
  flex: 1;
}

:is([data-theme="dark"], body:not(.theme-light), body.theme-dark) .ai-card-desc {
  color: #94a3b8;
}

/* CTA Action */
.ai-card-action {
  margin-top: auto;
}

.ai-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-sizing: border-box;
  text-align: center;
}

.ai-btn-primary {
  background: #e11d48;
  color: #ffffff !important;
  border: none;
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.25);
}

.ai-btn-primary:hover {
  background: #be123c;
  box-shadow: 0 6px 18px rgba(225, 29, 72, 0.35);
  transform: translateY(-1px);
}

.ai-btn-arrow {
  transition: transform 0.2s ease;
}

.ai-btn-primary:hover .ai-btn-arrow {
  transform: translateX(3px);
}

.ai-btn-disabled {
  background: #f8fafc;
  color: #94a3b8;
  border: 1px solid #e2e8f0;
  cursor: not-allowed;
  opacity: 0.85;
}

:is([data-theme="dark"], body:not(.theme-light), body.theme-dark) .ai-btn-disabled {
  background: #27272a;
  color: #71717a;
  border-color: #3f3f46;
}

/* RTL Support (Arabic) */
[dir="rtl"] .ai-btn-arrow {
  transform: rotate(180deg);
}
[dir="rtl"] .ai-btn-primary:hover .ai-btn-arrow {
  transform: rotate(180deg) translateX(3px);
}
[dir="rtl"] .ai-card-meta {
  flex-direction: row-reverse;
}
[dir="rtl"] .ai-tools-header {
  text-align: center;
}

/* ==========================================================================
   HOMEPAGE COMPLETE AI TOOLS THEME UNIFICATION
   Harmonizes colors, smooth animations, and shadows across all homepage tools:
   Image Tools, PDF Tools, Popular Tools, Categories (QR, SynthID, Photo, etc.),
   Recent Projects (.ee), and Hero Section.
   ========================================================================== */

/* 1. Hero Section Buttons, Badge & Highlights */
#canvaHeroSection .badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 6px 14px !important;
  border-radius: 999px !important;
  background: #ffe4e6 !important;
  color: #e11d48 !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  border: 1px solid #fecdd3 !important;
  box-shadow: 0 1px 2px rgba(225, 29, 72, 0.06) !important;
}

#canvaHeroSection .btn-primary,
#canvaHeroSection a[href*="studio"].btn-primary {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  background: #e11d48 !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 12px !important;
  padding: 12px 24px !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.25) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  cursor: pointer !important;
  text-decoration: none !important;
}

#canvaHeroSection .btn-primary:hover,
#canvaHeroSection a[href*="studio"].btn-primary:hover {
  background: #be123c !important;
  box-shadow: 0 6px 18px rgba(225, 29, 72, 0.35) !important;
  transform: translateY(-2px) !important;
}

#canvaHeroSection .btn-secondary,
#canvaHeroSection a[href*="template"].btn-secondary {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  background: #ffffff !important;
  color: #e11d48 !important;
  border: 1.5px solid #fecdd3 !important;
  border-radius: 12px !important;
  padding: 12px 24px !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 6px rgba(225, 29, 72, 0.06) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  cursor: pointer !important;
  text-decoration: none !important;
}

#canvaHeroSection .btn-secondary:hover,
#canvaHeroSection a[href*="template"].btn-secondary:hover {
  background: #fff1f2 !important;
  border-color: #fda4af !important;
  color: #be123c !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.12) !important;
}

#canvaHeroSection .gradient-text {
  background: linear-gradient(135deg, #e11d48 0%, #be123c 60%, #9f1239 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}

/* 2. Categories Section (Below AI Tools: QR Code, SynthID, Photo, Design, Templates, Image, Document) */
.categories .category-card {
  background: #ffffff !important;
  border: 1px solid #fecdd3 !important;
  border-radius: 20px !important;
  box-shadow: 0 4px 20px -2px rgba(244, 63, 94, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.03) !important;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease !important;
  cursor: pointer !important;
}

.categories .category-card:hover {
  transform: translateY(-4px) !important;
  border-color: #fda4af !important;
  box-shadow: 0 16px 32px -4px rgba(244, 63, 94, 0.12), 0 4px 12px -2px rgba(15, 23, 42, 0.05) !important;
}

.categories .category-icon-wrapper {
  background: #ffe4e6 !important;
  color: #e11d48 !important;
  border: 1px solid #fecdd3 !important;
  border-radius: 14px !important;
  box-shadow: 0 2px 8px rgba(225, 29, 72, 0.12) !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.categories .category-card:hover .category-icon-wrapper {
  transform: scale(1.08) !important;
  box-shadow: 0 6px 18px rgba(225, 29, 72, 0.25) !important;
}

#homeQrCard .category-icon-wrapper,
#homeSynthIdCard .category-icon-wrapper {
  background-color: #ffe4e6 !important;
  color: #e11d48 !important;
  border: 1px solid #fecdd3 !important;
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.12) !important;
}

/* 3. Popular Image & Design Tools */
#popular-tools .tool-card {
  background: #ffffff !important;
  border: 1px solid #fecdd3 !important;
  border-radius: 18px !important;
  box-shadow: 0 4px 20px -2px rgba(244, 63, 94, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.03) !important;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease !important;
  cursor: pointer !important;
}

#popular-tools .tool-card:hover {
  transform: translateY(-4px) !important;
  border-color: #fda4af !important;
  box-shadow: 0 16px 32px -4px rgba(244, 63, 94, 0.12), 0 4px 12px -2px rgba(15, 23, 42, 0.05) !important;
}

#popular-tools .tool-icon {
  background: #ffe4e6 !important;
  color: #e11d48 !important;
  border: 1px solid #fecdd3 !important;
  border-radius: 12px !important;
  box-shadow: 0 2px 8px rgba(225, 29, 72, 0.1) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

#popular-tools .tool-card:hover .tool-icon {
  background: #e11d48 !important;
  color: #ffffff !important;
  border-color: #e11d48 !important;
  transform: scale(1.08) !important;
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.3) !important;
}

#popular-tools .section-link {
  color: #e11d48 !important;
  font-weight: 700 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  transition: all 0.2s ease !important;
}

#popular-tools .section-link:hover {
  color: #be123c !important;
}

#popular-tools .section-link svg {
  transition: transform 0.2s ease !important;
}

#popular-tools .section-link:hover svg {
  transform: translateX(4px) !important;
}

/* 4. Quick Access Image Tools */
#canvaSectionQuickImageTools .canva-tpl-count-badge {
  display: inline-flex !important;
  align-items: center !important;
  padding: 4px 12px !important;
  border-radius: 999px !important;
  background: #ffe4e6 !important;
  border: 1px solid #fecdd3 !important;
  color: #e11d48 !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 2px rgba(225, 29, 72, 0.06) !important;
}

body:not(.theme-dark) #canvaSectionQuickImageTools .quick-img-pills-strip {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 18px !important;
  box-shadow: 0 4px 20px -2px rgba(244, 63, 94, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.03) !important;
}

body:not(.theme-dark) #canvaSectionQuickImageTools .quick-img-pill-btn {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 14px !important;
  color: #0f172a !important;
  box-shadow: 0 2px 6px rgba(244, 63, 94, 0.04) !important;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease, background 0.25s ease !important;
  cursor: pointer !important;
}

:is(body.theme-dark, body.dark, html.dark body, [data-theme="dark"] body, body:not(.theme-light)) #canvaSectionQuickImageTools .quick-img-pill-btn,
:is(body.theme-dark, body.dark, html.dark body, [data-theme="dark"] body, body:not(.theme-light)) [data-quick-tool="img-converter"] {
  background: #1e293b !important;
  border: 1px solid #334155 !important;
  border-radius: 14px !important;
  color: #f8fafc !important;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.4) !important;
  cursor: pointer !important;
}

:is(body.theme-dark, body.dark, html.dark body, [data-theme="dark"] body, body:not(.theme-light)) #canvaSectionQuickImageTools .quick-img-pill-btn span,
:is(body.theme-dark, body.dark, html.dark body, [data-theme="dark"] body, body:not(.theme-light)) #canvaSectionQuickImageTools .quick-img-pill-btn div > span:first-child {
  color: #f8fafc !important;
}

:is(body.theme-dark, body.dark, html.dark body, [data-theme="dark"] body, body:not(.theme-light)) #canvaSectionQuickImageTools .quick-img-pill-btn div > span:last-child {
  color: #cbd5e1 !important;
}

#canvaSectionQuickImageTools .quick-img-pill-btn:hover {
  transform: translateY(-3px) !important;
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #0284c7 !important;
  box-shadow: 0 12px 24px -2px rgba(244, 63, 94, 0.14) !important;
}

#canvaSectionQuickImageTools :is(.quick-img-blue-icon, .quick-pdf-badge-icon) {
  background: #eff6ff !important;
  color: #0284c7 !important;
  border: 1px solid #bfdbfe !important;
  border-radius: 10px !important;
  box-shadow: 0 2px 8px rgba(225, 29, 72, 0.1) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

#canvaSectionQuickImageTools .quick-img-pill-btn:hover :is(.quick-img-blue-icon, .quick-pdf-badge-icon) {
  background: #0284c7 !important;
  color: #ffffff !important;
  border-color: #0284c7 !important;
  transform: scale(1.06) !important;
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.3) !important;
}

/* #canvaSectionQuickImageTools [data-quick-tool="img-converter"] inherits standard quick-img-pill-btn */

/* 5. Quick Access PDF Tools */
#canvaSectionQuickPdfTools .canva-tpl-count-badge {
  display: inline-flex !important;
  align-items: center !important;
  padding: 4px 12px !important;
  border-radius: 999px !important;
  background: #fee2e2 !important;
  border: 1px solid #fca5a5 !important;
  color: #b91c1c !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 2px rgba(225, 29, 72, 0.06) !important;
}

#canvaSectionQuickPdfTools .quick-pdf-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 20px !important;
  box-shadow: 0 4px 20px -2px rgba(244, 63, 94, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.03) !important;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease !important;
  cursor: pointer !important;
}

#canvaSectionQuickPdfTools .quick-pdf-card:hover {
  transform: translateY(-4px) !important;
  border-color: #cbd5e1 !important;
  background: #f8fafc !important;
  box-shadow: 0 16px 32px -4px rgba(244, 63, 94, 0.12), 0 4px 12px -2px rgba(15, 23, 42, 0.05) !important;
}

#canvaSectionQuickPdfTools :is(.quick-img-blue-icon, .quick-pdf-badge-icon) {
  background: #fee2e2 !important;
  color: #dc2626 !important;
  border: 1px solid #fca5a5 !important;
  border-radius: 10px !important;
  box-shadow: 0 2px 8px rgba(225, 29, 72, 0.1) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

#canvaSectionQuickPdfTools .quick-pdf-card:hover :is(.quick-img-blue-icon, .quick-pdf-badge-icon) {
  background: #dc2626 !important;
  color: #ffffff !important;
  border-color: #dc2626 !important;
  transform: scale(1.06) !important;
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.3) !important;
}

#canvaSectionQuickPdfTools .quick-pdf-url-crumb {
  color: #64748b !important;
  font-weight: 600 !important;
}

#canvaSectionQuickPdfTools .quick-pdf-card:hover .quick-pdf-link-title {
  color: #0284c7 !important;
}

#canvaSectionQuickPdfTools .quick-pdf-footer {
  border-top: 1px solid #f1f5f9 !important;
  color: #64748b !important;
  font-weight: 600 !important;
}

/* 6. Recent Projects (.ee) */
#canvaSectionRecentProjects .canva-tpl-count-badge,
#recentProjectsCountBadge {
  display: inline-flex !important;
  align-items: center !important;
  padding: 4px 12px !important;
  border-radius: 999px !important;
  background: #ffe4e6 !important;
  border: 1px solid #fecdd3 !important;
  color: #e11d48 !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 2px rgba(225, 29, 72, 0.06) !important;
}

#btnHomeNewBlankProject {
  background: #e11d48 !important;
  border: 1px solid #e11d48 !important;
  color: #ffffff !important;
  border-radius: 12px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  padding: 9px 18px !important;
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.25) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
}

#btnHomeNewBlankProject:hover {
  background: #be123c !important;
  border-color: #be123c !important;
  box-shadow: 0 6px 18px rgba(225, 29, 72, 0.35) !important;
  transform: translateY(-2px) !important;
}

#btnHomeOpenEeFile {
  background: #ffe4e6 !important;
  border: 1px solid #fecdd3 !important;
  color: #e11d48 !important;
  border-radius: 12px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  padding: 9px 18px !important;
  box-shadow: 0 2px 6px rgba(225, 29, 72, 0.08) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
}

#btnHomeOpenEeFile:hover {
  background: #fecdd3 !important;
  border-color: #fda4af !important;
  color: #be123c !important;
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.15) !important;
  transform: translateY(-2px) !important;
}

#btnHomeClearRecentProjects:hover {
  background: #ffe4e6 !important;
  border-color: #fda4af !important;
  color: #e11d48 !important;
}

#btnEmptyRecentStartBlank {
  background: #e11d48 !important;
  border: 1px solid #e11d48 !important;
  color: #ffffff !important;
  border-radius: 12px !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.25) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

#btnEmptyRecentStartBlank:hover {
  background: #be123c !important;
  border-color: #be123c !important;
  box-shadow: 0 6px 18px rgba(225, 29, 72, 0.35) !important;
  transform: translateY(-2px) !important;
}

#canvaSectionRecentProjects .recent-project-card {
  background: #ffffff !important;
  border: 1px solid #fecdd3 !important;
  border-radius: 20px !important;
  box-shadow: 0 4px 20px -2px rgba(244, 63, 94, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.03) !important;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease !important;
  cursor: pointer !important;
}

#canvaSectionRecentProjects .recent-project-card:hover {
  border-color: #fda4af !important;
  box-shadow: 0 16px 32px -4px rgba(244, 63, 94, 0.12), 0 4px 12px -2px rgba(15, 23, 42, 0.05) !important;
  transform: translateY(-4px) !important;
}

.recent-project-ext-badge {
  background: #e11d48 !important;
  color: #ffffff !important;
  border-radius: 6px !important;
}

[data-open-recent-id] {
  background: #e11d48 !important;
  border: 1px solid #e11d48 !important;
  color: #ffffff !important;
  border-radius: 8px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 8px rgba(225, 29, 72, 0.25) !important;
  transition: all 0.2s ease !important;
}

[data-open-recent-id]:hover {
  background: #be123c !important;
  border-color: #be123c !important;
  transform: translateY(-1px) !important;
}

[data-dl-recent-id] {
  background: #ffe4e6 !important;
  border: 1px solid #fecdd3 !important;
  color: #e11d48 !important;
  border-radius: 8px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  transition: all 0.2s ease !important;
}

[data-dl-recent-id]:hover {
  background: #fecdd3 !important;
  border-color: #fda4af !important;
  color: #be123c !important;
  transform: translateY(-1px) !important;
}

/* 7. Template Section Pills */
#canvaSectionTemplates .canva-pill.active {
  background: #e11d48 !important;
  color: #ffffff !important;
  border-color: #e11d48 !important;
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.25) !important;
}

#canvaSectionTemplates .canva-pill:hover:not(.active) {
  background: #fff1f2 !important;
  color: #e11d48 !important;
  border-color: #fecdd3 !important;
}

/* 8. Accordions */
.ee-live-library > details[open] {
  border-color: #fecdd3 !important;
}

.ee-live-library summary:hover {
  color: #e11d48 !important;
}

/* 9. Dark Mode Support */
:is([data-theme="dark"], body:not(.theme-light), body.theme-dark) :is(
  .categories .category-card,
  #popular-tools .tool-card,
  #canvaSectionQuickImageTools .quick-img-pills-strip,
  #canvaSectionQuickImageTools .quick-img-pill-btn,
  #canvaSectionQuickPdfTools .quick-pdf-card,
  #canvaSectionRecentProjects .recent-project-card
) {
  background: #1e293b !important;
  border-color: #334155 !important;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.4) !important;
}

:is([data-theme="dark"], body:not(.theme-light), body.theme-dark) :is(
  .categories .category-card:hover,
  #popular-tools .tool-card:hover,
  #canvaSectionQuickImageTools .quick-img-pill-btn:hover,
  #canvaSectionQuickPdfTools .quick-pdf-card:hover,
  #canvaSectionRecentProjects .recent-project-card:hover
) {
  border-color: #3f3f46 !important;
  box-shadow: 0 16px 32px -4px rgba(0, 0, 0, 0.6) !important;
}

:is([data-theme="dark"], body:not(.theme-light), body.theme-dark) :is(
  .categories .category-icon-wrapper,
  #popular-tools .tool-icon,
  #canvaSectionQuickImageTools :is(.quick-img-blue-icon, .quick-pdf-badge-icon),
  #canvaSectionQuickPdfTools :is(.quick-img-blue-icon, .quick-pdf-badge-icon),
  #canvaSectionQuickImageTools .canva-tpl-count-badge,
  #canvaSectionQuickPdfTools .canva-tpl-count-badge,
  #canvaSectionRecentProjects .canva-tpl-count-badge,
  #recentProjectsCountBadge,
  #canvaHeroSection .badge
) {
  background: rgba(225, 29, 72, 0.15) !important;
  color: #fb7185 !important;
  border-color: rgba(225, 29, 72, 0.3) !important;
}

:is([data-theme="dark"], body:not(.theme-light), body.theme-dark) #btnHomeOpenEeFile {
  background: #27272a !important;
  border-color: #3f3f46 !important;
  color: #fb7185 !important;
}

:is([data-theme="dark"], body:not(.theme-light), body.theme-dark) #btnHomeOpenEeFile:hover {
  background: #3f3f46 !important;
  border-color: #52525b !important;
  color: #fda4af !important;
}

:is([data-theme="dark"], body:not(.theme-light), body.theme-dark) [data-dl-recent-id] {
  background: #27272a !important;
  border-color: #3f3f46 !important;
  color: #fb7185 !important;
}

:is([data-theme="dark"], body:not(.theme-light), body.theme-dark) #canvaHeroSection .btn-secondary,
:is([data-theme="dark"], body:not(.theme-light), body.theme-dark) #canvaHeroSection a[href*="template"].btn-secondary {
  background: #27272a !important;
  border-color: #3f3f46 !important;
  color: #fb7185 !important;
}

:is([data-theme="dark"], body:not(.theme-light), body.theme-dark) #canvaHeroSection .btn-secondary:hover,
:is([data-theme="dark"], body:not(.theme-light), body.theme-dark) #canvaHeroSection a[href*="template"].btn-secondary:hover {
  background: #3f3f46 !important;
  border-color: #52525b !important;
  color: #fda4af !important;
}

/* 10. RTL Support (Arabic) */
[dir="rtl"] #popular-tools .section-link svg {
  transform: rotate(180deg) !important;
}

[dir="rtl"] #popular-tools .section-link:hover svg {
  transform: rotate(180deg) translateX(4px) !important;
}


/* ========================================================
   MOST POPULAR TOOLS: SINGLE-ROW 6-CARD GRID & HORIZONTAL SCROLL
   ======================================================== */
#popular-tools {
  padding: 40px 0 48px !important;
}

#popular-tools .section-header {
  margin-bottom: 24px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

#popular-tools .section-title {
  font-size: 28px !important;
  font-weight: 800 !important;
  margin: 0 !important;
  letter-spacing: -0.02em !important;
}

#popular-tools .tools-grid,
.most-popular-tools-grid {
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  gap: 14px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

#popular-tools .tool-card {
  min-width: 0 !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  padding: 22px 10px !important;
  min-height: 140px !important;
  border-radius: 18px !important;
  text-decoration: none !important;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease !important;
  cursor: pointer !important;
}

#popular-tools .tool-icon {
  width: 52px !important;
  height: 52px !important;
  min-width: 52px !important;
  min-height: 52px !important;
  border-radius: 14px !important;
  margin-bottom: 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

#popular-tools .tool-icon svg {
  width: 26px !important;
  height: 26px !important;
}

#popular-tools .tool-title {
  font-size: 14.5px !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
  text-align: center !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
  display: block !important;
}

/* Light Mode Card and Surface Styling */
body.theme-light #popular-tools .section-title,
body:not(.theme-dark) #popular-tools .section-title {
  color: #0f172a !important;
}

body.theme-light #popular-tools .tool-card,
body:not(.theme-dark) #popular-tools .tool-card {
  background: #ffffff !important;
  border: 1px solid #fecdd3 !important;
  box-shadow: 0 4px 20px -2px rgba(244, 63, 94, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.03) !important;
}

body.theme-light #popular-tools .tool-card:hover,
body:not(.theme-dark) #popular-tools .tool-card:hover {
  transform: translateY(-4px) !important;
  border-color: #fda4af !important;
  box-shadow: 0 16px 32px -4px rgba(244, 63, 94, 0.12), 0 4px 12px -2px rgba(15, 23, 42, 0.05) !important;
}

body.theme-light #popular-tools .tool-icon,
body:not(.theme-dark) #popular-tools .tool-icon {
  background: #ffe4e6 !important;
  color: #e11d48 !important;
  border: 1px solid #fecdd3 !important;
}

body.theme-light #popular-tools .tool-card:hover .tool-icon,
body:not(.theme-dark) #popular-tools .tool-card:hover .tool-icon {
  background: #e11d48 !important;
  color: #ffffff !important;
  border-color: #e11d48 !important;
  transform: scale(1.08) !important;
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.3) !important;
}

body.theme-light #popular-tools .tool-title,
body.theme-light #popular-tools .tool-title span,
body:not(.theme-dark) #popular-tools .tool-title,
body:not(.theme-dark) #popular-tools .tool-title span {
  color: #0f172a !important;
}

/* Dark Mode Card and Surface Styling */
:is([data-theme="dark"], body:not(.theme-light), body.theme-dark) #popular-tools .section-title {
  color: #f8fafc !important;
}

:is([data-theme="dark"], body:not(.theme-light), body.theme-dark) #popular-tools .tool-card {
  background: #1e293b !important;
  border: 1px solid #334155 !important;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.4) !important;
}

:is([data-theme="dark"], body:not(.theme-light), body.theme-dark) #popular-tools .tool-card:hover {
  background: #273549 !important;
  border-color: #475569 !important;
  transform: translateY(-4px) !important;
  box-shadow: 0 16px 32px -4px rgba(0, 0, 0, 0.6) !important;
}

:is([data-theme="dark"], body:not(.theme-light), body.theme-dark) #popular-tools .tool-icon {
  background: #27272a !important;
  border: 1px solid #3f3f46 !important;
  color: #fb7185 !important;
}

:is([data-theme="dark"], body:not(.theme-light), body.theme-dark) #popular-tools .tool-card:hover .tool-icon {
  background: #e11d48 !important;
  color: #ffffff !important;
  border-color: #e11d48 !important;
  transform: scale(1.08) !important;
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.4) !important;
}

:is([data-theme="dark"], body:not(.theme-light), body.theme-dark) #popular-tools .tool-title,
:is([data-theme="dark"], body:not(.theme-light), body.theme-dark) #popular-tools .tool-title span {
  color: #f8fafc !important;
}

/* Tablet and Mobile: Single horizontal scrollable row */
@media (max-width: 900px) {
  #popular-tools .tools-grid,
  .most-popular-tools-grid {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    overscroll-behavior-x: contain !important;
    scroll-snap-type: x mandatory !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 12px !important;
    padding: 4px 4px 12px 4px !important;
    scrollbar-width: thin !important;
    scrollbar-color: rgba(225, 29, 72, 0.3) transparent !important;
  }

  #popular-tools .tools-grid::-webkit-scrollbar,
  .most-popular-tools-grid::-webkit-scrollbar {
    height: 6px !important;
  }

  #popular-tools .tools-grid::-webkit-scrollbar-thumb,
  .most-popular-tools-grid::-webkit-scrollbar-thumb {
    background: rgba(225, 29, 72, 0.25) !important;
    border-radius: 999px !important;
  }

  #popular-tools .tools-grid > *,
  .most-popular-tools-grid > * {
    flex: 0 0 165px !important;
    min-width: 165px !important;
    max-width: 165px !important;
    scroll-snap-align: start !important;
  }
}


/* ========================================================
   EASYEDIT DARK MODE TEXT CONTRAST FIXES (POPULAR TOOLS & LOGIN)
   ======================================================== */

/* Fix 01: Popular Tools Dark Mode Surface, Border & Title */
:is([data-theme="dark"], body:not(.theme-light), body.theme-dark) :is(body, main, #canvaLandingHome) #popular-tools .section-title {
  color: #f8fafc !important;
}

:is([data-theme="dark"], body:not(.theme-light), body.theme-dark) :is(body, main, #canvaLandingHome) #popular-tools .tool-card {
  background: #1e293b !important;
  border: 1px solid #334155 !important;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.4) !important;
}

:is([data-theme="dark"], body:not(.theme-light), body.theme-dark) :is(body, main, #canvaLandingHome) #popular-tools .tool-card:hover {
  background: #273549 !important;
  border-color: #475569 !important;
  transform: translateY(-4px) !important;
  box-shadow: 0 16px 32px -4px rgba(0, 0, 0, 0.6) !important;
}

:is([data-theme="dark"], body:not(.theme-light), body.theme-dark) :is(body, main, #canvaLandingHome) #popular-tools .tool-icon {
  background: #27272a !important;
  border: 1px solid #3f3f46 !important;
  color: #fb7185 !important;
}

:is([data-theme="dark"], body:not(.theme-light), body.theme-dark) :is(body, main, #canvaLandingHome) #popular-tools .tool-card:hover .tool-icon {
  background: #e11d48 !important;
  color: #ffffff !important;
  border-color: #e11d48 !important;
  transform: scale(1.08) !important;
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.4) !important;
}

:is([data-theme="dark"], body:not(.theme-light), body.theme-dark) :is(body, main, #canvaLandingHome) #popular-tools .tool-title,
:is([data-theme="dark"], body:not(.theme-light), body.theme-dark) :is(body, main, #canvaLandingHome) #popular-tools .tool-title span {
  color: #f8fafc !important;
}

/* Fix 02: Header Login Button Dark Mode High-Contrast Readable Text */
:is([data-theme="dark"], body:not(.theme-light), body.theme-dark) :is(body, main, #canvaLandingHome) #eeLoginBtn,
:is([data-theme="dark"], body:not(.theme-light), body.theme-dark) :is(body, main, #canvaLandingHome) .ee-auth-login-btn {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #d1d5db !important;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
}

:is([data-theme="dark"], body:not(.theme-light), body.theme-dark) :is(body, main, #canvaLandingHome) #eeLoginBtn:hover,
:is([data-theme="dark"], body:not(.theme-light), body.theme-dark) :is(body, main, #canvaLandingHome) .ee-auth-login-btn:hover {
  background: #f1f5f9 !important;
  border-color: #94a3b8 !important;
  color: #0f172a !important;
}

:is([data-theme="dark"], body:not(.theme-light), body.theme-dark) :is(body, main, #canvaLandingHome) #eeLoginBtn *,
:is([data-theme="dark"], body:not(.theme-light), body.theme-dark) :is(body, main, #canvaLandingHome) .ee-auth-login-btn * {
  color: #0f172a !important;
}

