/**
 * BoardBlink Base Styles
 * Global reset, typography, and utilities
 */

/* ========================================
   RESET & BASE
   ======================================== */

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

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

body {
  margin: 0;
  font-family: var(--bb-font-sans);
  font-size: var(--bb-text-base);
  line-height: var(--bb-leading-normal);
  color: var(--bb-text);
  background: var(--bb-bg);
  background-color: var(--bb-bg);
  transition: background-color var(--bb-transition-base), 
              color var(--bb-transition-base);
}

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

h1, h2, h3, h4, h5, h6 {
  margin-top: 0;
  margin-bottom: var(--bb-space-3);
  font-weight: var(--bb-font-bold);
  line-height: var(--bb-leading-tight);
  color: var(--bb-text);
}

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

p {
  margin-top: 0;
  margin-bottom: var(--bb-space-3);
}

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

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

code {
  font-family: var(--bb-font-mono);
  font-size: 0.875em;
  background: var(--bb-surface);
  padding: 0.125rem 0.375rem;
  border-radius: var(--bb-radius-sm);
}

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

/* Text Colors */
.text-primary { color: var(--bb-primary) !important; }
.text-secondary { color: var(--bb-secondary) !important; }
.text-success { color: var(--bb-success) !important; }
.text-warning { color: var(--bb-warning) !important; }
.text-error { color: var(--bb-error) !important; }
.text-info { color: var(--bb-info) !important; }
.text-muted { color: var(--bb-text-muted) !important; }

/* Background Colors */
.bg-primary { background-color: var(--bb-primary) !important; }
.bg-surface { background-color: var(--bb-surface) !important; }
.bg-dark { background-color: var(--bb-bg-dark) !important; }
.bg-light { background-color: var(--bb-bg-light) !important; }

/* Spacing Utilities */
.mt-auto { margin-top: auto !important; }
.mb-auto { margin-bottom: auto !important; }

/* Display */
.hover-lift {
  transition: transform var(--bb-transition-base);
}

.hover-lift:hover {
  transform: translateY(-2px);
}

/* Shadows */
.shadow-sm { box-shadow: var(--bb-shadow-sm); }
.shadow-md { box-shadow: var(--bb-shadow-md); }
.shadow-lg { box-shadow: var(--bb-shadow-lg); }

/* ========================================
   LAYOUT HELPERS
   ======================================== */

.container-bb {
  max-width: var(--bb-container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--bb-space-4);
  padding-right: var(--bb-space-4);
}

.section-py {
  padding-top: var(--bb-space-8);
  padding-bottom: var(--bb-space-8);
}

/* ========================================
   RESPONSIVE UTILITIES
   ======================================== */

@media (max-width: 768px) {
  html {
    font-size: 14px;
  }
  
  .container-bb {
    padding-left: var(--bb-space-2);
    padding-right: var(--bb-space-2);
  }
  
  .section-py {
    padding-top: var(--bb-space-6);
    padding-bottom: var(--bb-space-6);
  }
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 5px var(--bb-primary);
  }
  50% {
    box-shadow: 0 0 20px var(--bb-primary);
  }
}

.fade-in {
  animation: fadeIn var(--bb-transition-base) ease-out;
}

.pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* ========================================
   FOCUS STATES (Accessibility)
   ======================================== */

:focus-visible {
  outline: 2px solid var(--bb-primary);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--bb-primary);
  outline-offset: 2px;
}

/* ========================================
   BLINK LOGO ICON (Animated)
   ======================================== */

.blink-icon {
  position: relative;
  display: inline-block;
  width: 20px;
  height: 20px;
  vertical-align: middle;
}

.blink-icon .outer,
.blink-icon .inner {
  position: absolute;
  line-height: 1;
}

.blink-icon .outer {
  color: white;
  font-size: 20px;
  top: 0;
  left: 0;
}

.blink-icon .inner {
  color: #ff8c00;
  font-size: 7px;
  top: 50%;
  left: 50%;
  margin-top: -3.5px;  /* Half of font-size to center */
  margin-left: -3.5px;
  animation: blink-pulse 2s ease-in-out infinite;
}

@keyframes blink-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Larger variant for hero/feature sections */
.blink-icon-lg {
  width: 60px;
  height: 60px;
}

.blink-icon-lg .outer {
  font-size: 60px;
  top: 0;
  left: 0;
}

.blink-icon-lg .inner {
  font-size: 21px;
  top: 50%;
  left: 50%;
  margin-top: -10.5px;  /* Half of font-size to center */
  margin-left: -10.5px;
}
