/* Reset & Normalize */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Prevent text selection + tap flash on interactive elements */
button, a, label, .bottom-nav-item, .tab-btn, .element-row,
.card, .photo-thumbnail, .nav-link, .dropdown-item {
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Restore text selection for form inputs */
input, textarea {
  user-select: text;
  -webkit-user-select: text;
}

html, body {
  overscroll-behavior: none;
  overscroll-behavior-y: none;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

/* App ready - fade in content when loaded */
body.app-ready {
  opacity: 1;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 600;
  line-height: var(--line-height-tight);
}

h1 { font-size: var(--font-size-3xl); margin-bottom: var(--space-lg); }
h2 { font-size: var(--font-size-2xl); margin-bottom: var(--space-md); }
h3 { font-size: var(--font-size-xl); margin-bottom: var(--space-md); }
h4 { font-size: var(--font-size-lg); margin-bottom: var(--space-sm); }
h5 { font-size: var(--font-size-base); margin-bottom: var(--space-sm); }
h6 { font-size: var(--font-size-sm); margin-bottom: var(--space-sm); }

p {
  margin-bottom: var(--space-md);
}

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

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

ul, ol {
  list-style: none;
}

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

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

input, textarea, select {
  border: 1px solid var(--color-border);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast);
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

textarea {
  font-family: inherit;
  resize: vertical;
  min-height: 120px;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: var(--space-md);
  border-bottom: 1px solid var(--color-border-light);
}

th {
  font-weight: 600;
  background-color: var(--color-bg-secondary);
}

/* Mobile-specific: prevent iOS auto-zoom on form inputs */
@media (max-width: 767px) {
  input, textarea, select {
    font-size: 16px !important;
  }
}
