/**
 * Smartools.ro — Main stylesheet
 * Design tokens, reset, typography, layout, header, footer, theme modes.
 */

/* ==========================================================================
   Font face — Inter self-hosted
   ========================================================================== */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-var.woff2") format("woff2");
}

/* ==========================================================================
   Design tokens — dark mode (default)
   ========================================================================== */

:root {
  color-scheme: dark;

  /* Backgrounds */
  --color-bg: #0f1117;
  --color-bg-elevated: #1a1d27;
  --color-bg-hover: #222536;
  --color-bg-border: #2a2d3e;
  --color-bg-input: #1e2130;

  /* Text */
  --color-text: #e8eaf0;
  --color-text-muted: #8b8fa8;
  --color-text-subtle: #5c6075;
  --color-text-inverse: #0f1117;

  /* Brand / Accent */
  --color-primary: #7c6aff;
  --color-primary-hover: #9580ff;
  --color-primary-dim: rgba(124, 106, 255, 0.12);
  --color-secondary: #ff6b9d;
  --color-accent: #00d4aa;

  /* Semantic */
  --color-success: #22c55e;
  --color-warning: #f59e0b;
  --color-error: #ef4444;
  --color-info: #3b82f6;

  /* Stars */
  --color-star: #fbbf24;
  --color-star-empty: #2a2d3e;

  /* Borders */
  --color-border: #2a2d3e;
  --color-border-focus: #7c6aff;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 20px rgba(124, 106, 255, 0.2);

  /* Typography */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", monospace;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  --leading-tight: 1.25;
  --leading-normal: 1.6;
  --leading-relaxed: 1.75;
  --tracking-tight: -0.02em;
  --tracking-normal: 0;
  --tracking-wide: 0.05em;
  --tracking-wider: 0.1em;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Layout */
  --max-width: 1280px;
  --content-width: 760px;
  --listing-width: 1200px;
  --sidebar-width: 300px;
  --header-height: 64px;

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

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;

  /* Header glass */
  --header-bg: rgba(15, 17, 23, 0.85);
}

/* ==========================================================================
   Light mode — body.light-mode override complet
   ========================================================================== */

body.light-mode {
  color-scheme: light;

  --color-bg: #ffffff;
  --color-bg-elevated: #f8fafc;
  --color-bg-hover: #f1f5f9;
  --color-bg-border: #e5e7eb;
  --color-bg-input: #f9fafb;
  --color-text: #1a1a2e;
  --color-text-muted: #6b7280;
  --color-text-subtle: #9ca3af;
  --color-text-inverse: #ffffff;
  --color-primary: #6c5ce7;
  --color-primary-hover: #5a4bd1;
  --color-primary-dim: rgba(108, 92, 231, 0.08);
  --color-border: #e5e7eb;
  --color-border-focus: #6c5ce7;
  --color-star-empty: #e5e7eb;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 20px rgba(108, 92, 231, 0.15);
  --header-bg: rgba(255, 255, 255, 0.9);
}

/* ==========================================================================
   prefers-color-scheme — auto-detect dark (sistem)
   ========================================================================== */

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
  }

  body:not(.light-mode) {
    --header-bg: rgba(15, 17, 23, 0.85);
  }
}

@media (prefers-color-scheme: light) {
  body:not(.light-mode):not([data-smt-theme="dark"]) {
    color-scheme: light dark;
  }
}

/* ==========================================================================
   Minimal reset
   ========================================================================== */

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

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

body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
ul,
ol,
figure,
blockquote {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

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

button {
  cursor: pointer;
  background: none;
  border: none;
}

a {
  color: var(--color-primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

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

/* ==========================================================================
   Base typography & body
   ========================================================================== */

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--font-normal);
  line-height: var(--leading-normal);
  letter-spacing: var(--tracking-normal);
  min-height: 100vh;
}

h1,
.smt-h1 {
  font-size: var(--text-4xl);
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-text);
}

h2,
.smt-h2 {
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-text);
}

h3,
.smt-h3 {
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
  line-height: var(--leading-tight);
  color: var(--color-text);
}

h4,
.smt-h4 {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  line-height: var(--leading-tight);
  color: var(--color-text);
}

h5,
.smt-h5 {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--color-text);
}

h6,
.smt-h6 {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--color-text-muted);
}

.smt-lead {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  line-height: var(--leading-relaxed);
}

