/* ============================================
   GLOBAL DESIGN SYSTEM — Tools Website
   Premium Modern SaaS Edition
   All tool pages must import this file.
   ============================================ */

/* --- CSS Variables (Dark Theme) --- */
:root {
  --bg-primary: #0a0a0f;
  --bg-surface: #14141f;
  --bg-card: #1a1a2e;
  --bg-hover: #1f1f35;
  --accent: #4f8ef7;
  --accent-hover: #6ba3ff;
  --accent-light: rgba(79, 142, 247, 0.12);
  --text-primary: #e8e8f0;
  --text-secondary: #a0a0b8;
  --text-muted: #6b6b8a;
  --border: #2a2a3e;
  --border-light: #3a3a52;
  --success: #4caf50;
  --warning: #ff9800;
  --error: #f44336;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.35);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.4);
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  --font-mono: 'Consolas', 'Monaco', 'Courier New', monospace;
  --transition: 0.25s cubic-bezier(0.23, 1, 0.32, 1);
  --transition-smooth: 0.35s cubic-bezier(0.23, 1, 0.32, 1);
  --max-width: 1200px;
}

/* ===== DARK MODE (default) ===== */
:root,
[data-theme="dark"] {
  --color-bg: #0a0a0f;
  --color-surface: #14141f;
  --color-surface-2: #1c1c2e;
  --color-border: #2a2a3e;
  --color-accent: #4f8ef7;
  --color-accent-hover: #6ba3ff;
  --color-text: #e8e8f0;
  --color-text-muted: #6b6b8a;
  --color-success: #4caf50;
  --color-error: #f44336;
  --color-shadow: rgba(0, 0, 0, 0.5);
  --color-card-hover-shadow: rgba(79, 142, 247, 0.12);
}

/* ===== LIGHT MODE ===== */
[data-theme="light"] {
  --color-bg: #f4f4f9;
  --color-surface: #ffffff;
  --color-surface-2: #f0f0f5;
  --color-border: #e0e0e8;
  --color-accent: #2563eb;
  --color-accent-hover: #1d4ed8;
  --color-text: #111118;
  --color-text-muted: #6b6b7a;
  --color-success: #16a34a;
  --color-error: #dc2626;
  --color-shadow: rgba(0, 0, 0, 0.08);
  --color-card-hover-shadow: rgba(37, 99, 235, 0.1);
}

/* Smooth transition when switching modes */
*, *::before, *::after {
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.15s ease;
}

/* Override transition for specific elements that should not animate */
.tools-grid, .tool-card {
  transition: background-color 0.2s ease, border-color 0.2s ease,
              color 0.15s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

/* --- CSS Reset --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-accent-hover);
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-light);
}

/* --- Reusable Classes --- */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  background-color: var(--color-accent);
  color: #ffffff;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color var(--transition), transform var(--transition);
  font-family: var(--font-family);
}

.btn:hover {
  background-color: var(--color-accent-hover);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-secondary {
  background-color: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background-color: var(--color-surface-2);
  border-color: var(--border-light);
}

.btn-danger {
  background-color: var(--color-error);
}

.btn-danger:hover {
  background-color: #d32f2f;
}

.btn-success {
  background-color: var(--color-success);
}

.btn-success:hover {
  background-color: #388e3c;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
}

/* Cards (Premium) */
.card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition-smooth);
}

.card:hover {
  border-color: var(--color-accent);
  box-shadow: 0 8px 28px var(--color-shadow);
  transform: translateY(-2px);
}

/* Back Button */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--color-text-muted);
  font-size: 14px;
  margin-bottom: 20px;
  transition: color var(--transition);
}

.back-btn:hover {
  color: var(--color-accent);
}

/* Tool Container */
.tool-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 30px 20px;
  width: 100%;
  flex: 1;
}

.tool-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--color-text);
}

.tool-description {
  font-size: 16px;
  color: var(--color-text-muted);
  margin-bottom: 24px;
}

/* Section */
.section {
  margin-bottom: 24px;
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--color-text);
}

/* Labels */
label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

/* Inputs, Textareas, Selects */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="search"],
input[type="date"],
input[type="time"],
input[type="color"],
textarea,
select {
  width: 100%;
  padding: 10px 14px;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  color: var(--color-text);
  font-size: 14px;
  font-family: var(--font-family);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

textarea {
  resize: vertical;
  min-height: 100px;
  font-family: var(--font-mono);
}

select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding-right: 40px;
}

select:hover {
  border-color: var(--color-border-hover, #475569);
}

select:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

select option {
  background: var(--color-surface, #1e293b);
  color: var(--color-text, #f1f5f9);
}

select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.5);
}

/* Remove default arrow in IE */
select::-ms-expand {
  display: none;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--color-accent);
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--color-accent);
  margin-right: 6px;
}

/* Code blocks */
code, pre {
  font-family: var(--font-mono);
  background-color: var(--color-surface);
  border-radius: var(--radius);
}

