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

:root {
  /* Premium Light Theme Colors */
  --primary: #0d6efd;
  --primary-rgb: 13, 110, 253;
  --secondary: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --background: #f8fafc;
  --accent: #2563eb;
  --accent-rgb: 37, 99, 235;
  --border: #e2e8f0;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --card-bg: rgba(255, 255, 255, 0.7);
  --card-border: rgba(226, 232, 240, 0.8);
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 20px -2px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 10px 10px -5px rgba(15, 23, 42, 0.04);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Theme Overrides */
.dark-theme,
html.dark-theme,
body.dark-theme {
  --secondary: #0f172a;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --background: #020617;
  --border: #1e293b;
  --card-bg: rgba(15, 23, 42, 0.6);
  --card-border: rgba(30, 41, 59, 0.8);
  --shadow-sm: 0 2px 8px -1px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 16px -6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 40px -10px rgba(0, 0, 0, 0.4);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--background);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--background);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Global Header styling with beautiful Glassmorphism */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--card-border);
  transition: var(--transition);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
}
.dark-theme header {
  background: rgba(15, 23, 42, 0.75) !important;
}
.dark-theme .header-tools .accent-selector--header {
  background: rgba(15, 23, 42, 0.44);
  border-color: rgba(148, 163, 184, 0.2);
}
header.scrolled {
  box-shadow: var(--shadow-md);
  background: var(--secondary);
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 12px 24px 11px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "logo nav utils";
  gap: 14px;
  align-items: center;
}

.header-container nav {
  grid-area: nav;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
}

.header-container > a.logo {
  grid-area: logo;
  align-self: center;
}

.header-tools {
  grid-area: utils;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
  flex-shrink: 0;
}

.header-tools > * {
  flex-shrink: 0;
}

.header-tools .search-wrapper {
  width: 200px;
}

.header-tools .accent-selector--header {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  border: 1px solid rgba(var(--primary-rgb), 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.logo {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo span {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-menu {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  list-style: none;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.nav-link {
  position: relative;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
  padding: 8px 5px 11px;
  border-radius: 0;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1.1;
  white-space: nowrap;
  flex-shrink: 0;
  background: transparent;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 5px;
  right: 5px;
  bottom: 4px;
  height: 1.5px;
  border-radius: 999px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.2s ease;
  opacity: 0.85;
}
.nav-link:hover, .nav-link.active {
  color: var(--accent);
  background: transparent;
  box-shadow: none;
}
.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
}

.dashboard-link {
  color: var(--accent) !important;
  font-weight: 700;
}

.dashboard-link svg {
  stroke: currentColor;
  opacity: 0.95;
}

/* Dropdown Menu */
.dropdown {
  position: relative;
  display: flex;
  align-items: center;
}
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 10px;
  min-width: 250px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: var(--transition);
  z-index: 1010;
  display: grid;
  gap: 4px;
  margin-top: 10px;
}
.dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.dropdown-item {
  padding: 10px 16px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.dropdown-item:hover {
  background: rgba(var(--primary-rgb), 0.08);
  color: var(--accent);
  transform: translateX(4px);
}

/* Premium Action Buttons */
.action-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}
.header-tools .action-btn {
  width: 34px;
  height: 34px;
  background: rgba(255, 255, 255, 0.55);
}

.accent-selector {
  padding: 4px 8px !important;
  background: rgba(255, 255, 255, 0.55) !important;
  border-radius: 999px !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
}
.dark-theme .accent-selector {
  background: rgba(15, 23, 42, 0.55) !important;
}
.action-btn:hover {
  border-color: var(--primary);
  background: rgba(var(--primary-rgb), 0.08);
  color: var(--primary);
}

/* Hero Section */
.hero {
  padding: 160px 24px 80px;
  background: radial-gradient(circle at 80% 20%, rgba(var(--primary-rgb), 0.06), transparent 50%),
              radial-gradient(circle at 10% 80%, rgba(var(--accent-rgb), 0.04), transparent 40%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
}
.hero-container {
  max-width: 1400px;
  width: 100%;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 60px;
  align-items: center;
}
.hero-content h1 {
  font-family: var(--font-heading);
  font-size: 56px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -2px;
  margin-bottom: 24px;
}
.hero-content h1 span {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-content p {
  font-size: 18px;
  color: var(--text-muted);
  margin-bottom: 36px;
  line-height: 1.6;
}

/* Accent select panel */
.accent-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid transparent;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}
.accent-dot:hover {
  transform: scale(1.35);
}
.accent-dot.active {
  border-color: var(--text);
  transform: scale(1.2);
}

/* Search bar wrapper */
.search-wrapper {
  position: relative;
  width: 100%;
  max-width: 260px;
}
.search-input {
  width: 100%;
  padding: 10px 16px 10px 38px;
  border: 1px solid var(--border);
  border-radius: 50px;
  font-size: 14px;
  font-family: var(--font-body);
  outline: none;
  background: rgba(255, 255, 255, 0.4);
  color: var(--text);
  transition: var(--transition);
}
.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
  background: var(--secondary);
}
.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.search-results {
  position: absolute;
  top: 110%;
  right: 0;
  width: 350px;
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 400px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: var(--transition);
  z-index: 1005;
}
.search-results.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.search-result-item {
  display: flex;
  flex-direction: column;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  transition: var(--transition);
}
.search-result-item:hover, .search-result-item.highlighted {
  background: rgba(var(--primary-rgb), 0.05);
}

/* Tool Grid Cards */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}
.tool-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 26px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
}
.tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0;
  transition: var(--transition);
}
.tool-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(var(--primary-rgb), 0.25);
}
.tool-card:hover::before {
  opacity: 1;
}

