/* ============================================================
   QualiQube — Global Stylesheet
   ============================================================ */

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

/* ---------- CSS Variables — Light (default) ---------- */
:root {
  --bg:         #f5f7fa;
  --bg2:        #ffffff;
  --bg3:        #eef1f6;
  --border:     rgba(0,0,0,0.09);
  --text:       #0f1117;
  --text-muted: #6b7280;
  --accent:     #0099cc;
  --accent2:    #6d28d9;
  --success:    #16a34a;
  --warn:       #b45309;
  --danger:     #dc2626;
  --radius:     14px;
  --radius-sm:  8px;
  --shadow:     0 4px 24px rgba(0,0,0,0.10);
  --font-head:  'Space Grotesk', sans-serif;
  --font-body:  'DM Sans', sans-serif;
  --transition: 0.2s ease;
  --navbar-bg:  rgba(245,247,250,0.92);
  --hero-glow1: rgba(0,153,204,0.10);
  --hero-glow2: rgba(109,40,217,0.08);
  --card-hover-bg: #f0f4f8;
  --scrollbar-thumb: #cbd5e1;
  --code-bg: #f8fafc;
}

/* ---------- CSS Variables — Dark ---------- */
[data-theme="dark"] {
  --bg:         #0d1117;
  --bg2:        #161b22;
  --bg3:        #21262d;
  --border:     rgba(255,255,255,0.08);
  --text:       #e6edf3;
  --text-muted: #8b949e;
  --accent:     #00d4ff;
  --accent2:    #7c3aed;
  --success:    #3fb950;
  --warn:       #d29922;
  --danger:     #f85149;
  --shadow:     0 8px 32px rgba(0,0,0,0.4);
  --navbar-bg:  rgba(13,17,23,0.85);
  --hero-glow1: rgba(0,212,255,0.12);
  --hero-glow2: rgba(124,58,237,0.10);
  --card-hover-bg: #21262d;
  --scrollbar-thumb: #30363d;
  --code-bg: #0a0e14;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

/* Smooth theme transitions */
*, *::before, *::after {
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.15s ease;
}
/* But not transforms/animations — only color props */
.tool-card, .btn, .theme-toggle-btn, .filter-btn, .nav-links a {
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.15s ease,
              transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img, svg { display: block; max-width: 100%; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 99px; }

/* ============================================================
   LAYOUT
   ============================================================ */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--navbar-bg);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 0;
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
  text-decoration: none;
}

.logo-icon {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.logo img {
  height: 38px;
  width: auto;
  display: block;
}

footer .logo img {
  height: 28px;
}

/* logo used inline within a line of text — matches the text size */
.logo-inline {
  display: inline-flex;
  font-size: inherit;
  margin: 0;
  vertical-align: middle;
}

footer .logo-inline img,
.logo-inline img {
  height: 1.3em;
  width: auto;
  display: inline-block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  text-decoration: none;
}

.nav-links a:hover { color: var(--text); background: var(--bg3); }

.nav-cta {
  background: var(--accent);
  color: #000 !important;
  font-weight: 600;
  padding: 7px 18px !important;
  border-radius: var(--radius-sm) !important;
}
.nav-cta:hover { background: #33ddff !important; color: #000 !important; }

/* Theme toggle button */
.theme-toggle-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
  flex-shrink: 0;
  color: var(--text);
}
.theme-toggle-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  transform: rotate(20deg) scale(1.1);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  padding: 34px 0 26px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: -100px;
  background: radial-gradient(ellipse 60% 50% at 50% 0%, var(--hero-glow1) 0%, transparent 70%),
              radial-gradient(ellipse 40% 40% at 80% 80%, var(--hero-glow2) 0%, transparent 60%);
  pointer-events: none;
}

.hero-tag {
  display: inline-block;
  background: rgba(0,212,255,0.1);
  border: 1px solid rgba(0,212,255,0.3);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 99px;
  margin-bottom: 12px;
}

.hero h1 {
  font-family: var(--font-head);
  font-size: clamp(1.7rem, 3.5vw, 2.5rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  max-width: 700px;
  margin: 0 auto 10px;
}

.hero h1 span {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 520px;
  margin: 0 auto 18px;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
}

.hero-stat-num {
  font-family: var(--font-head);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.hero-stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ============================================================
   SECTION HEADER
   ============================================================ */
.section-header {
  margin-bottom: 16px;
}

.section-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.section-title {
  font-family: var(--font-head);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text);
}

/* ============================================================
   TOOLS GRID / CARDS
   ============================================================ */
.tools-section {
  padding: 0 0 80px;
}

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

.tool-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition), background var(--transition);
  position: relative;
  overflow: hidden;
}

.tool-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--card-accent, var(--accent)), transparent 60%);
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}

.tool-card:hover {
  border-color: var(--card-accent, var(--accent));
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.12), 0 0 0 1px var(--card-accent, var(--accent));
  background: var(--card-hover-bg);
  text-decoration: none;
}

.tool-card:hover::before { opacity: 0.05; }

.tool-icon {
  width: 52px;
  height: 52px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.tool-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(0,212,255,0.15);
  border: 1px solid rgba(0,212,255,0.3);
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 99px;
}

.tool-name {
  font-family: var(--font-head);
  font-size: 1.22rem;
  font-weight: 700;
  color: var(--text);
}

.tool-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.45;
  flex: 1;
}

.tool-arrow {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--card-accent, var(--accent));
  margin-top: 4px;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity var(--transition), transform var(--transition);
}