code {
  padding: 2px 6px;
  font-size: 13px;
}

pre {
  padding: 16px;
  overflow-x: auto;
  border: 1px solid var(--color-border);
  font-size: 13px;
  line-height: 1.5;
}

/* Utility classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--color-text-muted); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.w-full { width: 100%; }

/* --- Responsive --- */
@media (max-width: 600px) {
  .tool-container {
    padding: 20px 16px;
  }

  .tool-title {
    font-size: 22px;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .flex-responsive {
    flex-direction: column;
  }
}

@media (min-width: 601px) and (max-width: 900px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ================================
   FULL WIDTH LAYOUT — NO SIDE GAPS
   ================================ */

/* Prevent horizontal overflow on all devices */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

/* Full width page wrapper */
.page-wrapper {
  width: 100%;
  min-height: 100vh;
}

/* Header — centered but generous width */
.site-header {
  width: 100%;
  padding: 48px 32px 28px;
  text-align: center;
}

.site-title {
  font-size: clamp(24px, 5vw, 48px);
  line-height: 1.2;
}

.site-subtitle {
  font-size: clamp(14px, 2.5vw, 18px);
  padding: 0 16px;
}

/* Search — generous width, not too narrow */
.search-wrapper {
  width: 100%;
  max-width: 680px;
  margin: 0 auto 20px;
  padding: 0 20px;
}

#search-input {
  width: 100%;
  font-size: 16px; /* prevents iOS zoom on focus */
  padding: 14px 20px 14px 44px;
  border-radius: 50px;
}

/* Category tabs — full width, horizontal scroll on overflow */
.category-tabs {
  width: 100%;
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 10px;
  padding: 8px 24px 20px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.category-tabs::-webkit-scrollbar {
  display: none;
}

.category-tab {
  flex-shrink: 0;
  white-space: nowrap;
  padding: 10px 22px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 50px;
  cursor: pointer;
  border: 1.5px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
  touch-action: manipulation;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.2px;
}

.category-tab:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(79, 142, 247, 0.1);
}

.category-tab.active {
  background: linear-gradient(135deg, var(--color-accent), #7c6fff);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 20px rgba(79, 142, 247, 0.35);
  transform: translateY(-1px);
}

/* Tool count */
.tool-count-bar {
  padding: 0 24px 16px;
  font-size: 13px;
  color: var(--color-text-muted);
  font-weight: 500;
  letter-spacing: 0.3px;
}

/* ---- TOOLS GRID — fluid, fills ALL available width ---- */
.tools-grid {
  display: grid;
  /* Auto-fill columns: minimum 280px, maximum equal share */
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  padding: 0 24px 60px;
  width: 100%;
  /* NO max-width — fills the full browser width */
}

/* On very wide screens (1600px+), cap columns at 5 */
@media (min-width: 1600px) {
  .tools-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* Large desktop — 4 columns */
@media (min-width: 1200px) and (max-width: 1599px) {
  .tools-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Medium desktop — 3 columns */
@media (min-width: 860px) and (max-width: 1199px) {
  .tools-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Tablet — 2 columns */
@media (min-width: 540px) and (max-width: 859px) {
  .tools-grid {
    grid-template-columns: repeat(2, 1fr);
    padding: 0 16px 40px;
  }
}

/* Mobile — 1 column */
@media (max-width: 539px) {
  .tools-grid {
    grid-template-columns: 1fr;
    padding: 0 12px 40px;
    gap: 12px;
  }

  .category-tabs {
    padding: 8px 12px 12px;
  }

  .tool-count-bar {
    padding: 0 12px 10px;
  }
}

/* ---- TOOL CARD (Premium Modern SaaS Style) ---- */
.tool-card {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 24px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.35s cubic-bezier(0.23, 1, 0.32, 1);
  overflow: hidden;
  min-height: 200px;
}

/* Premium gradient border glow on hover */
.tool-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  padding: 1.5px;
  background: linear-gradient(135deg, var(--color-accent), rgba(167, 139, 250, 0.5), transparent);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.tool-card:hover::before {
  opacity: 1;
}

.tool-card:hover {
  border-color: transparent;
  transform: translateY(-6px);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.25),
    0 0 30px var(--color-card-hover-shadow);
  background: var(--color-surface-2);
}

/* Subtle shine effect on hover */
.tool-card::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.04) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.tool-card:hover::after {
  opacity: 1;
}

/* Make entire card tappable on mobile */
.tool-card > a {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
  position: relative;
  z-index: 1;
}

.tool-card-icon {
  font-size: 32px;
  line-height: 1;
  margin-bottom: 2px;
  transition: transform 0.35s cubic-bezier(0.23, 1, 0.32, 1);
}

.tool-card:hover .tool-card-icon {
  transform: scale(1.1) translateY(-2px);
}

.tool-card-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.3px;
  line-height: 1.3;
}

.tool-card-category {
  font-size: 11px;
  color: var(--color-accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tool-card-category::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--color-accent);
  opacity: 0.6;
}

.tool-card-description {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.6;
  flex-grow: 1;
}

.tool-card-link {
  font-size: 13px;
  color: var(--color-accent);
  font-weight: 600;
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: gap 0.3s ease;
}

.tool-card:hover .tool-card-link {
  gap: 8px;
}

.tool-card-link::after {
  content: '→';
  transition: transform 0.3s ease;
}

.tool-card:hover .tool-card-link::after {
  transform: translateX(3px);
}

/* Bigger tap area on mobile */
@media (max-width: 540px) {
  .tool-card {
    padding: 18px 16px 16px;
    min-height: 180px;
    border-radius: 14px;
  }

  .tool-card-name {
    font-size: 15px;
  }

  .tool-card-description {
    font-size: 13px;
  }

  .tool-card-icon {
    font-size: 28px;
  }
}

/* ---- BUTTONS — minimum tap target 44px ---- */
button, .btn, input[type="submit"], input[type="button"], .tool-card-link {
  min-height: 44px;
  min-width: 44px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* ---- INPUTS — prevent iOS zoom (must be 16px+) ---- */
input, textarea, select {
  font-size: 16px !important;
  -webkit-appearance: none;
  border-radius: var(--radius);
}

/* ---- NAVBAR (Premium) ---- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-border);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

[data-theme="light"] .navbar {
  background: rgba(244, 244, 249, 0.85);
}

.navbar-logo {
  font-size: 19px;
  font-weight: 800;
  color: var(--color-text);
  text-decoration: none;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--color-accent), #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Theme toggle button */
.theme-toggle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--color-border);
  background: var(--color-surface);
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
  flex-shrink: 0;
}

.theme-toggle:hover {
  border-color: var(--color-accent);
  background: var(--accent-light);
  transform: scale(1.08);
  box-shadow: 0 0 20px rgba(79, 142, 247, 0.1);
}

/* Favorites navbar button */
.fav-nav-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--color-border);
  background: var(--color-surface);
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
  flex-shrink: 0;
}

