/**
 * Base Styles & Reset
 * Professional foundation for the Blueva design system
 */

/* ========================================
   RESET & NORMALIZATION
   ======================================== */

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--theme-text-primary);
  background: var(--theme-bg-primary);
  overflow-x: hidden;
  min-height: 100vh;
  transition: background-color var(--transition-base), color var(--transition-base);
}

/* Add padding for fixed navbar */
body {
  padding-top: var(--navbar-height);
}

/* ========================================
   TYPOGRAPHY
   ======================================== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  color: var(--theme-text-primary);
  margin-bottom: var(--space-4);
}

h1 {
  font-size: var(--text-5xl);
  font-weight: var(--font-extrabold);
}

h2 {
  font-size: var(--text-4xl);
  font-weight: var(--font-bold);
}

h3 {
  font-size: var(--text-3xl);
  font-weight: var(--font-semibold);
}

h4 {
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
}

h5 {
  font-size: var(--text-xl);
  font-weight: var(--font-medium);
}

h6 {
  font-size: var(--text-lg);
  font-weight: var(--font-medium);
}

p {
  margin-bottom: var(--space-4);
  color: var(--theme-text-secondary);
  line-height: var(--leading-relaxed);
}

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

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

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

em, i {
  font-style: italic;
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--theme-bg-tertiary);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  color: var(--theme-text-primary);
}

pre {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  background: var(--theme-bg-tertiary);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  margin-bottom: var(--space-6);
  border: 1px solid var(--theme-border-subtle);
}

pre code {
  background: transparent;
  padding: 0;
}

/* ========================================
   LISTS
   ======================================== */

ul, ol {
  margin-bottom: var(--space-4);
  padding-left: var(--space-6);
  color: var(--theme-text-secondary);
}

li {
  margin-bottom: var(--space-2);
  line-height: var(--leading-relaxed);
}

/* ========================================
   IMAGES & MEDIA
   ======================================== */

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

svg {
  fill: currentColor;
}

/* ========================================
   BUTTONS
   ======================================== */

button {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

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

/* ========================================
   FORMS
   ======================================== */

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}

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

/* ========================================
   SCROLLBAR STYLING
   ======================================== */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--theme-bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--gradient-brand);
  border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--theme-accent-secondary);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--theme-accent-primary) var(--theme-bg-secondary);
}

/* ========================================
   SELECTION
   ======================================== */

::selection {
  background: var(--theme-accent-primary);
  color: white;
}

::-moz-selection {
  background: var(--theme-accent-primary);
  color: white;
}

/* ========================================
   FOCUS VISIBLE (ACCESSIBILITY)
   ======================================== */

*:focus-visible {
  outline: 2px solid var(--theme-accent-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ========================================
   REDUCED MOTION (ACCESSIBILITY)
   ======================================== */

@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;
  }
}

/* ========================================
   HIGH CONTRAST MODE (ACCESSIBILITY)
   ======================================== */

@media (prefers-contrast: high) {
  :root {
    --theme-border-subtle: var(--theme-border-strong);
  }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

/* Spacing utilities */
.mt-0 { margin-top: var(--space-0); }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mt-12 { margin-top: var(--space-12); }
.mt-16 { margin-top: var(--space-16); }

.mb-0 { margin-bottom: var(--space-0); }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.mb-12 { margin-bottom: var(--space-12); }
.mb-16 { margin-bottom: var(--space-16); }

/* Text utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--theme-text-primary); }
.text-secondary { color: var(--theme-text-secondary); }
.text-tertiary { color: var(--theme-text-tertiary); }
.text-muted { color: var(--theme-text-muted); }

/* Display utilities */
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }

/* Flex utilities */
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-start { justify-content: flex-start; }
.justify-end { justify-content: flex-end; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* Width utilities */
.w-full { width: 100%; }
.w-auto { width: auto; }

/* Max width utilities */
.max-w-full { max-width: 100%; }
.max-w-screen-sm { max-width: var(--container-sm); }
.max-w-screen-md { max-width: var(--container-md); }
.max-w-screen-lg { max-width: var(--container-lg); }
.max-w-screen-xl { max-width: var(--container-xl); }
.max-w-screen-2xl { max-width: var(--container-2xl); }

/* Responsive utilities */
@media (max-width: 768px) {
  .hidden-mobile { display: none; }
}

@media (min-width: 769px) {
  .hidden-desktop { display: none; }
}

/* ========================================
   TEXT GRADIENT
   ======================================== */

.text-gradient-brand {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ========================================
   VIDEO CONTAINER
   ======================================== */

.video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  background: var(--theme-bg-secondary);
  border-radius: var(--radius-2xl);
  overflow: hidden;
  box-shadow: var(--theme-shadow-xl);
}

.video-container iframe,
.video-container img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
}
