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

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--color-charcoal);
  background-color: var(--color-cream);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.25;
}

/* Mobile Performance & Interaction Optimizations */
@media (max-width: 768px) {
  * {
    /* Optimize touch interactions */
    -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 inputs and content */
  input,
  textarea,
  [contenteditable],
  .story-text,
  .story-content,
  p {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
  }
  
  /* Optimize animated elements */
  .btn,
  .card,
  .modal,
  .story-card,
  .character-card,
  .age-card,
  .suggestion-btn {
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
  }
  
  /* Smooth scrolling for mobile */
  html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Enhanced focus styles for mobile accessibility */
  button:focus,
  .btn:focus,
  input:focus,
  textarea:focus,
  [tabindex]:focus {
    outline: 3px solid var(--color-sage);
    outline-offset: 2px;
  }
  
  /* Mobile-optimized line heights for better readability */
  body {
    line-height: var(--leading-relaxed-mobile);
  }
  
  h1, h2, h3, h4, h5, h6 {
    line-height: var(--leading-tight-mobile);
  }
}

/* Cookie Consent Banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(20, 20, 20, 0.95);
  color: white;
  padding: var(--space-4) var(--space-6);
  z-index: 1000;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.cookie-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  gap: var(--space-4);
}

.cookie-content p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.4;
}

.cookie-content a {
  color: var(--color-sage);
  text-decoration: underline;
}

.cookie-accept-btn {
  background: var(--color-sage);
  color: white;
  border: none;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
  flex-shrink: 0;
}

.cookie-accept-btn:hover {
  background: var(--color-ocean);
}

@media (max-width: 768px) {
  .cookie-content {
    flex-direction: column;
    text-align: center;
    gap: var(--space-3);
  }
  
  .cookie-accept-btn {
    width: 100%;
    max-width: 200px;
  }
}

/* Simple Footer */
.simple-footer {
  margin-top: var(--space-20);
  padding: var(--space-8) var(--space-4);
  text-align: center;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(255, 251, 245, 0.5);
}

.footer-links {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--color-sage);
  text-decoration: underline;
}

.footer-links span {
  margin: 0 var(--space-2);
  opacity: 0.5;
}

/* Utility Classes */
.hidden {
  display: none;
}
