/* ============================================================
   AlmiCode — Unified Navigation for Tools
   Single source of truth for all tools routes (/tools/<tool-name>/)
   ============================================================ */

/* Global Slim & Elegant Scrollbar for all Tool Routes (Horizontal & Vertical) */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 229, 255, 0.35) rgba(255, 255, 255, 0.02);
}

*::-webkit-scrollbar {
  width: 6px;
  height: 5px;
}

*::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 9999px;
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.35), rgba(139, 92, 246, 0.35));
  border-radius: 9999px;
  border: 1px solid rgba(0, 229, 255, 0.12);
  transition: all 0.2s ease;
}

*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.75), rgba(139, 92, 246, 0.75));
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.45);
}

*::-webkit-scrollbar-corner {
  background: transparent;
}

/* Top Navigation Bar Mount & Header */
#tools-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  width: 100%;
}

body.has-tools-nav,
body:has(#tools-navbar) {
  padding-top: 56px;
}

.tools-top-nav {
  background: rgba(10, 11, 16, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: relative;
  width: 100%;
  padding: 0.75rem 1.25rem;
}

.tools-nav-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* Brand Link with (Tools) Badge */
.tools-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: #eaedf3;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.tools-brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
}

.tools-brand-badge {
  background: rgba(0, 229, 255, 0.12);
  color: #00e5ff;
  border: 1px solid rgba(0, 229, 255, 0.28);
  padding: 0.18rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

/* Gradient Text Helper */
.tools-gradient-text {
  background: linear-gradient(135deg, #00e5ff, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Desktop Navigation Actions */
.tools-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.tools-btn-link {
  color: #9aa1b9;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  padding: 0.48rem 0.95rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.2s ease;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

.tools-btn-link:hover {
  color: #eaedf3;
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
}

.tools-btn-tools {
  color: #00e5ff;
  border: 1px solid rgba(0, 229, 255, 0.25);
  background: rgba(0, 229, 255, 0.07);
}

.tools-btn-tools:hover {
  color: #ffffff;
  border-color: #00e5ff;
  background: rgba(0, 229, 255, 0.18);
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.2);
}

.tools-btn-cta {
  background: rgba(255, 255, 255, 0.06);
  color: #eaedf3;
}

.tools-btn-cta:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Mobile Hamburger Button */
.tools-nav-toggle {
  display: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  width: 42px;
  height: 42px;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
  transition: all 0.2s ease;
  color: #eaedf3;
}

.tools-nav-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
}

.tools-nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: #eaedf3;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
  transform-origin: center;
}

.tools-nav-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.tools-nav-toggle.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.tools-nav-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Dropdown Drawer */
.tools-mobile-drawer {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(10, 11, 16, 0.98);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  padding: 1.25rem 1.25rem 1.5rem;
  flex-direction: column;
  gap: 0.65rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
  z-index: 999;
}

.tools-mobile-drawer.active {
  display: flex;
  animation: toolsNavDrawerSlide 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

.tools-mobile-item {
  color: #eaedf3;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.85rem 1.1rem;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.2s ease;
  cursor: pointer;
  font-family: inherit;
  width: 100%;
  text-align: left;
}

.tools-mobile-item:hover,
.tools-mobile-item:active {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.tools-mobile-item.active-tool {
  background: rgba(0, 229, 255, 0.08);
  border-color: rgba(0, 229, 255, 0.3);
  color: #00e5ff;
}

.tools-mobile-item svg {
  color: #00e5ff;
  flex-shrink: 0;
}

.tools-mobile-item-desc {
  display: block;
  font-size: 0.76rem;
  color: #9aa1b9;
  font-weight: 400;
  margin-top: 2px;
}

/* Responsive Breakpoints */
@media (max-width: 950px) {
  .tools-nav-actions {
    display: none;
  }

  .tools-nav-toggle {
    display: flex;
  }
}

/* ============================================================
   Central de Ferramentas Modal (Included in tools-nav)
   ============================================================ */
.tools-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 10, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  visibility: hidden;
}

.tools-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.tools-modal-card {
  background: #0f111a;
  background-image:
    radial-gradient(circle at 10% 10%, rgba(0, 229, 255, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 90%, rgba(139, 92, 246, 0.08) 0%, transparent 40%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  max-width: 660px;
  width: 100%;
  max-height: 88vh;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.05);
  transform: scale(0.94) translateY(12px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tools-modal-overlay.active .tools-modal-card {
  transform: scale(1) translateY(0);
}

.tools-modal-header {
  display: flex !important;
  flex-direction: column !important;
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 17, 26, 0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 2;
  flex-shrink: 0;
}

.tools-modal-header-top {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: 1rem;
  margin-bottom: 0.85rem;
  width: 100% !important;
}

.tools-modal-header-text .section-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: #00e5ff;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.tools-modal-header-text h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0.15rem 0 0.25rem;
  color: #eaedf3;
  line-height: 1.2;
}

.tools-modal-subtitle {
  font-size: 0.82rem;
  color: #9aa1b9;
  line-height: 1.4;
  margin: 0;
}

.tools-modal-close {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #9aa1b9;
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.tools-modal-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #eaedf3;
  transform: rotate(90deg);
}

/* Modal Search Box */
.tools-search-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.tools-search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.tools-search-icon {
  position: absolute;
  left: 0.85rem;
  color: #9aa1b9;
  pointer-events: none;
  transition: color 0.2s;
}

.tools-search-box input,
.tools-search-box input[type="text"] {
  width: 100% !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 12px !important;
  padding: 0.65rem 2.4rem 0.65rem 2.6rem !important;
  color: #eaedf3 !important;
  font-family: inherit !important;
  font-size: 0.88rem !important;
  outline: none !important;
  transition: all 0.2s ease !important;
}

.tools-search-box input:focus,
.tools-search-box input[type="text"]:focus {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: #00e5ff !important;
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.18) !important;
}

.tools-search-box input:focus ~ .tools-search-icon,
.tools-search-box input[type="text"]:focus ~ .tools-search-icon {
  color: #00e5ff;
}

.tools-search-clear {
  position: absolute;
  right: 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #9aa1b9;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  line-height: 1;
  transition: all 0.15s;
}

.tools-search-clear:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.tools-search-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.74rem;
  color: #5e6482;
  padding: 0 0.25rem;
}

/* Modal Scrollable Body */
.tools-modal-body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tools-modal-body::-webkit-scrollbar {
  width: 6px;
}

.tools-modal-body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
}

.tools-modal-body::-webkit-scrollbar-thumb {
  background: rgba(0, 229, 255, 0.2);
  border-radius: 9999px;
}

.tools-modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 229, 255, 0.4);
}