.fav-nav-btn:hover {
  border-color: var(--color-accent);
  background: var(--accent-light);
  transform: scale(1.08);
  box-shadow: 0 0 20px rgba(79, 142, 247, 0.1);
}

.fav-nav-count {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--color-accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 0 0 2px var(--color-surface);
  line-height: 1;
}

.theme-toggle:active {
  transform: scale(0.95);
}

/* ===== FAVORITE BUTTON (Premium) ===== */
.fav-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: rgba(10, 10, 15, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
  z-index: 2;
  padding: 0;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.fav-btn:hover {
  background: rgba(10, 10, 15, 0.8);
  border-color: var(--color-accent);
  transform: scale(1.15);
  box-shadow: 0 4px 16px rgba(79, 142, 247, 0.2);
}

.fav-btn:active {
  transform: scale(0.9);
}

/* Favorite icon — red when active */
.fav-btn.is-fav {
  border-color: rgba(225, 29, 72, 0.4);
  background: rgba(225, 29, 72, 0.1);
}

.fav-btn.is-fav .fav-icon {
  color: #e11d48;
  animation: fav-pop 0.3s ease;
}

@keyframes fav-pop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.4); }
  100% { transform: scale(1); }
}

/* ===== FAVORITES TAB ===== */
.fav-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--color-surface) !important;
  border-color: #e11d48 !important;
  color: #e11d48 !important;
  font-weight: 600 !important;
}

.fav-tab.active {
  background: #e11d48 !important;
  color: white !important;
}

.fav-count {
  background: #e11d48;
  color: white;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
}

.fav-tab.active .fav-count {
  background: white;
  color: #e11d48;
}

/* ===== TOAST NOTIFICATION (Premium) ===== */
#toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: rgba(20, 20, 31, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  padding: 14px 28px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 40px var(--color-shadow), 0 0 0 1px rgba(79, 142, 247, 0.05);
  z-index: 9999;
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.35s ease;
  pointer-events: none;
  white-space: nowrap;
}

[data-theme="light"] #toast {
  background: rgba(255, 255, 255, 0.9);
}

#toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ===== NO RESULTS (Premium) ===== */
.no-results {
  text-align: center;
  padding: 80px 20px;
  color: var(--color-text-muted);
  grid-column: 1 / -1;
  font-size: 15px;
  background: var(--color-surface);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-lg);
  margin: 20px 0;
}

/* ---- TOOL PAGE — inside tools/[name]/ ---- */
.tool-container {
  max-width: 860px;
  margin: 0 auto;
  padding: 24px 16px 60px;
}

.tool-title {
  font-size: clamp(20px, 4vw, 32px);
  font-weight: 700;
  margin-bottom: 6px;
}

.tool-description {
  font-size: 15px;
  color: var(--color-text-muted);
  margin-bottom: 28px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 20px;
  padding: 8px 0;
  min-height: 44px;
  transition: var(--transition);
}

