/**
 * AG Fashion Hub - Base Styles
 * CSS reset, base typography, containers, and utility classes
 * 
 * This file provides the foundation for all pages
 */

/* ==================== CSS RESET ==================== */

/**
 * Modern CSS Reset
 * Removes browser default styles for consistency
 */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-normal);
  color: var(--color-dark);
  background-color: var(--color-bg);
  overflow-x: hidden;
}

/* Remove default list styles */
ul,
ol {
  list-style: none;
}

/* Remove default link styles */
a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition-color);
}

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

/* Ensure images are responsive */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Remove default button styles */
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

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

/* Remove default table spacing */
table {
  border-collapse: collapse;
  border-spacing: 0;
}


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

/**
 * Heading styles with consistent hierarchy
 */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  margin-bottom: var(--spacing-sm);
  color: var(--color-dark);
}

h1 {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
}

h2 {
  font-size: var(--font-size-2xl);
}

h3 {
  font-size: var(--font-size-xl);
}

h4 {
  font-size: var(--font-size-lg);
}

h5 {
  font-size: var(--font-size-base);
}

h6 {
  font-size: var(--font-size-sm);
}

/* Responsive heading sizes for larger screens */
@media (min-width: 768px) {
  h1 {
    font-size: var(--font-size-4xl);
  }
  
  h2 {
    font-size: var(--font-size-3xl);
  }
  
  h3 {
    font-size: var(--font-size-2xl);
  }
}

@media (min-width: 1024px) {
  h1 {
    font-size: var(--font-size-5xl);
  }
}

/**
 * Paragraph and text styles
 */
p {
  margin-bottom: var(--spacing-sm);
  line-height: var(--line-height-relaxed);
  color: var(--color-text);
}

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

em,
i {
  font-style: italic;
}

small {
  font-size: var(--font-size-sm);
}


/* ==================== LAYOUT CONTAINERS ==================== */

/**
 * Main container - centers content and adds padding
 */
.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--spacing-md);
  padding-right: var(--spacing-md);
}

/* Narrow container for text-heavy content */
.container--narrow {
  max-width: var(--container-narrow);
}

/* Wide container for full-width sections */
.container--wide {
  max-width: var(--container-wide);
}

/* No horizontal padding (for full-width images, etc.) */
.container--flush {
  padding-left: 0;
  padding-right: 0;
}

/* Responsive container padding */
@media (min-width: 768px) {
  .container {
    padding-left: var(--spacing-lg);
    padding-right: var(--spacing-lg);
  }
}


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

/**
 * Screen reader only text (accessible but invisible)
 */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

/**
 * Display utilities
 */
.hidden {
  display: none !important;
}

.block {
  display: block;
}

.inline {
  display: inline;
}

.inline-block {
  display: inline-block;
}

.flex {
  display: flex;
}

.grid {
  display: grid;
}

/**
 * Spacing utilities
 */
.mt-0 { margin-top: 0; }
.mt-xs { margin-top: var(--spacing-xs); }
.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mt-xl { margin-top: var(--spacing-xl); }

.mb-0 { margin-bottom: 0; }
.mb-xs { margin-bottom: var(--spacing-xs); }
.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }
.mb-xl { margin-bottom: var(--spacing-xl); }

.pt-sm { padding-top: var(--spacing-sm); }
.pt-md { padding-top: var(--spacing-md); }
.pt-lg { padding-top: var(--spacing-lg); }
.pt-xl { padding-top: var(--spacing-xl); }

.pb-sm { padding-bottom: var(--spacing-sm); }
.pb-md { padding-bottom: var(--spacing-md); }
.pb-lg { padding-bottom: var(--spacing-lg); }
.pb-xl { padding-bottom: var(--spacing-xl); }

/**
 * Color utilities
 */
.text-primary {
  color: var(--color-primary);
}

.text-secondary {
  color: var(--color-secondary);
}

.text-muted {
  color: var(--color-text-light);
}

.bg-primary {
  background-color: var(--color-primary);
}

.bg-secondary {
  background-color: var(--color-secondary);
}

.bg-light {
  background-color: var(--color-bg-section);
}


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

/**
 * Fade in animation for lazy-loaded content
 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.6s var(--transition-ease);
}

/**
 * Slide in animation
 */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.slide-in-left {
  animation: slideInLeft 0.5s var(--transition-ease);
}

/**
 * Pulse animation for attention
 */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

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


/* ==================== FOCUS STYLES ==================== */

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

:focus:not(:focus-visible) {
  outline: none;
}

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


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

/**
 * Custom text selection color
 */
::selection {
  background-color: var(--color-primary);
  color: var(--color-light);
}

::-moz-selection {
  background-color: var(--color-primary);
  color: var(--color-light);
}


/* ==================== SCROLLBAR STYLES ==================== */

/**
 * Custom scrollbar (webkit browsers only)
 */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}