/* ============================================================
   BeTranslated AI Tools Dashboard — styles.css  v6
   Redesigned for clarity, visual hierarchy, and brand polish
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=DM+Sans:wght@400;500;600;700&display=swap');

/* ---- CSS Variables ---- */
:root {
  --navy:          #2F3143;
  --navy-light:    #3d4060;
  --navy-dark:     #1e2035;
  --navy-50:       #f0f0f4;
  --teal:          #7EBEC5;
  --teal-dark:     #4a9da6;
  --teal-deep:     #2d7d86;
  --teal-light:    #e8f6f8;
  --teal-mid:      #b8dde1;
  --orange:        #F67618;
  --orange-deep:   #d45e08;
  --orange-light:  #fff1e6;
  --orange-mid:    #fdd5aa;
  --white:         #ffffff;
  --off-white:     #f5f6fa;
  --surface:       #fafbfc;
  --gray-50:       #f8f9fb;
  --gray-100:      #eef0f4;
  --gray-200:      #e1e4eb;
  --gray-300:      #c8cdd8;
  --gray-400:      #9ba3b4;
  --gray-500:      #7a8296;
  --gray-600:      #5c6475;
  --gray-700:      #434a5a;
  --gray-800:      #2e3340;
  --sidebar-w:     248px;
  --topbar-h:      60px;
  --shadow-xs:     0 1px 2px rgba(47,49,67,0.06);
  --shadow-sm:     0 1px 4px rgba(47,49,67,0.08), 0 1px 2px rgba(47,49,67,0.04);
  --shadow-md:     0 4px 16px rgba(47,49,67,0.1), 0 1px 4px rgba(47,49,67,0.06);
  --shadow-lg:     0 12px 40px rgba(47,49,67,0.16), 0 4px 12px rgba(47,49,67,0.08);
  --shadow-orange: 0 4px 16px rgba(246,118,24,0.2);
  --shadow-teal:   0 4px 16px rgba(126,190,197,0.25);
  --radius-xs:     4px;
  --radius-sm:     8px;
  --radius-md:     12px;
  --radius-lg:     16px;
  --radius-xl:     20px;
  --transition:    0.15s ease;
  --transition-md: 0.22s cubic-bezier(0.4,0,0.2,1);
  --font:          'DM Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:     'JetBrains Mono', 'Fira Code', monospace;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--off-white);
  color: var(--gray-600);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: var(--font); cursor: pointer; border: none; background: none; }

/* ============================================================
   TOP BAR
   ============================================================ */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-h);
  background: var(--navy-dark);
  display: flex;
  align-items: center;
  padding: 0 20px 0 0;
  z-index: 300;
  box-shadow: 0 1px 0 rgba(255,255,255,0.05), 0 2px 16px rgba(0,0,0,0.25);
  gap: 0;
}

/* Subtle background texture on topbar */
.topbar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(126,190,197,0.03) 0%, transparent 60%);
  pointer-events: none;
}

/* Left section: hamburger + brand */
.topbar-left {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  height: var(--topbar-h);
  border-right: 1px solid rgba(255,255,255,0.07);
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
}
/* Hamburger */
.sidebar-toggle {
  width: 52px;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: rgba(255,255,255,0.65);
  transition: background var(--transition), color var(--transition);
  position: relative;
  z-index: 1;
}
.sidebar-toggle:hover {
  background: rgba(255,255,255,0.05);
  color: var(--white);
}
/* Brand / logo area */
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px 0 4px;
  color: var(--white);
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
  text-decoration: none;
}
.topbar-logo {
  height: 28px;
  width: auto;
  filter: brightness(0) invert(1);
}
.topbar-logo-fallback {
  font-size: 15px;
  font-weight: 700;
  color: var(--white);
  white-space: nowrap;
}
.topbar-divider {
  width: 1px;
  height: 20px;
  background: rgba(255,255,255,0.15);
}
.topbar-title {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.55);
  white-space: nowrap;
  letter-spacing: 0.01em;
}

/* Search */
.topbar-center {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 0 24px;
  min-width: 0;
  position: relative;
  z-index: 1;
}
.search-wrapper {
  position: relative;
  width: 100%;
  max-width: 400px;
}
.search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,0.32);
  pointer-events: none;
}
.search-input {
  width: 100%;
  height: 38px;
  padding: 0 38px 0 38px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-xl);
  color: var(--white);
  font-family: var(--font);
  font-size: 13px;
  outline: none;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.search-input::placeholder { color: rgba(255,255,255,0.3); }
.search-input:focus {
  background: rgba(255,255,255,0.12);
  border-color: rgba(126,190,197,0.5);
  box-shadow: 0 0 0 3px rgba(126,190,197,0.12);
}
.search-clear {
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,0.4);
  font-size: 11px;
  padding: 4px 6px;
  display: none;
  border-radius: 50%;
  transition: color var(--transition);
  line-height: 1;
}
.search-clear:hover { color: var(--white); }
.search-clear.visible { display: block; }