.back-btn:hover {
  color: var(--color-accent);
}

/* ---- SEO CONTENT SECTIONS ---- */
.seo-section {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--color-border);
}

.seo-section h2 {
  font-size: 20px;
  margin-bottom: 12px;
  color: var(--color-text);
}

.seo-section p,
.seo-section li {
  font-size: 15px;
  line-height: 1.7;
  color: var(--color-text-muted);
}

.seo-section ol,
.seo-section ul {
  padding-left: 20px;
}

.seo-section li {
  margin-bottom: 6px;
}

/* FAQ */
.faq-item {
  margin-bottom: 20px;
  padding: 16px;
  background: var(--color-surface);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
}

.faq-item h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--color-text);
}

.faq-item p {
  font-size: 14px;
  color: var(--color-text-muted);
}

/* Related tools grid */
.related-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.related-tool-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 14px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: var(--transition);
  min-height: 44px;
}

.related-tool-card:hover {
  border-color: var(--color-accent);
}

.related-tool-card .tool-icon {
  font-size: 22px;
}

.related-tool-card .tool-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
}

@media (max-width: 540px) {
  .related-tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---- FOOTER ---- */
.footer {
  text-align: center;
  padding: 24px 16px;
  font-size: 13px;
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-border);
}

/* ---- BREADCRUMB ---- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--color-text-muted);
}

.breadcrumb li + li::before {
  content: '›';
  margin-right: 6px;
}

.breadcrumb a {
  color: var(--color-accent);
  text-decoration: none;
}

/* ===== CURRENCY SELECTOR ===== */
.currency-selector-group {
  max-width: 300px;
}

.currency-selector-group select {
  width: 100%;
}

.currency-label,
.currency-prefix {
  font-weight: 600;
  color: var(--color-accent);
}

/* ===== CALCULATOR ENHANCER — Details & History Panel ===== */
.calc-details {
  display: none;
  margin-top: 16px;
  padding: 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.calc-details-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.calc-detail-section {
  padding: 10px 12px;
  background: var(--color-bg);
  border-radius: var(--radius);
  border-left: 3px solid var(--color-accent);
}

.calc-detail-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.calc-detail-value {
  font-size: 14px;
  color: var(--color-text);
  line-height: 1.5;
  word-break: break-word;
}

.calc-formula {
  font-family: var(--font-mono);
  font-size: 15px;
  padding: 8px 12px;
  background: var(--color-surface-2);
  border-radius: 6px;
  border: 1px solid var(--color-border);
}

.calc-input-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.calc-input-list li {
  font-size: 13px;
  color: var(--color-text);
  padding: 4px 8px;
  background: var(--color-surface-2);
  border-radius: 4px;
  font-family: var(--font-mono);
}

.calc-steps-list {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.calc-steps-list li {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.5;
  padding: 4px 0;
}

/* ===== CALCULATOR HISTORY PANEL ===== */
.calc-history-panel {
  display: none;
  margin-top: 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  max-height: 400px;
  display: flex;
  flex-direction: column;
}

.calc-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  flex-shrink: 0;
}

.calc-history-clear-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 4px 8px;
  border-radius: 4px;
  opacity: 0.6;
  transition: opacity 0.2s;
  line-height: 1;
}

.calc-history-clear-btn:hover {
  opacity: 1;
  background: var(--color-surface-2);
}

.calc-history-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 13px;
}

.calc-history-list {
  overflow-y: auto;
  padding: 8px;
  flex: 1;
}

.calc-history-item {
  position: relative;
  padding: 10px 12px;
  padding-right: 32px;
  background: var(--color-bg);
  border-radius: var(--radius);
  margin-bottom: 6px;
  border: 1px solid var(--color-border);
  transition: border-color 0.2s;
}

.calc-history-item:hover {
  border-color: var(--color-accent);
}

.calc-history-item-time {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.calc-history-item-formula {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  font-family: var(--font-mono);
  margin-bottom: 2px;
}

.calc-history-item-inputs {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 2px;
}

.calc-history-item-result {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-accent);
  font-family: var(--font-mono);
}

.calc-history-item-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-error);
  font-size: 16px;
  padding: 2px 6px;
  border-radius: 4px;
  opacity: 0.4;
  transition: opacity 0.2s;
  line-height: 1;
}

.calc-history-item-delete:hover {
  opacity: 1;
}

/* ===== CALCULATOR SYMBOL COLORS ===== */
.calc-sym-eq {
  color: #4CAF50;
  font-size: 1.3em;
  font-weight: 800;
  display: inline-block;
  margin: 0 1px;
}

.calc-sym-c {
  color: #FF9800;
  font-weight: 700;
}

.calc-sym-ce {
  color: #F44336;
  font-weight: 700;
}

.calc-sym-op {
  color: #2196F3;
  font-weight: 700;
}