.smt-meta {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.smt-caption {
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
}

.smt-mono {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

/* ==========================================================================
   Layout helpers
   ========================================================================== */

.smt-container {
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

.smt-content-width {
  width: 100%;
  max-width: var(--content-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

.smt-listing-width {
  width: 100%;
  max-width: var(--listing-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

.smt-section {
  padding-top: var(--space-12);
  padding-bottom: var(--space-12);
}

.smt-section--tight {
  padding-top: var(--space-8);
  padding-bottom: var(--space-8);
}

.smt-stack-sm > * + * {
  margin-top: var(--space-2);
}

.smt-stack-md > * + * {
  margin-top: var(--space-4);
}

.smt-stack-lg > * + * {
  margin-top: var(--space-6);
}

.smt-cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.smt-split {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

/* ==========================================================================
   Header — sticky, blur
   ========================================================================== */

.smt-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}

.smt-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  height: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.smt-header__logo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--color-text);
  text-decoration: none;
  letter-spacing: var(--tracking-tight);
  flex-shrink: 0;
}

.smt-header__logo:hover {
  color: var(--color-text);
}

.smt-header__logo-tld {
  color: var(--color-primary);
}

.smt-header__logo-icon {
  font-size: var(--text-lg);
  line-height: 1;
}

.smt-header__nav {
  display: none;
  align-items: center;
  gap: var(--space-1);
}

.smt-header__nav-link {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-text-muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background var(--transition-fast);
}

.smt-header__nav-link:hover,
.smt-header__nav-link.is-active {
  color: var(--color-text);
  background: var(--color-bg-hover);
}

.smt-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
}

.smt-header__search {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  text-decoration: none;
  transition: border-color var(--transition-fast), color var(--transition-fast);
}

.smt-header__search:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.smt-header__menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

.smt-header__drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 200;
  width: min(320px, 100vw);
  height: 100vh;
  height: 100dvh;
  background: var(--color-bg-elevated);
  border-left: 1px solid var(--color-border);
  padding: var(--space-6);
  transform: translateX(100%);
  transition: transform var(--transition-base);
  overflow-y: auto;
}

.smt-header__drawer.is-open {
  transform: translateX(0);
}

.smt-header__drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 199;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-base), visibility var(--transition-base);
}

.smt-header__drawer-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.smt-header__drawer-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-8);
}

.smt-header__drawer-nav .smt-header__nav-link {
  display: block;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
}

/* ==========================================================================
   Footer — dark, 3 coloane
   ========================================================================== */

.smt-footer {
  background: var(--color-bg-elevated);
  border-top: 1px solid var(--color-border);
  padding: var(--space-12) 0 var(--space-8);
  margin-top: var(--space-16);
}

.smt-footer__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-8);
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.smt-footer__col-title {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--color-text);
  margin-bottom: var(--space-4);
}

.smt-footer__links {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.smt-footer__links a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.smt-footer__links a:hover {
  color: var(--color-primary);
}

.smt-footer__brand {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  color: var(--color-text);
  margin-bottom: var(--space-3);
}

.smt-footer__brand .smt-header__logo-tld {
  color: var(--color-primary);
}

.smt-footer__tagline {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: var(--leading-relaxed);
  max-width: 28ch;
}

.smt-footer__bottom {
  max-width: var(--max-width);
  margin: var(--space-10) auto 0;
  padding: var(--space-6) var(--space-4) 0;
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-subtle);
}

.smt-footer__bottom a {
  color: var(--color-text-muted);
}

.smt-footer__nav-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
}

.smt-footer__nav-col-title {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--color-text-muted);
  margin: 0 0 var(--space-3);
}

.smt-footer__social {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-4);
  list-style: none;
  padding: 0;
}

.smt-footer__social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.smt-footer__social a:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.smt-footer__newsletter-text {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
  line-height: var(--leading-relaxed);
}

.smt-footer__newsletter-form {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.smt-footer__legal ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  list-style: none;
  padding: 0;
  margin: 0;
}

.smt-logo-accent {
  color: var(--color-primary);
}

.smt-header__nav-list,
.smt-header__drawer-list {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  list-style: none;
  padding: 0;
  margin: 0;
}

.smt-header__drawer-list {
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-2);
}

.smt-header__drawer-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  width: 40px;
  height: 40px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-size: var(--text-xl);
  line-height: 1;
}

.smt-header__drawer-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-8);
}

.smt-reading-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-6);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border);
}

.smt-reading-meta__label {
  color: var(--color-text-subtle);
  margin-right: var(--space-1);
}

