/* ============================================================================
   DRYBOXHUB - GLOBAL STYLES
   ============================================================================ */

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

:root {
  --primary-color: #003366;
  --secondary-color: #FF6B35;
  --accent-color: #00A8E8;
  --dark-bg: #1a1a1a;
  --light-bg: #f8f9fa;
  --text-dark: #1a202c;
  --text-light: #4a5568; /* WCAG AA compliant - 4.5:1 contrast ratio */
  --border-color: #e0e0e0;
  --success-color: #27ae60;
  --warning-color: #f39c12;
  --error-color: #e74c3c;
  
  /* Safe area insets for notched devices */
  --safe-area-inset-top: env(safe-area-inset-top, 0px);
  --safe-area-inset-right: env(safe-area-inset-right, 0px);
  --safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-inset-left: env(safe-area-inset-left, 0px);
  
  /* Minimum touch target size - Google 2026 requirement */
  --min-touch-target: 44px;
}

/* ============================================================================
   IMAGE OPTIMIZATION - Prevent CLS (Cumulative Layout Shift)
   ============================================================================ */

img {
  max-width: 100%;
  height: auto;
  display: block;
  background-color: var(--light-bg);
  /* Optimize image rendering */
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* Aspect ratio containers for images - prevents CLS */
.hero-image img,
.post-image img,
.product-image img,
.blog-image img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  width: 100%;
}

.case-study-image img {
  aspect-ratio: 16 / 9;
  object-fit: cover;
  width: 100%;
}

/* Content visibility for below-fold content - improves INP */
.below-fold {
  content-visibility: auto;
  contain-intrinsic-size: auto 500px;
}

/* Performance optimizations for animated elements */
.btn,
button,
a,
.dropdown-menu,
.mega-menu,
.modal {
  will-change: auto;
}

.btn:hover,
button:hover,
.dropdown:hover .dropdown-menu,
.mega-dropdown:hover .mega-menu {
  will-change: transform, opacity;
}

/* GPU acceleration for smooth animations */
.modal.active {
  will-change: opacity;
}

/* Reduce paint areas with containment */
.card,
.product-card,
.feature-card,
.testimonial-card {
  contain: layout style paint;
}

/* ============================================================================
   ACCESSIBILITY - Skip to Main Content Link
   ============================================================================ */

.skip-to-main {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  background: var(--primary-color);
  color: white;
  padding: 1rem 2rem;
  text-decoration: none;
  font-weight: 600;
  border-radius: 0 0 0.5rem 0.5rem;
  transition: top 0.3s ease;
}

.skip-to-main:focus {
  top: 0;
  outline: 3px solid var(--secondary-color);
  outline-offset: 2px;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text-dark);
  line-height: 1.6;
  background-color: #fff;
  font-size: 16px;
  overflow-x: hidden;
  max-width: 100vw;
  position: relative;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 { font-size: clamp(2rem, 5vw, 4rem); }
h2 { font-size: clamp(1.75rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
  margin-bottom: 1rem;
  color: var(--text-dark);
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.3s ease;
  min-height: var(--min-touch-target);
  display: inline-flex;
  align-items: center;
}

a:hover {
  color: var(--secondary-color);
  text-decoration: underline;
}

a:focus-visible {
  outline: 3px solid var(--accent-color);
  outline-offset: 2px;
  border-radius: 2px;
}

button, .btn {
  background-color: var(--secondary-color);
  color: white;
  border: none;
  padding: 0.875rem 2rem;
  border-radius: 0.375rem;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  font-size: 1rem;
  font-family: inherit;
  min-height: var(--min-touch-target);
  min-width: var(--min-touch-target);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  /* Accessibility - ensure buttons have proper defaults */
  -webkit-appearance: button;
  appearance: button;
}

button:hover, .btn:hover {
  background-color: #e55a2b;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

button:focus-visible, .btn:focus-visible {
  outline: 3px solid var(--accent-color);
  outline-offset: 3px;
}

button:active, .btn:active {
  transform: translateY(0);
}

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

.btn-primary:hover {
  background-color: #002244;
  transform: translateY(-2px);
}

.btn-secondary {
  background-color: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  padding: 0.625rem 1.75rem;
}

.btn-secondary:hover {
  background-color: var(--primary-color);
  color: white;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 max(1.5rem, var(--safe-area-inset-right)) 0 max(1.5rem, var(--safe-area-inset-left));
  width: 100%;
  overflow-x: hidden;
}

.grid {
  display: grid;
  gap: 2rem;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

section {
  padding: 4rem 0;
}

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

code {
  background-color: var(--light-bg);
  padding: 0.2rem 0.4rem;
  border-radius: 0.25rem;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  color: var(--primary-color);
}

pre {
  background-color: var(--dark-bg);
  color: #fff;
  padding: 1.5rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

pre code {
  background-color: transparent;
  color: #fff;
  padding: 0;
}

blockquote {
  border-left: 4px solid var(--secondary-color);
  padding-left: 1rem;
  margin-left: 0;
  margin-bottom: 1rem;
  color: var(--text-light);
  font-style: italic;
}

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

ul, ol {
  margin-bottom: 1.5rem;
  padding-left: 2rem;
}

li {
  margin-bottom: 0.5rem;
}

ul > li::marker {
  color: var(--secondary-color);
}

ol > li::marker {
  color: var(--secondary-color);
}

/* ============================================================================
   TABLES
   ============================================================================ */

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}

thead {
  background-color: var(--primary-color);
  color: white;
}

th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
}

td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

tbody tr:hover {
  background-color: var(--light-bg);
}

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

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 0.875rem;
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  margin-right: 0.5rem;
  cursor: pointer;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-dark);
}

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

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

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

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

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.rounded { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.75rem; }
.rounded-full { border-radius: 9999px; }

.shadow { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); }
.shadow-lg { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15); }
.shadow-none { box-shadow: none; }

.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }

.hidden { display: none; }
.visible { display: block; }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }

  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }

  section {
    padding: 2.5rem 0;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }
  h3 { font-size: 1.1rem; }

  button, .btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
  }

  ul, ol {
    padding-left: 1.5rem;
  }

  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="number"],
  input[type="date"],
  select,
  textarea {
    font-size: 16px;
  }
}

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

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

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.fade-in {
  animation: fadeIn 0.6s ease forwards;
}

.slide-in-left {
  animation: slideInLeft 0.6s ease forwards;
}

.slide-in-right {
  animation: slideInRight 0.6s ease forwards;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

:focus-visible {
  outline: 2px solid var(--secondary-color);
  outline-offset: 2px;
}
    gap: 1rem;
  }
}