/* Right badges */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.admin-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(126,190,197,0.12);
  border: 1px solid rgba(126,190,197,0.2);
  color: var(--teal);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-xl);
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.tools-count-badge {
  background: var(--orange);
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--radius-xl);
  letter-spacing: 0.02em;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(246,118,24,0.3);
}
.version-badge {
  font-size: 10.5px;
  font-weight: 500;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.02em;
  white-space: nowrap;
  padding: 4px 10px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-xl);
  background: rgba(255,255,255,0.05);
}

/* Language switcher */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 4px;
}
.lang-switcher a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 16px;
  text-decoration: none;
  opacity: 0.55;
  transition: opacity 0.15s, background 0.15s;
  background: transparent;
}
.lang-switcher a:hover {
  opacity: 1;
  background: rgba(255,255,255,0.1);
}
.lang-switcher a.active {
  opacity: 1;
  background: rgba(255,255,255,0.12);
  box-shadow: 0 0 0 1.5px rgba(255,255,255,0.2);
}
/* ============================================================
   LAYOUT
   ============================================================ */
.layout {
  display: flex;
  min-height: 100vh;
  padding-top: var(--topbar-h);
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--white);
  border-right: 1px solid var(--gray-100);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 200;
  transition: transform var(--transition-md);
  scrollbar-width: thin;
  scrollbar-color: var(--gray-200) transparent;
}
.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 4px; }

.sidebar-inner {
  padding: 16px 0 40px;
  display: flex;
  flex-direction: column;
}

/* Nav group */
.nav-group { margin-top: 8px; }

.nav-group-label {
  display: block;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gray-300);
  padding: 10px 18px 5px;
}

/* Nav items */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 0 10px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 11px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-500);
  transition: background var(--transition), color var(--transition);
  text-align: left;
}
.nav-item svg { flex-shrink: 0; opacity: 0.5; transition: opacity var(--transition); }
.nav-label { flex: 1; line-height: 1.3; }
.nav-count {
  font-size: 9.5px;
  font-weight: 700;
  background: var(--gray-100);
  color: var(--gray-400);
  padding: 1px 6px;
  border-radius: 8px;
  min-width: 20px;
  text-align: center;
  flex-shrink: 0;
  transition: background var(--transition), color var(--transition);
}

.nav-item:hover {
  background: var(--teal-light);
  color: var(--navy);
}
.nav-item:hover svg { opacity: 1; }
.nav-item:hover .nav-count {
  background: var(--teal-mid);
  color: var(--teal-deep);
}

.nav-item.active {
  background: var(--navy);
  color: var(--white);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(47,49,67,0.15);
}
.nav-item.active svg { opacity: 1; color: var(--teal); }
.nav-item.active .nav-count {
  background: rgba(126,190,197,0.25);
  color: var(--teal);
}

/* Sidebar footer */
.sidebar-footer {
  margin-top: 24px;
  padding: 16px 18px 8px;
  border-top: 1px solid var(--gray-100);
}
.sidebar-site-link {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: var(--gray-400);
  transition: color var(--transition);
  font-weight: 500;
}
.sidebar-site-link:hover { color: var(--teal-deep); }

/* Overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 190;
  backdrop-filter: blur(2px);
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  padding: 32px 36px 64px;
  display: flex;
  flex-direction: column;
}

/* Page header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-header-left {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.page-title {
  font-size: 21px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.page-count {
  font-size: 12.5px;
  color: var(--gray-400);
  font-weight: 500;
}
.premium-legend {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--orange-deep);
  background: var(--orange-light);
  border: 1px solid rgba(246,118,24,0.18);
  padding: 5px 12px;
  border-radius: var(--radius-xl);
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* ============================================================
   TOOLS GRID
   ============================================================ */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(275px, 1fr));
  gap: 14px;
}

/* Section dividers */
.section-divider {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 6px;
}
.section-divider-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--gray-400);
  white-space: nowrap;
}
.section-divider-line {
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}

/* Premium notice */
.premium-notice {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--orange-light), #fff7f0);
  border: 1px solid rgba(246,118,24,0.18);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  font-size: 12.5px;
  color: var(--gray-700);
  margin-bottom: 4px;
}
.premium-notice svg { color: var(--orange); flex-shrink: 0; }

/* ============================================================
   TOOL CARD — redesigned
   ============================================================ */
.tool-card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  padding: 18px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  transition: box-shadow var(--transition-md), transform var(--transition-md), border-color var(--transition);
  animation: fadeUp 0.24s ease both;
  position: relative;
  overflow: hidden;
}

/* Subtle top accent line — hidden by default, shown on hover */
.tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--teal), var(--teal-dark));
  opacity: 0;
  transition: opacity var(--transition-md);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

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

