/**
 * Modern CSS Reset
 * 
 * A comprehensive CSS reset to remove default browser styles
 * and provide a consistent baseline across all browsers.
 */

/* ===== Box Sizing Reset ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* ===== Remove Default Margins & Padding ===== */
* {
  margin: 0;
  padding: 0;
}

/* ===== HTML & Body Reset ===== */
html {
  /* Prevent font size inflation on mobile */
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  
  /* Enable smooth scrolling */
  scroll-behavior: smooth;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  /* Remove default body margin */
  margin: 0;
  
  /* Improve text rendering */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  
  /* Set consistent line-height */
  line-height: 1.5;
  
  /* Prevent horizontal scroll on small screens */
  overflow-x: hidden;
}

/* ===== Typography Reset ===== */
h1, h2, h3, h4, h5, h6 {
  font-size: inherit;
  font-weight: inherit;
  margin: 0;
  padding: 0;
}

p {
  margin: 0;
  padding: 0;
}

/* ===== List Reset ===== */
ul, ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

li {
  margin: 0;
  padding: 0;
}

/* ===== Link Reset ===== */
a {
  color: inherit;
  text-decoration: none;
  background-color: transparent;
}

a:hover,
a:focus {
  text-decoration: none;
}

/* ===== Button Reset ===== */
button {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  outline: inherit;
}

button::-moz-focus-inner {
  border: 0;
  padding: 0;
}

/* ===== Form Element Reset ===== */
input,
textarea,
select,
button {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  margin: 0;
  padding: 0;
  border: none;
  outline: none;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="tel"],
input[type="url"],
textarea {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* Remove default focus outline (add custom focus styles in your app.css) */
:focus {
  outline: none;
}

/* ===== Image Reset ===== */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

img {
  border-style: none;
}

/* ===== Table Reset ===== */
table {
  border-collapse: collapse;
  border-spacing: 0;
  margin: 0;
  padding: 0;
}

th,
td {
  padding: 0;
  text-align: left;
}

/* ===== Other Elements Reset ===== */
blockquote,
q {
  quotes: none;
}

blockquote::before,
blockquote::after,
q::before,
q::after {
  content: '';
  content: none;
}

/* ===== Remove default fieldset/legend styles ===== */
fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

legend {
  padding: 0;
  display: table;
}

/* ===== HR Reset ===== */
hr {
  box-sizing: content-box;
  height: 0;
  overflow: visible;
  border: 0;
  margin: 0;
  padding: 0;
}

/* ===== Details/Summary Reset ===== */
details,
summary {
  display: block;
}

summary {
  cursor: pointer;
}

/* ===== Misc HTML5 Elements ===== */
article,
aside,
details,
figcaption,
figure,
footer,
header,
main,
menu,
nav,
section {
  display: block;
}

/* ===== Embedded Content ===== */
audio,
video {
  display: inline-block;
}

audio:not([controls]) {
  display: none;
  height: 0;
}

/* ===== Hidden Elements ===== */
[hidden],
template {
  display: none;
}

/* ===== Smart TV Specific Resets ===== */
/* Remove webkit tap highlight on Smart TVs */
* {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Allow text selection for input fields */
input,
textarea {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

/* Remove blue highlight on focus for Smart TV browsers */
*:focus {
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

/* Prevent pull-to-refresh and overscroll on Smart TVs */
body {
  overscroll-behavior-y: none;
  overscroll-behavior-x: none;
}

/* ===== Accessibility ===== */
/* Ensure screen readers can access hidden content when needed */
.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;
}