/* Responsive grids */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
@media (max-width: 768px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1180px) {
  .header-container {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "logo utils"
      "nav nav";
  }

  .header-container nav {
    justify-content: flex-start;
    overflow-x: auto;
    padding-top: 6px;
    padding-bottom: 2px;
    border-top: 1px solid rgba(var(--primary-rgb), 0.08);
  }

  .nav-menu {
    justify-content: flex-start;
    min-width: max-content;
  }

  .header-tools {
    justify-self: end;
  }
}

@media (max-width: 860px) {
  .header-container {
    padding: 10px 16px 8px;
    gap: 10px 12px;
  }

  .header-container nav {
    padding-top: 6px;
  }

  .nav-menu {
    gap: 6px;
  }

  .nav-link {
    padding: 8px 10px;
    font-size: 13px;
  }

  .header-tools {
    gap: 8px;
  }

  .header-tools .search-wrapper {
    width: 180px;
  }

  .header-tools .accent-selector--header {
    padding: 4px 7px;
  }
}

/* Main Tool Containers styling */
.tool-page-container {
  max-width: 1200px;
  margin: 130px auto 60px;
  padding: 0 24px;
}

.tool-header-block {
  text-align: center;
  margin-bottom: 30px;
}
.tool-header-block h1 {
  font-family: var(--font-heading);
  font-size: 38px;
  font-weight: 800;
  margin-bottom: 10px;
}

.tool-interactive-area {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.82)),
    var(--secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 30px;
  margin-bottom: 40px;
  color: var(--text);
}

/* Form Styles */
.form-group {
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
}
.form-label {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  background: var(--background);
  color: var(--text);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.15);
  background: var(--secondary);
  transform: translateY(-1px);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  font-weight: 600;
  font-size: 14px;
  border-radius: 50px;
  text-decoration: none;
  font-family: var(--font-body);
  transition: var(--transition);
  cursor: pointer;
  border: none;
  gap: 8px;
}
.btn-sm {
  padding: 8px 16px;
  font-size: 12px;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #ffffff !important;
  box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.25);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.35);
}
.btn-secondary {
  background: rgba(var(--primary-rgb), 0.05);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: rgba(var(--primary-rgb), 0.1);
  border-color: var(--primary);
}
.btn-danger {
  background: var(--danger);
  color: #ffffff !important;
}
.btn-success {
  background: var(--success);
  color: #ffffff !important;
}

/* Result box layouts */
.result-box {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-top: 20px;
  color: var(--text);
}
.result-box textarea,
.result-box pre {
  color: var(--text);
}

.flex-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.flex-col {
  display: flex;
  flex-direction: column;
}

/* Premium settings Panel glass */
.premium-settings-panel {
  transition: var(--transition);
  color: var(--text);
}
.dark-theme .premium-settings-panel {
  background: linear-gradient(135deg, rgba(13, 110, 253, 0.06), rgba(15, 23, 42, 0.8)) !important;
}

.tool-workspace {
  gap: 15px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.54);
  color: var(--text);
}

.tool-workspace h3,
.tool-workspace p,
.tool-workspace label {
  color: var(--text);
}

.tool-workspace p {
  color: var(--text-muted);
}

.ad-banner-container {
  color: var(--text-muted);
}

.ad-banner-container > div {
  background: rgba(255, 255, 255, 0.58);
  color: var(--text-muted);
}

.tool-copy {
  color: var(--text);
}

.tool-copy--muted {
  color: var(--text-muted);
}

.tool-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.tool-chip-success {
  background: rgba(16, 185, 129, 0.14);
  color: #10b981;
}

.tool-chip-accent {
  background: rgba(13, 110, 253, 0.12);
  color: var(--accent);
}

.tool-chip-warn {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
}

.tool-rich-section {
  background: var(--secondary);
  border-top: 1px solid var(--border);
  color: var(--text);
}

.tool-rich-section h2,
.tool-rich-section h3,
.tool-rich-section p,
.tool-rich-section li {
  color: var(--text);
}

.tool-rich-section p,
.tool-rich-section li {
  line-height: 1.8;
}

.dark-theme .tool-interactive-area {
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.82)),
    var(--secondary);
}

.dark-theme .result-box {
  background: rgba(15, 23, 42, 0.82);
}

.dark-theme .tool-workspace {
  background: rgba(15, 23, 42, 0.34);
}

.dark-theme .ad-banner-container > div {
  background: rgba(15, 23, 42, 0.6);
}

/* Footer structure */
footer {
  background: #090d16;
  color: #94a3b8;
  padding: 60px 24px 30px;
  border-top: 1px solid var(--border);
}
.footer-container {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 40px;
}
.footer-logo {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.footer-logo span {
  color: var(--primary);
}
.footer-desc {
  font-size: 13px;
  line-height: 1.6;
}
.footer-title {
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 18px;
}
.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer-link {
  color: #94a3b8;
  text-decoration: none;
  font-size: 13px;
  transition: var(--transition);
}
.footer-link:hover {
  color: #ffffff;
  transform: translateX(4px);
}
.footer-bottom {
  max-width: 1400px;
  margin: 30px auto 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

/* Scratchpad Drawer tabs styling */
.scratch-tab {
  transition: var(--transition);
}
.scratch-tab.active {
  border-color: var(--primary) !important;
  background: rgba(var(--primary-rgb), 0.1) !important;
}

/* Toast alert layout */
.toast-notification {
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
}
