/* =========================================================
   TOOL FIXT - GLOBAL DESIGN SYSTEM
   Professional, Modern, Clean, Trustworthy
   ========================================================= */

:root {
  /* Brand Core Palette */
  --brand-primary: #4f46e5;
  --brand-primary-hover: #4338ca;
  --brand-primary-light: #eef2ff;
  --brand-secondary: #06b6d4;
  --brand-accent: #10b981;
  --brand-warning: #f59e0b;
  --brand-danger: #ef4444;

  /* Neutral Light Theme */
  --bg-body: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-raised: #f1f5f9;
  --border-color: #e2e8f0;
  --border-color-subtle: #f1f5f9;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;

  /* Shadows */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Layout */
  --container-max: 1240px;
  --header-height: 64px;
  --mobile-nav-height: 60px;
  --touch-target-min: 44px;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Transition */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
}

/* Dark Theme */
[data-theme="dark"] {
  --bg-body: #090d16;
  --bg-surface: #0f172a;
  --bg-surface-raised: #1e293b;
  --border-color: #334155;
  --border-color-subtle: #1e293b;

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --text-inverse: #0f172a;

  --brand-primary-light: rgba(79, 70, 229, 0.15);

  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 2px 4px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 8px -1px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 20px -3px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 20px 30px -5px rgba(0, 0, 0, 0.7);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  overflow-x: hidden;
}

a {
  color: var(--brand-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--brand-primary-hover);
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.25;
}

p {
  color: var(--text-secondary);
}

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

img, svg {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

/* Accessibility Focus States */
:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

/* Utilities */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.bold { font-weight: 600; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-free {
  background-color: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.badge-pro {
  background-color: rgba(79, 70, 229, 0.15);
  color: #6366f1;
  border: 1px solid rgba(79, 70, 229, 0.3);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--brand-primary);
  color: #ffffff !important;
  box-shadow: 0 2px 4px rgba(79, 70, 229, 0.25);
}
.btn-primary:hover {
  background-color: var(--brand-primary-hover);
  box-shadow: 0 4px 8px rgba(79, 70, 229, 0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: var(--bg-surface-raised);
  color: var(--text-primary);
  border-color: var(--border-color);
}
.btn-secondary:hover {
  background-color: var(--border-color);
}

.btn-outline {
  background-color: transparent;
  color: var(--brand-primary);
  border-color: var(--brand-primary);
}
.btn-outline:hover {
  background-color: var(--brand-primary-light);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.85rem;
}
.btn-lg {
  padding: 0.875rem 1.75rem;
  font-size: 1.05rem;
}
.btn-block {
  width: 100%;
}

/* Mobile Touch Ergonomics & Tap Enhancements */
button, 
a, 
input, 
select, 
textarea, 
.btn, 
.nav-link, 
.popular-tool-card, 
.tool-card {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* iOS Safari Input Auto-Zoom Prevention */
@media (max-width: 768px) {
  input[type="text"],
  input[type="number"],
  input[type="email"],
  input[type="password"],
  input[type="search"],
  input[type="url"],
  input[type="tel"],
  select,
  textarea {
    font-size: 16px !important;
  }

  /* Safe Area Support for Notch / Home Indicator */
  body {
    padding-bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px));
  }
}

/* Universal Responsive Table Wrapper */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
}

.table-responsive table {
  width: 100%;
  min-width: 580px;
  border-collapse: collapse;
}