/* Tool Cards inside Modal (Compact with Collapsible Details) */
.tool-modal-item {
  flex-shrink: 0 !important;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 0.85rem 1.15rem;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  color: inherit;
  display: block;
}

.tool-modal-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(135deg, #00e5ff, #8b5cf6);
  opacity: 0.75;
  transition: width 0.2s ease, opacity 0.2s ease;
}

.tool-modal-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(0, 229, 255, 0.35);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.tool-modal-item:hover::before {
  opacity: 1;
  width: 5px;
}

/* Main visible row: Icon + Title + Actions */
.tool-modal-item-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
}

.tool-modal-item-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1;
}

.tool-modal-icon-badge {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(0, 229, 255, 0.12);
  border: 1px solid rgba(0, 229, 255, 0.25);
  color: #00e5ff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tool-icon-profit {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
  color: #10b981;
}

.tool-icon-correios {
  background: rgba(0, 229, 255, 0.12);
  border-color: rgba(0, 229, 255, 0.3);
  color: #00e5ff;
}

.tool-icon-receipt {
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.3);
  color: #a78bfa;
}

.tool-icon-whatsapp {
  background: rgba(37, 211, 102, 0.12);
  border-color: rgba(37, 211, 102, 0.3);
  color: #25d366;
}

.tool-modal-item-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #eaedf3;
  margin: 0;
  line-height: 1.3;
}