.calc-sym-pct {
  color: #9C27B0;
  font-weight: 700;
}

.calc-result-value {
  color: var(--color-accent);
  font-weight: 700;
}

/* ===== CALCULATOR RESPONSIVE ===== */
@media (max-width: 600px) {
  .calc-details {
    padding: 12px;
  }

  .calc-detail-section {
    padding: 8px 10px;
  }

  .calc-formula {
    font-size: 13px;
    padding: 6px 10px;
  }

  .calc-history-panel {
    max-height: 300px;
  }

  .calc-history-item {
    padding: 8px 10px;
    padding-right: 28px;
  }

  .calc-history-item-formula {
    font-size: 13px;
  }

  .calc-history-item-result {
    font-size: 14px;
  }
}

/* ===== SHARE / SAVE BUTTONS ===== */
.btn-save {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  justify-content: flex-start;
}

/* ===== FANCY SHARE BUTTON (from Uiverse.io by mahiatlinux) ===== */
.share-btn {
  --primary: #ff5569;
  --neutral-1: #2e2e2e;
  --neutral-2: #1a1a1a;
  --radius: 14px;

  cursor: pointer;
  border-radius: var(--radius);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
  border: none;
  box-shadow: 0 0.5px 0.5px 1px rgba(0, 0, 0, 0.2),
    0 10px 20px rgba(0, 0, 0, 0.2), 0 4px 5px 0px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.3s ease;
  min-width: 200px;
  padding: 20px;
  height: 68px;
  font-family: "Galano Grotesque", Poppins, Montserrat, sans-serif;
  font-style: normal;
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
  background: var(--neutral-1);
}
.share-btn:hover {
  transform: scale(1.02);
  box-shadow: 0 0 1px 2px rgba(255, 255, 255, 0.3),
    0 15px 30px rgba(0, 0, 0, 0.3), 0 10px 3px -3px rgba(0, 0, 0, 0.04);
}
.share-btn:active {
  transform: scale(1);
  box-shadow: 0 0 1px 2px rgba(255, 255, 255, 0.3),
    0 10px 3px -3px rgba(0, 0, 0, 0.2);
}
.share-btn:after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  border: 2.5px solid transparent;
  background: linear-gradient(var(--neutral-1), var(--neutral-2)) padding-box,
    linear-gradient(to bottom, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.45))
      border-box;
  z-index: 0;
  transition: all 0.4s ease;
}
.share-btn:hover::after {
  transform: scale(1.05, 1.1);
  box-shadow: inset 0 -1px 3px 0 rgba(50, 50, 50, 1);
}

.share-btn::before {
  content: "";
  inset: 7px 6px 6px 6px;
  position: absolute;
  background: linear-gradient(to top, var(--neutral-1), var(--neutral-2));
  border-radius: 30px;
  filter: blur(0.5px);
  z-index: 2;
}
.share-btn .state p {
  display: flex;
  align-items: center;
  justify-content: center;
}
.share-btn .state .icon {
  position: absolute;
  left: -6px;
  top: 0;
  bottom: 0;
  margin: auto;
  transform: scale(1.25);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.share-btn .state .icon svg {
  overflow: visible;
}

/* Outline */
.share-btn .outline {
  position: absolute;
  border-radius: inherit;
  overflow: hidden;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.4s ease;
  inset: -2px -3.5px;
}
.share-btn .outline::before {
  content: "";
  position: absolute;
  inset: -100%;
  background: conic-gradient(
    from 180deg,
    transparent 60%,
    rgb(22, 22, 22) 80%,
    transparent 100%
  );
  animation: spin 2s linear infinite;
  animation-play-state: paused;
}
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
.share-btn:hover .outline {
  opacity: 1;
}
.share-btn:hover .outline::before {
  animation-play-state: running;
}

/* Letters */
.share-btn .state p span {
  display: inline-block;
  opacity: 0;
  animation: slideDown 0.8s ease forwards calc(var(--i) * 0.03s);
}
.share-btn:hover p span {
  opacity: 1;
  animation: wave 0.5s ease forwards calc(var(--i) * 0.02s);
}
.share-btn:focus p span {
  opacity: 1;
  animation: disapear 0.6s ease forwards calc(var(--i) * 0.03s);
}
@keyframes wave {
  30% {
    opacity: 1;
    transform: translateY(4px) translateX(0) rotate(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-3px) translateX(0) rotate(0);
    color: var(--primary);
  }
  100% {
    opacity: 1;
    transform: translateY(0) translateX(0) rotate(0);
  }
}
@keyframes slideDown {
  0% {
    opacity: 0;
    transform: translateY(-20px) translateX(5px) rotate(-90deg);
    color: var(--primary);
    filter: blur(5px);
  }
  30% {
    opacity: 1;
    transform: translateY(4px) translateX(0) rotate(0);
    filter: blur(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-3px) translateX(0) rotate(0);
  }
  100% {
    opacity: 1;
    transform: translateY(0) translateX(0) rotate(0);
  }
}
@keyframes disapear {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
    transform: translateX(5px) translateY(20px);
    color: var(--primary);
    filter: blur(5px);
  }
}