.tool-card:hover .tool-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* ============================================================
   TOOL PAGE LAYOUT (inner pages)
   ============================================================ */
.tool-page {
  padding: 14px 0 40px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb-sep { opacity: 0.4; }

.tool-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.tool-header-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: var(--bg2);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.tool-header-text h1 {
  font-family: var(--font-head);
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.tool-header-text p { color: var(--text-muted); font-size: 0.88rem; }

/* ============================================================
   UPLOAD / DROP ZONE
   ============================================================ */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 30px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  background: var(--bg2);
  position: relative;
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--accent);
  background: rgba(0,212,255,0.03);
}

.drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.drop-icon { font-size: 2rem; margin-bottom: 8px; }

.drop-title {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.drop-sub { font-size: 0.875rem; color: var(--text-muted); }
.drop-sub span { color: var(--accent); font-weight: 500; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 24px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #000;
}
.btn-primary:hover { background: #33ddff; transform: translateY(-1px); box-shadow: 0 4px 20px rgba(0,212,255,0.35); }

.btn-secondary {
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: #2d333b; border-color: rgba(255,255,255,0.18); }

.btn-danger {
  background: rgba(248,81,73,0.15);
  color: var(--danger);
  border: 1px solid rgba(248,81,73,0.3);
}
.btn-danger:hover { background: rgba(248,81,73,0.25); }

.btn-success {
  background: var(--success);
  color: #000;
}
.btn-success:hover { background: #52d96e; }

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-lg { padding: 14px 32px; font-size: 1rem; border-radius: var(--radius); }
.btn-sm { padding: 7px 14px; font-size: 0.82rem; }

/* ============================================================
   FORM CONTROLS
   ============================================================ */
.form-group { display: flex; flex-direction: column; gap: 8px; }

.form-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
}

.form-control {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.92rem;
  padding: 10px 14px;
  outline: none;
  transition: border-color var(--transition);
  width: 100%;
}

.form-control:focus { border-color: var(--accent); }
.form-control option { background: var(--bg2); }

textarea.form-control { resize: vertical; min-height: 160px; }

/* ============================================================
   FILE LIST
   ============================================================ */
.file-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}

.file-item-icon { font-size: 1.4rem; flex-shrink: 0; }

.file-item-name {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-item-size { font-size: 0.78rem; color: var(--text-muted); flex-shrink: 0; }

.file-item-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color var(--transition);
}
.file-item-remove:hover { color: var(--danger); }

/* ============================================================
   PROGRESS & STATUS
   ============================================================ */
.progress-wrap {
  background: var(--bg3);
  border-radius: 99px;
  height: 6px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 99px;
  width: 0%;
  transition: width 0.3s ease;
}

.status-msg {
  font-size: 0.875rem;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-top: 16px;
}
.status-msg.success { background: rgba(63,185,80,0.1); border: 1px solid rgba(63,185,80,0.3); color: var(--success); }
.status-msg.error   { background: rgba(248,81,73,0.1);  border: 1px solid rgba(248,81,73,0.3);  color: var(--danger); }
.status-msg.info    { background: rgba(0,212,255,0.08); border: 1px solid rgba(0,212,255,0.25); color: var(--accent); }

/* ============================================================
   TWO-COL TOOL LAYOUT
   ============================================================ */
.tool-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.tool-panel {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tool-panel-title {
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  border-top: 1px solid var(--border);
  padding: 22px 0;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  gap: 20px;
  list-style: none;
}
.footer-links a { color: var(--text-muted); transition: color var(--transition); }
.footer-links a:hover { color: var(--accent); text-decoration: none; }

/* ============================================================
   TOAST
   ============================================================ */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-size: 0.875rem;
  box-shadow: var(--shadow);
  animation: toast-in 0.3s ease;
  max-width: 320px;
}
.toast.success { border-color: rgba(63,185,80,0.4); }
.toast.error   { border-color: rgba(248,81,73,0.4); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
  }
  .hamburger { display: flex; }
  .navbar { position: relative; }

  .hero { padding: 48px 0 40px; }
  .hero-stats { gap: 24px; }

  .tools-grid { grid-template-columns: 1fr 1fr; gap: 14px; }

  .tool-cols { grid-template-columns: 1fr; }

  .tool-header { flex-direction: column; gap: 12px; }
  .tool-header-icon { width: 52px; height: 52px; font-size: 24px; }
}

@media (max-width: 480px) {
  .tools-grid { grid-template-columns: 1fr; }
  .container { padding: 0 16px; }
  .hero h1 { font-size: 2rem; }
}

/* ============ Ads & Consent (added for monetization) ============ */
.ad-container {
  margin: 26px auto;
  text-align: center;
  min-height: 90px;
  max-width: 100%;
  overflow: hidden;
}
.ad-label {
  display: block;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}
#consent-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 14px 20px;
  z-index: 9999;
  box-shadow: 0 -6px 24px rgba(0,0,0,0.25);
}
#consent-banner .consent-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--text-muted);
}
#consent-banner a { color: var(--accent); }
#consent-banner .consent-btns { display: flex; gap: 8px; }

/* ============ Static content pages (privacy, terms, about) ============ */
.content-page { max-width: 780px; margin: 0 auto; }
.content-page h2 { margin: 28px 0 10px; font-size: 1.25rem; }
.content-page p, .content-page li { color: var(--text-muted); line-height: 1.7; margin-bottom: 10px; }
.content-page ul { padding-left: 22px; margin-bottom: 12px; }
.content-page a { color: var(--accent); }
