/**
 * TubeRaker CSS Reset
 * Modern CSS reset with sensible defaults
 */

/* ===== Box Sizing ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ===== Root & Body ===== */
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-size: 16px;
  line-height: 1.5;
  height: 100%;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--font-family-base);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
}

/* ===== Typography Reset ===== */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
}

p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ===== Lists ===== */
ul, ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ===== Forms ===== */
button,
input,
optgroup,
select,
textarea {
  font-family: inherit;
  font-size: 100%;
  line-height: 1.15;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  color: inherit;
}

button {
  cursor: pointer;
  user-select: none;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

input:focus,
select:focus,
textarea:focus,
button:focus {
  outline: none;
}

/* ===== Media ===== */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ===== Tables ===== */
table {
  border-collapse: collapse;
  border-spacing: 0;
  width: 100%;
}

/* ===== HR ===== */
hr {
  border: 0;
  border-top: 1px solid var(--border-primary);
  margin: var(--spacing-md) 0;
}

/* ===== Code ===== */
code,
kbd,
samp,
pre {
  font-family: var(--font-family-mono);
  font-size: 0.9em;
}

/* ===== Selection ===== */
::selection {
  background-color: var(--color-brand-primary);
  color: white;
}

::-moz-selection {
  background-color: var(--color-brand-primary);
  color: white;
}

/* ===== Scrollbar (Webkit) ===== */
::-webkit-scrollbar {
  width: 0.75rem;
  height: 0.75rem;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  border: 0.125rem solid var(--bg-secondary);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--bg-hover);
}

/* ===== Focus Visible (Accessibility) ===== */
:focus-visible {
  outline: 0.125rem solid var(--color-brand-primary);
  outline-offset: 0.125rem;
}

/* ===== Remove default focus ring for mouse users ===== */
:focus:not(:focus-visible) {
  outline: none;
}

/* ===== Hidden ===== */
[hidden] {
  display: none !important;
}

/* ===== Screen Reader Only ===== */
.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;
}