/* Plane */
.share-btn .state--default .icon svg {
  animation: land 0.6s ease forwards;
}
.share-btn:hover .state--default .icon {
  transform: rotate(45deg) scale(1.25);
}
.share-btn.share-sent .state--default svg {
  animation: takeOff 0.8s linear forwards;
}
.share-btn.share-sent .state--default .icon {
  transform: rotate(0) scale(1.25);
}
@keyframes takeOff {
  0% {
    opacity: 1;
  }
  60% {
    opacity: 1;
    transform: translateX(70px) rotate(45deg) scale(2);
  }
  100% {
    opacity: 0;
    transform: translateX(160px) rotate(45deg) scale(0);
  }
}
@keyframes land {
  0% {
    transform: translateX(-60px) translateY(30px) rotate(-50deg) scale(2);
    opacity: 0;
    filter: blur(3px);
  }
  100% {
    transform: translateX(0) translateY(0) rotate(0);
    opacity: 1;
    filter: blur(0);
  }
}

/* Contrail */
.share-btn .state--default .icon:before {
  content: "";
  position: absolute;
  top: 50%;
  height: 2px;
  width: 0;
  left: -5px;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.5));
}
.share-btn.share-sent .state--default .icon:before {
  animation: contrail 0.8s linear forwards;
}
@keyframes contrail {
  0% {
    width: 0;
    opacity: 1;
  }
  8% {
    width: 15px;
  }
  60% {
    opacity: 0.7;
    width: 80px;
  }
  100% {
    opacity: 0;
    width: 160px;
  }
}

/* States */
.share-btn .state {
  padding-left: 42px;
  z-index: 2;
  display: flex;
  position: relative;
}
.share-btn .state--default span:nth-child(4) {
  margin-right: 5px;
}
.share-btn .state--sent {
  display: none;
}
.share-btn .state--sent svg {
  transform: scale(1.25);
  margin-right: 8px;
}
.share-btn.share-sent .state--default {
  position: absolute;
}
.share-btn.share-sent .state--sent {
  display: flex;
}
.share-btn.share-sent .state--sent span {
  opacity: 0;
  animation: slideDown 0.8s ease forwards calc(var(--i) * 0.2s);
}
.share-btn.share-sent .state--sent .icon svg {
  opacity: 0;
  animation: appear 1.2s ease forwards 0.8s;
}
@keyframes appear {
  0% {
    opacity: 0;
    transform: scale(4) rotate(-40deg);
    color: var(--primary);
    filter: blur(4px);
  }
  30% {
    opacity: 1;
    transform: scale(0.6);
    filter: blur(1px);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* ===== 3D ANIMATED SAVE BUTTON ===== */
.save-btn {
  --save-primary: #4CAF50;
  --save-dark: #388E3C;
  --save-neutral-1: #1a3a1a;
  --save-neutral-2: #0d1f0d;
  --save-radius: 14px;

  cursor: pointer;
  border-radius: var(--save-radius);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
  border: none;
  box-shadow: 0 0.5px 0.5px 1px rgba(0, 0, 0, 0.2),
    0 10px 20px rgba(0, 0, 0, 0.2), 0 4px 5px 0px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.3s ease;
  min-width: 200px;
  padding: 20px;
  height: 68px;
  font-family: "Galano Grotesque", Poppins, Montserrat, sans-serif;
  font-style: normal;
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
  background: linear-gradient(145deg, var(--save-neutral-1), var(--save-neutral-2));
  perspective: 800px;
  transform-style: preserve-3d;
}
.save-btn:hover {
  transform: scale(1.02) rotateX(2deg) rotateY(-2deg);
  box-shadow: 0 0 1px 2px rgba(76, 175, 80, 0.3),
    0 20px 40px rgba(0, 0, 0, 0.4), 0 10px 3px -3px rgba(0, 0, 0, 0.04);
}
.save-btn:active {
  transform: scale(0.98) translateY(2px) rotateX(0deg) rotateY(0deg);
  box-shadow: 0 0 1px 2px rgba(76, 175, 80, 0.3),
    0 5px 10px rgba(0, 0, 0, 0.3);
}
.save-btn:after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--save-radius);
  border: 2.5px solid transparent;
  background: linear-gradient(var(--save-neutral-1), var(--save-neutral-2)) padding-box,
    linear-gradient(to bottom, rgba(76, 175, 80, 0.2), rgba(0, 0, 0, 0.45))
      border-box;
  z-index: 0;
  transition: all 0.4s ease;
}
.save-btn:hover::after {
  transform: scale(1.05, 1.1);
  box-shadow: inset 0 -1px 3px 0 rgba(76, 175, 80, 0.3);
}

