/* ============================================================================
   TRADESHOW PLATFORM - Main Stylesheet

   This file imports all CSS modules in the correct order.
   Import this single file in your HTML to load all styles.

   Architecture:
   1. Base - Variables, reset, typography, utilities
   2. Components - Reusable UI components
   3. Layouts - Page layout structures
   4. Pages - Page-specific styles
   ============================================================================ */

/* ===== BASE STYLES ===== */
/* Variables and CSS custom properties */
@import 'base/variables.css';

/* CSS Reset and normalization */
@import 'base/reset.css';

/* Typography system */
@import 'base/typography.css';

/* Utility classes */
@import 'base/utilities.css';

/* ===== COMPONENTS ===== */
/* Button components */
@import 'components/buttons.css';

/* Card components */
@import 'components/cards.css';

/* Form elements */
@import 'components/forms.css';

/* Modal dialogs */
@import 'components/modals.css';

/* Navigation components */
@import 'components/navigation.css';

/* Table components */
@import 'components/tables.css';

/* Chat widget */
@import 'components/chat.css';

/* ===== LAYOUTS ===== */
/* Authentication pages layout */
@import 'layouts/auth.css';

/* Dashboard layout */
@import 'layouts/dashboard.css';

/* Venue layouts (Lobby, Expo Hall, Booth, Stage) */
@import 'layouts/venue.css';

/* ===== PAGES ===== */
/* Events pages */
@import 'pages/events.css';

/* Booth pages */
@import 'pages/booth.css';

/* ============================================================================
   GLOBAL OVERRIDES & FIXES
   ============================================================================ */

/* Ensure smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Focus visible for accessibility */
*:focus-visible {
  outline: 2px solid var(--color-accent-primary);
  outline-offset: 2px;
}

/* Prevent layout shift during loading */
img[loading="lazy"] {
  min-height: 1px;
}

/* Better font rendering */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Prevent horizontal overflow */
body {
  overflow-x: hidden;
}

/* ============================================================================
   PRINT STYLES
   ============================================================================ */

@media print {
  /* Remove backgrounds to save ink */
  * {
    background: white !important;
    color: black !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  /* Ensure links are visible */
  a,
  a:visited {
    text-decoration: underline;
    color: #0000ff !important;
  }

  /* Show link URLs after the link text */
  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }

  /* Don't show URLs for fragment identifiers or javascript: links */
  a[href^="#"]::after,
  a[href^="javascript:"]::after {
    content: "";
  }

  /* Page breaks */
  h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid;
  }

  img, table, figure {
    page-break-inside: avoid;
  }

  /* Ensure consistent page margins */
  @page {
    margin: 2cm;
  }

  /* Hide interactive elements */
  button,
  .btn,
  nav,
  .navbar,
  .sidebar,
  .modal,
  .chat-widget,
  form,
  input,
  textarea,
  select {
    display: none !important;
  }

  /* Expand collapsed content */
  details {
    display: block !important;
  }

  summary {
    display: none !important;
  }

  /* Show all content */
  .hidden,
  .sr-only {
    position: static !important;
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
    clip: auto !important;
  }
}

/* ============================================================================
   ACCESSIBILITY ENHANCEMENTS
   ============================================================================ */

/* Reduce motion for users who prefer it */
@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 support */
@media (prefers-contrast: high) {
  :root {
    --color-border: #000;
    --shadow-sm: none;
    --shadow-md: none;
    --shadow-lg: none;
    --shadow-xl: none;
  }

  [data-theme="light"] {
    --color-border: #000;
  }

  * {
    border-width: 2px !important;
  }
}

/* ============================================================================
   PERFORMANCE OPTIMIZATIONS
   ============================================================================ */

/* Use GPU acceleration for transforms and animations */
.card-clickable,
.btn,
.navbar-nav-link,
.sidebar-nav-link,
.modal-dialog,
.booth-gallery-item,
.event-card-enhanced {
  will-change: transform;
}

/* Optimize animations */
@media (prefers-reduced-motion: no-preference) {
  .card-clickable:hover,
  .btn:hover,
  .booth-gallery-item:hover {
    transform: translateY(-4px);
  }
}

/* ============================================================================
   BROWSER-SPECIFIC FIXES
   ============================================================================ */

/* Safari-specific fixes */
@supports (-webkit-appearance: none) {
  /* Fix Safari form autofill background */
  input:-webkit-autofill,
  input:-webkit-autofill:hover,
  input:-webkit-autofill:focus,
  textarea:-webkit-autofill,
  textarea:-webkit-autofill:hover,
  textarea:-webkit-autofill:focus,
  select:-webkit-autofill,
  select:-webkit-autofill:hover,
  select:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--color-text-primary);
    -webkit-box-shadow: 0 0 0 1000px var(--color-bg-secondary) inset;
    transition: background-color 5000s ease-in-out 0s;
  }
}

/* Firefox-specific fixes */
@-moz-document url-prefix() {
  /* Fix Firefox scrollbar */
  * {
    scrollbar-width: thin;
    scrollbar-color: var(--color-border-light) var(--color-bg-secondary);
  }
}

/* ============================================================================
   RESPONSIVE BREAKPOINTS SUMMARY

   Mobile: < 768px
   Tablet: 768px - 1024px
   Desktop: > 1024px
   Large Desktop: > 1280px
   Extra Large: > 1536px
   ============================================================================ */

/* ============================================================================
   LOADING STATES
   ============================================================================ */

/* Global loading indicator */
.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.6;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2rem;
  height: 2rem;
  margin: -1rem 0 0 -1rem;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  z-index: 1000;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Skeleton loading */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-bg-secondary) 25%,
    var(--color-bg-tertiary) 50%,
    var(--color-bg-secondary) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.skeleton-text {
  height: 1em;
  margin-bottom: 0.5em;
}

.skeleton-title {
  height: 2em;
  margin-bottom: 1em;
}

.skeleton-avatar {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
}

/* ============================================================================
   TOOLTIP STYLES
   ============================================================================ */

[data-tooltip] {
  position: relative;
  cursor: help;
}

[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: var(--space-xs) var(--space-sm);
  background-color: var(--color-bg-tertiary);
  color: var(--color-text-primary);
  font-size: var(--font-size-xs);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
  margin-bottom: var(--space-xs);
  z-index: var(--z-tooltip);
}

[data-tooltip]:hover::before {
  opacity: 1;
}

/* ============================================================================
   SUCCESS - All styles loaded!
   ============================================================================ */