.tool-modal-item-title a {
  color: #eaedf3;
  text-decoration: none;
  transition: color 0.2s ease;
}

.tool-modal-item-title a:hover {
  color: #00e5ff;
}

.tool-modal-item-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Detalhes toggle button */
.btn-tool-details-toggle {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #9aa1b9;
  padding: 0.38rem 0.72rem;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
}

.btn-tool-details-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #eaedf3;
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-tool-details-toggle.active {
  background: rgba(0, 229, 255, 0.12);
  color: #00e5ff;
  border-color: rgba(0, 229, 255, 0.35);
}

.btn-tool-details-toggle .chevron-icon {
  transition: transform 0.25s ease;
}

.btn-tool-details-toggle.active .chevron-icon {
  transform: rotate(180deg);
}

/* Direct Access Button */
.btn-tool-open-now {
  background: linear-gradient(135deg, #00e5ff, #8b5cf6);
  color: #07090e !important;
  border: none;
  padding: 0.42rem 0.85rem;
  border-radius: 8px;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 229, 255, 0.2);
  white-space: nowrap;
}

.btn-tool-open-now:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 229, 255, 0.4);
}

.tool-badge-upcoming {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  letter-spacing: 0.4px;
  background: rgba(255, 255, 255, 0.06);
  color: #9aa1b9;
  border: 1px solid rgba(255, 255, 255, 0.12);
  white-space: nowrap;
}

/* Collapsible Details Drawer */
.tool-modal-details {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  animation: detailsSlideDown 0.22s ease;
}

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

.tool-modal-details-content p {
  color: #9aa1b9;
  font-size: 0.84rem;
  line-height: 1.55;
  margin: 0 0 0.65rem 0;
}

.tool-modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.25rem;
}

.tool-modal-tag {
  font-size: 0.73rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.18rem 0.52rem;
  border-radius: 6px;
  color: #9aa1b9;
}

@media (max-width: 520px) {
  .tool-modal-item {
    padding: 0.85rem 0.95rem;
  }
  
  .tool-modal-item-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
  }

  .tool-modal-item-info {
    width: 100%;
  }

  .tool-modal-item-title {
    font-size: 0.96rem;
  }

  .tool-modal-item-actions {
    width: 100%;
    justify-content: flex-end;
    gap: 0.5rem;
  }
}

/* Empty Search State */
.tool-modal-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2.5rem 1rem;
  color: #9aa1b9;
  gap: 0.75rem;
}

.tool-modal-empty svg {
  color: #5e6482;
}

.tool-modal-empty h4 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  color: #eaedf3;
  margin: 0;
}

.tool-modal-empty p {
  font-size: 0.85rem;
  max-width: 380px;
  margin: 0;
  line-height: 1.45;
}

.btn-clear-search-filter {
  background: rgba(0, 229, 255, 0.12);
  border: 1px solid rgba(0, 229, 255, 0.3);
  color: #00e5ff;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 0.5rem;
}

.btn-clear-search-filter:hover {
  background: rgba(0, 229, 255, 0.2);
}

.tools-modal-footer {
  padding: 0.85rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.8rem;
  color: #5e6482;
  text-align: center;
  background: rgba(10, 11, 16, 0.4);
  flex-shrink: 0;
}

.tools-modal-footer a {
  color: #00e5ff;
  text-decoration: underline;
  cursor: pointer;
}

@media (max-width: 640px) {
  .tools-modal-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .tools-modal-card {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    max-height: 90vh;
    transform: translateY(100%);
  }

  .tools-modal-overlay.active .tools-modal-card {
    transform: translateY(0);
  }

  .tools-modal-header {
    padding: 1.15rem 1.15rem 0.85rem;
  }

  .tools-modal-body {
    padding: 1rem 1.15rem;
  }
}