.tool-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: var(--teal-mid);
}
.tool-card:hover::before { opacity: 1; }

.tool-card.premium {
  border-color: rgba(246,118,24,0.2);
  box-shadow: 0 0 0 0.5px rgba(246,118,24,0.08);
}
.tool-card.premium::before {
  background: linear-gradient(90deg, var(--orange), var(--orange-deep));
}
.tool-card.premium:hover {
  border-color: rgba(246,118,24,0.35);
  box-shadow: var(--shadow-orange);
}

/* Card header */
.card-header {
  display: flex;
  align-items: flex-start;
  gap: 13px;
}

/* Favicon container — slightly larger, cleaner */
.card-favicon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--gray-50);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid var(--gray-100);
  box-shadow: var(--shadow-xs);
}
.card-favicon img { width: 32px; height: 32px; object-fit: contain; border-radius: 4px; }
.card-favicon-fallback {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.card-title-group { flex: 1; min-width: 0; padding-top: 1px; }
.card-name {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}
.card-badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 5px;
}
.badge-premium {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--orange);
  color: var(--white);
  font-size: 8.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
/* Link exchange status badges */
.badge-link-account {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}
.badge-link-listed {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #93c5fd;
}
.badge-link-new {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fdba74;
}

.badge-new {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}

.badge-category {
  display: inline-flex;
  align-items: center;
  background: var(--teal-light);
  color: var(--teal-deep);
  font-size: 8.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Card body */
.card-description {
  font-size: 12.5px;
  color: var(--gray-500);
  line-height: 1.6;
  flex: 1;
}

/* Card tags */
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.card-tag {
  font-size: 10px;
  font-weight: 500;
  color: var(--gray-500);
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: 0.01em;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.tool-card:hover .card-tag {
  background: var(--teal-light);
  border-color: var(--teal-mid);
  color: var(--teal-deep);
}

/* Card footer */
.card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-top: 10px;
  border-top: 1px solid var(--gray-100);
}
.card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--teal-deep);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  background: var(--teal-light);
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
  letter-spacing: 0.01em;
}
.card-link:hover {
  background: var(--teal);
  color: var(--white);
  box-shadow: var(--shadow-teal);
}

/* Premium card link */
.tool-card.premium .card-link {
  color: var(--orange-deep);
  background: var(--orange-light);
}
.tool-card.premium .card-link:hover {
  background: var(--orange);
  color: var(--white);
  box-shadow: var(--shadow-orange);
}

/* ============================================================
   NO RESULTS
   ============================================================ */
.no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 90px 24px;
  color: var(--gray-300);
  text-align: center;
}
.no-results p { font-size: 15px; color: var(--gray-400); }
.btn-reset {
  padding: 9px 22px;
  background: var(--navy);
  color: var(--white);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  transition: background var(--transition), box-shadow var(--transition);
  letter-spacing: 0.01em;
}
.btn-reset:hover {
  background: var(--navy-light);
  box-shadow: 0 4px 12px rgba(47,49,67,0.2);
}

/* ============================================================
   MAIN FOOTER
   ============================================================ */
.main-footer {
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 12px;
  color: var(--gray-400);
  flex-wrap: wrap;
}
.main-footer a { transition: color var(--transition); }
.main-footer a:hover { color: var(--teal-deep); }

/* ============================================================
   SIDEBAR COLLAPSED STATE
   ============================================================ */
body.sidebar-collapsed .sidebar {
  transform: translateX(calc(-1 * var(--sidebar-w)));
}
body.sidebar-collapsed .main-content {
  margin-left: 0;
}
body.sidebar-collapsed .topbar-left {
  width: 60px;
  min-width: 60px;
  border-right: none;
}
body.sidebar-collapsed .sidebar-toggle {
  width: 60px;
}

/* ============================================================
   RESPONSIVE — tablet
   ============================================================ */
@media (max-width: 1024px) {
  :root { --sidebar-w: 214px; }
  .main-content { padding: 24px 26px 52px; }
  .topbar-title { display: none; }
  .topbar-divider { display: none; }
}

/* ============================================================
   RESPONSIVE — mobile
   ============================================================ */
@media (max-width: 900px) {
  :root { --sidebar-w: 268px; }

  .sidebar {
    transform: translateX(calc(-1 * var(--sidebar-w)));
    box-shadow: var(--shadow-lg);
  }

  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-overlay { display: block; }

  .main-content {
    margin-left: 0 !important;
    padding: 22px 18px 44px;
  }

  .topbar-left {
    width: auto;
    min-width: unset;
    border-right: none;
  }
  .sidebar-toggle {
    width: 52px;
  }

  .tools-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }

  .page-header { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 600px) {
  .tools-grid { grid-template-columns: 1fr; }
  .topbar-center { display: none; }
  .tools-count-badge { display: none; }
  .main-content { padding: 18px 14px 40px; }
}
