/**
 * ============================================
 * CSS RESET & NORMALIZATION - avocatLDM
 * ============================================
 * Modern CSS reset pentru consistență cross-browser
 * Bazat pe best practices moderne (Josh Comeau, Andy Bell)
 */

/* ===== BOX SIZING ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ===== HTML & BODY ===== */
html {
  /* Îmbunătățim smooth scroll pe browsere moderne */
  scroll-behavior: smooth;
  
  /* Prevenim overflow horizontal */
  overflow-x: hidden;
  
  /* Font size de bază pentru rem calculations */
  font-size: 16px;
  
  /* Îmbunătățim renderingul textului */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  /* Font family principal */
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 
               'Helvetica Neue', Arial, sans-serif;
  
  /* Culoare și background din variabile */
  color: var(--color-text-primary);
  background: var(--color-dark-primary);
  
  /* Line height pentru lizibilitate */
  line-height: var(--line-height-relaxed);
  
  /* Prevenim overflow horizontal */
  overflow-x: hidden;
  
  /* Font size responsiv */
  font-size: var(--font-size-base);
  
  /* Minimum height */
  min-height: 100vh;
}

/* ===== HEADINGS ===== */
h1, h2, h3, h4, h5, h6 {
  line-height: var(--line-height-tight);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  margin: 0;
}

h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }
h5 { font-size: var(--font-size-lg); }
h6 { font-size: var(--font-size-base); }

/* ===== TEXT ELEMENTS ===== */
p {
  margin: 0;
  line-height: var(--line-height-relaxed);
}

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

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

strong, b {
  font-weight: var(--font-weight-bold);
}

em, i {
  font-style: italic;
}

small {
  font-size: var(--font-size-sm);
}

/* ===== LISTS ===== */
ul, ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

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

/* ===== FORMS ===== */
input, button, textarea, select {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

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

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Remove default input styles */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="password"],
textarea,
select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* ===== TABLES ===== */
table {
  border-collapse: collapse;
  border-spacing: 0;
  width: 100%;
}

/* ===== CODE ===== */
code, pre, kbd, samp {
  font-family: 'Courier New', Courier, monospace;
}

code {
  padding: 2px 6px;
  background: var(--color-bg-light);
  border-radius: var(--radius-sm);
  font-size: 0.9em;
}

pre {
  padding: var(--spacing-md);
  background: var(--color-bg-light);
  border-radius: var(--radius-md);
  overflow-x: auto;
}

/* ===== ACCESSIBILITY ===== */
/* Focus visible pentru keyboard navigation */
*:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Ascunde visual dar păstrează pentru screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ===== ANIMATIONS ===== */
/* Respectă preferințele utilizatorului pentru animații */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===== UTILITY CLASSES ===== */
.clearfix::after {
  content: "";
  display: table;
  clear: both;
}

.hidden {
  display: none !important;
}

.invisible {
  visibility: hidden;
}

/* ===== SCROLLBAR STYLING (WebKit) ===== */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--color-dark-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--color-primary);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary-accent);
}

/* ===== SELECTION ===== */
::selection {
  background: var(--color-primary);
  color: var(--color-dark-primary);
}

::-moz-selection {
  background: var(--color-primary);
  color: var(--color-dark-primary);
}