.save-btn::before {
  content: "";
  inset: 7px 6px 6px 6px;
  position: absolute;
  background: linear-gradient(to top, var(--save-neutral-1), var(--save-neutral-2));
  border-radius: 30px;
  filter: blur(0.5px);
  z-index: 2;
}
.save-btn .state p {
  display: flex;
  align-items: center;
  justify-content: center;
}
.save-btn .state .icon {
  position: absolute;
  left: -6px;
  top: 0;
  bottom: 0;
  margin: auto;
  transform: scale(1.25);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.save-btn .state .icon svg {
  overflow: visible;
}
.save-btn:hover .state--default .icon {
  transform: rotate(-10deg) scale(1.35);
}

/* Save button outline */
.save-btn .outline {
  position: absolute;
  border-radius: inherit;
  overflow: hidden;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.4s ease;
  inset: -2px -3.5px;
}
.save-btn .outline::before {
  content: "";
  position: absolute;
  inset: -100%;
  background: conic-gradient(
    from 180deg,
    transparent 60%,
    rgba(76, 175, 80, 0.6) 80%,
    transparent 100%
  );
  animation: save-spin 2s linear infinite;
  animation-play-state: paused;
}
@keyframes save-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
.save-btn:hover .outline {
  opacity: 1;
}
.save-btn:hover .outline::before {
  animation-play-state: running;
}

/* Save button letters */
.save-btn .state p span {
  display: inline-block;
  opacity: 0;
  animation: save-slideDown 0.8s ease forwards calc(var(--i) * 0.03s);
}
.save-btn:hover p span {
  opacity: 1;
  animation: save-wave 0.5s ease forwards calc(var(--i) * 0.02s);
}
.save-btn:focus p span {
  opacity: 1;
  animation: save-disapear 0.6s ease forwards calc(var(--i) * 0.03s);
}
@keyframes save-wave {
  30% {
    opacity: 1;
    transform: translateY(4px) translateX(0) rotate(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-3px) translateX(0) rotate(0);
    color: var(--save-primary);
  }
  100% {
    opacity: 1;
    transform: translateY(0) translateX(0) rotate(0);
  }
}
@keyframes save-slideDown {
  0% {
    opacity: 0;
    transform: translateY(-20px) translateX(5px) rotate(-90deg);
    color: var(--save-primary);
    filter: blur(5px);
  }
  30% {
    opacity: 1;
    transform: translateY(4px) translateX(0) rotate(0);
    filter: blur(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-3px) translateX(0) rotate(0);
  }
  100% {
    opacity: 1;
    transform: translateY(0) translateX(0) rotate(0);
  }
}
@keyframes save-disapear {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
    transform: translateX(5px) translateY(20px);
    color: var(--save-primary);
    filter: blur(5px);
  }
}

/* Floppy disk icon animation */
.save-btn .state--default .icon svg {
  animation: save-land 0.6s ease forwards;
}
.save-btn.save-saved .state--default svg {
  animation: save-takeOff 0.8s linear forwards;
}
.save-btn.save-saved .state--default .icon {
  transform: rotate(0) scale(1.25);
}
@keyframes save-takeOff {
  0% {
    opacity: 1;
  }
  60% {
    opacity: 1;
    transform: translateX(70px) rotate(45deg) scale(2);
  }
  100% {
    opacity: 0;
    transform: translateX(160px) rotate(45deg) scale(0);
  }
}
@keyframes save-land {
  0% {
    transform: translateX(-60px) translateY(30px) rotate(-50deg) scale(2);
    opacity: 0;
    filter: blur(3px);
  }
  100% {
    transform: translateX(0) translateY(0) rotate(0);
    opacity: 1;
    filter: blur(0);
  }
}

/* Contrail */
.save-btn .state--default .icon:before {
  content: "";
  position: absolute;
  top: 50%;
  height: 2px;
  width: 0;
  left: -5px;
  background: linear-gradient(to right, transparent, rgba(76, 175, 80, 0.5));
}
.save-btn.save-saved .state--default .icon:before {
  animation: save-contrail 0.8s linear forwards;
}
@keyframes save-contrail {
  0% {
    width: 0;
    opacity: 1;
  }
  8% {
    width: 15px;
  }
  60% {
    opacity: 0.7;
    width: 80px;
  }
  100% {
    opacity: 0;
    width: 160px;
  }
}