.smt-reading-meta a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: var(--font-medium);
}

.smt-reading-meta a:hover {
  color: var(--color-primary-hover);
}

/* ==========================================================================
   Hero (homepage) — layout base
   ========================================================================== */

.smt-hero {
  padding: var(--space-16) 0 var(--space-12);
  text-align: center;
}

.smt-hero__title {
  font-size: clamp(var(--text-3xl), 5vw, var(--text-5xl));
  font-weight: var(--font-bold);
  letter-spacing: var(--tracking-tight);
  margin-bottom: var(--space-4);
}

.smt-hero__subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 42rem;
  margin: 0 auto var(--space-8);
  line-height: var(--leading-relaxed);
}

.smt-hero__search {
  display: flex;
  max-width: 520px;
  margin: 0 auto var(--space-6);
  gap: var(--space-2);
}

.smt-hero__search-input {
  flex: 1;
  background: var(--color-bg-input);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  color: var(--color-text);
  font-size: var(--text-base);
}

.smt-hero__search-input::placeholder {
  color: var(--color-text-subtle);
}

.smt-hero__search-input:focus {
  outline: none;
  border-color: var(--color-border-focus);
}

.smt-hero__stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-6);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.smt-hero__stats strong {
  color: var(--color-primary);
  font-weight: var(--font-semibold);
}

.smt-hero--animated {
  position: relative;
  overflow: hidden;
}

.smt-hero__bg {
  position: absolute;
  inset: -20% -10%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 50% at 20% 40%, rgba(124, 106, 255, 0.18), transparent 70%),
    radial-gradient(ellipse 50% 40% at 80% 60%, rgba(0, 212, 170, 0.1), transparent 70%);
  animation: smt-hero-gradient-shift 14s ease-in-out infinite alternate;
}

.smt-hero--home .smt-hero__inner {
  position: relative;
  z-index: 1;
}

.smt-hero__stats-sep {
  opacity: 0.5;
}

@keyframes smt-hero-gradient-shift {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 0.75;
  }
  100% {
    transform: translate3d(2%, -3%, 0) scale(1.06);
    opacity: 1;
  }
}

/* ==========================================================================
   Accessibility — focus
   ========================================================================== */

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

/* ==========================================================================
   prefers-reduced-motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms;
    animation-duration: 0.01ms;
    scroll-behavior: auto;
  }
}

/* ==========================================================================
   Breakpoints — Mobile S (max 480px)
   ========================================================================== */

@media (max-width: 480px) {
  .smt-container,
  .smt-content-width,
  .smt-listing-width {
    padding-left: var(--space-3);
    padding-right: var(--space-3);
  }

  h1,
  .smt-h1 {
    font-size: var(--text-3xl);
  }

  .smt-hero {
    padding-top: var(--space-10);
    padding-bottom: var(--space-8);
  }

  .smt-hero__search {
    flex-direction: column;
  }

  .smt-footer__grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .smt-footer__bottom {
    flex-direction: column;
    text-align: center;
  }
}

/* ==========================================================================
   Breakpoints — Mobile L (max 768px)
   ========================================================================== */

@media (max-width: 768px) {
  .smt-header__nav--desktop {
    display: none;
  }

  .smt-header__menu-toggle {
    display: flex;
  }

  .smt-section {
    padding-top: var(--space-8);
    padding-bottom: var(--space-8);
  }
}

/* ==========================================================================
   Breakpoints — Tablet (max 1024px)
   ========================================================================== */

@media (max-width: 1024px) {
  .smt-footer__grid {
    grid-template-columns: 1fr 1fr;
  }

  .smt-footer__grid .smt-footer__col--brand {
    grid-column: 1 / -1;
  }
}

/* ==========================================================================
   Breakpoints — Desktop (min 1025px)
   ========================================================================== */

@media (min-width: 1025px) {
  .smt-header__nav {
    display: flex;
  }

  .smt-header__menu-toggle {
    display: none;
  }

  .smt-header__drawer,
  .smt-header__drawer-overlay {
    display: none;
  }
}

/* ==========================================================================
   Breakpoints — Wide (min 1280px)
   ========================================================================== */

@media (min-width: 1280px) {
  .smt-container,
  .smt-content-width,
  .smt-listing-width,
  .smt-header__inner,
  .smt-footer__grid,
  .smt-footer__bottom {
    padding-left: var(--space-6);
    padding-right: var(--space-6);
  }
}
