/* SmartTools Hub — Modern Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: #eef2ff;
  --accent: #8b5cf6;
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --bg-input: #ffffff;
  --text: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 25px rgba(0,0,0,.08), 0 4px 10px rgba(0,0,0,.04);
  --shadow-xl: 0 20px 40px rgba(0,0,0,.1), 0 8px 16px rgba(0,0,0,.06);
  --radius: 12px;
  --radius-lg: 16px;
  --transition: .2s ease;
}

html.dark {
  --primary: #818cf8;
  --primary-hover: #6366f1;
  --primary-light: #1e1b4b;
  --accent: #a78bfa;
  --bg: #0f172a;
  --bg-card: #1e293b;
  --bg-input: #334155;
  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: #334155;
  --shadow: 0 1px 3px rgba(0,0,0,.3);
  --shadow-lg: 0 10px 25px rgba(0,0,0,.4);
  --shadow-xl: 0 20px 40px rgba(0,0,0,.5);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background var(--transition), color var(--transition);
}

/* === HEADER === */
.site-header {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 4px 20px rgba(99, 102, 241, .3);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
  text-decoration: none;
}
.brand-icon {
  width: 36px; height: 36px;
  background: rgba(255,255,255,.2);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  backdrop-filter: blur(10px);
}
.brand-text {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.02em;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-home {
  color: white;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 14px;
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(10px);
  transition: background var(--transition);
}
.btn-home:hover { background: rgba(255,255,255,.25); }

/* Theme Toggle */
.theme-toggle {
  width: 44px; height: 44px;
  border-radius: 12px;
  border: none;
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(10px);
  color: white;
  font-size: 20px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition), transform var(--transition);
}
.theme-toggle:hover { background: rgba(255,255,255,.25); transform: scale(1.05); }

/* === MAIN === */
main {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px;
  width: 100%;
}

.page-title {
  font-size: 28px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 4px;
  letter-spacing: -.02em;
}
.page-desc {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 32px;
  font-size: 15px;
}

/* === CARDS === */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: all var(--transition);
}
.card:hover { box-shadow: var(--shadow-lg); }

/* Tool cards on homepage */
.tool-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  transition: all .3s ease;
  position: relative;
  overflow: hidden;
}
.tool-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0;
  transition: opacity var(--transition);
}
.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary);
}
.tool-card:hover::before { opacity: 1; }
.tool-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  margin-bottom: 16px;
  background: var(--primary-light);
}
.tool-card h2 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 6px;
}
.tool-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* === FORM ELEMENTS === */
.form-group {
  margin-bottom: 16px;
}
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  background: var(--bg-input);
  color: var(--text);
  transition: all var(--transition);
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .15);
}
.form-textarea { resize: vertical; min-height: 100px; }
.form-select { cursor: pointer; }

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  box-shadow: 0 4px 12px rgba(99, 102, 241, .3);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, .4);
}
.btn-secondary {
  background: var(--bg-input);
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger {
  background: #fee2e2;
  color: #dc2626;
}
html.dark .btn-danger { background: #451a1a; color: #f87171; }
.btn-danger:hover { opacity: .9; }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-block { width: 100%; }

/* === RESULT BOX === */
.result-box {
  background: linear-gradient(135deg, rgba(99,102,241,.08), rgba(139,92,246,.08));
  border: 1.5px solid rgba(99,102,241,.2);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 16px;
}
html.dark .result-box {
  background: linear-gradient(135deg, rgba(99,102,241,.15), rgba(139,92,246,.15));
}
.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 15px;
}
.result-row + .result-row { border-top: 1px solid var(--border); }
.result-label { color: var(--text-secondary); }
.result-value { font-weight: 700; color: var(--text); }
.result-highlight {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
}

/* === TABS === */
.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg-input);
  border-radius: 12px;
  margin-bottom: 24px;
  overflow-x: auto;
}
.tab-btn {
  flex: 1;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  background: transparent;
  color: var(--text-secondary);
  transition: all var(--transition);
  white-space: nowrap;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  box-shadow: 0 2px 8px rgba(99, 102, 241, .3);
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* === FOOTER === */
.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 24px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* === DATA BAR === */
.data-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--bg-input);
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 12px;
  color: var(--text-muted);
}

/* === RESPONSIVE === */
@media (max-width: 640px) {
  .page-title { font-size: 22px; }
  main { padding: 20px 16px; }
  .card { padding: 20px 16px; }
  .header-inner { padding: 10px 16px; }
  .brand-text { font-size: 17px; }
  .tabs { flex-wrap: nowrap; }
}

/* === ANIMATIONS === */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn .3s ease; }

/* === TOAST === */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text);
  color: var(--bg);
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  z-index: 100;
  transition: transform .3s ease;
  box-shadow: var(--shadow-xl);
}
.toast.show { transform: translateX(-50%) translateY(0); }