/* States */
.save-btn .state {
  padding-left: 42px;
  z-index: 2;
  display: flex;
  position: relative;
}
.save-btn .state--default span:nth-child(4) {
  margin-right: 5px;
}
.save-btn .state--saved {
  display: none;
}
.save-btn .state--saved svg {
  transform: scale(1.25);
  margin-right: 8px;
}
.save-btn.save-saved .state--default {
  position: absolute;
}
.save-btn.save-saved .state--saved {
  display: flex;
}
.save-btn.save-saved .state--saved span {
  opacity: 0;
  animation: save-slideDown 0.8s ease forwards calc(var(--i) * 0.2s);
}
.save-btn.save-saved .state--saved .icon svg {
  opacity: 0;
  animation: save-appear 1.2s ease forwards 0.8s;
}
@keyframes save-appear {
  0% {
    opacity: 0;
    transform: scale(4) rotate(-40deg);
    color: var(--save-primary);
    filter: blur(4px);
  }
  30% {
    opacity: 1;
    transform: scale(0.6);
    filter: blur(1px);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* 3D depth effect on save button */
.save-btn .save-3d-bottom {
  position: absolute;
  bottom: -4px;
  left: 4px;
  right: 4px;
  height: 8px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.3), rgba(0,0,0,0.5));
  border-radius: 0 0 var(--save-radius) var(--save-radius);
  z-index: -1;
  transition: all 0.3s ease;
}
.save-btn:hover .save-3d-bottom {
  bottom: -6px;
  height: 10px;
  left: 2px;
  right: 2px;
}
.save-btn:active .save-3d-bottom {
  bottom: -2px;
  height: 4px;
  left: 6px;
  right: 6px;
}

/* ===== HISTORY NAVBAR BUTTON ===== */
.history-nav-btn {
  position: relative;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 8px 10px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  color: var(--color-text);
  transition: border-color var(--transition);
  display: flex;
  align-items: center;
  gap: 4px;
}

.history-nav-btn:hover {
  border-color: var(--color-accent);
}

.history-nav-count {
  position: absolute;
  top: -4px;
  right: -6px;
  background: var(--color-accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-sizing: border-box;
}

/* ===== BLOG NAVBAR BUTTON ===== */
.blog-nav-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s, transform 0.1s;
  flex-shrink: 0;
  text-decoration: none;
  color: var(--color-text);
}

.blog-nav-btn:hover {
  border-color: var(--color-accent);
  transform: scale(1.05);
}

.blog-nav-btn:active {
  transform: scale(0.95);
}

/* ===== HISTORY MODAL ===== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
  box-sizing: border-box;
}

.modal-content {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  max-width: 700px;
  width: 100%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
}

.modal-header h2 {
  margin: 0;
  font-size: 18px;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--color-text-muted);
  padding: 0 4px;
  line-height: 1;
}

.modal-close-btn:hover {
  color: var(--color-text);
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--color-border);
}

/* History modal specific */
.history-modal .history-tool-group {
  margin-bottom: 16px;
}

.history-modal .history-tool-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 8px;
}

.history-modal .history-tool-name {
  font-weight: 700;
  font-size: 15px;
  flex: 1;
}

.history-modal .history-count {
  font-size: 12px;
  color: var(--color-text-muted);
}

.history-modal .history-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 8px 8px 12px;
  border-radius: var(--radius);
  background: var(--color-surface);
  margin-bottom: 6px;
  font-size: 13px;
  position: relative;
}

.history-modal .history-item:hover {
  background: var(--color-surface-2);
}

.history-modal .history-item-time {
  color: var(--color-text-muted);
  font-size: 11px;
  white-space: nowrap;
  min-width: 130px;
  padding-top: 1px;
}

.history-modal .history-item-data {
  flex: 1;
  color: var(--color-text);
  word-break: break-word;
  line-height: 1.4;
}

.history-modal .history-item-delete {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-error);
  font-size: 16px;
  padding: 0 4px;
  line-height: 1;
  opacity: 0.6;
  flex-shrink: 0;
}

/* ===== CURRENCY SEARCH INPUT ===== */
.currency-search-input {
  margin-bottom: 6px !important;
  font-size: 0.85rem !important;
  padding: 6px 10px !important;
  border-radius: 6px !important;
  border: 1px solid var(--color-border, #444) !important;
  background: var(--color-bg, #1a1a2e) !important;
  color: var(--color-text, #e0e0e0) !important;
  outline: none !important;
  transition: border-color 0.2s ease !important;
  box-sizing: border-box !important;
  width: 100% !important;
}

.currency-search-input:focus {
  border-color: var(--accent, #7c3aed) !important;
}

/* ===== CURRENCY SEARCHABLE DROPDOWN ===== */
.cs-search {
  cursor:text !important;
  padding-right:32px !important;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat:no-repeat !important;
  background-position:right 10px center !important;
}

.cs-dropdown .cs-item:hover,
.cs-dropdown .cs-item.cs-focused {
  background:var(--color-surface,#2a2a3e) !important;
}

.cs-dropdown::-webkit-scrollbar {
  width:6px;
}
.cs-dropdown::-webkit-scrollbar-track {
  background:transparent;
}
.cs-dropdown::-webkit-scrollbar-thumb {
  background:var(--color-border,#444);
  border-radius:3px;
}

.history-modal .history-item-delete:hover {
  opacity: 1;
}

.history-modal .history-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--color-text-muted);
  font-size: 14px;
  line-height: 1.6;
}

.history-loading {
  text-align: center;
  padding: 20px;
  color: var(--color-text-muted);
}
