/**
 * RetailAer Design System
 * Based on Figma design - October 2025
 */

/* ============================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   ============================================ */

:root {
  /* Colors - Primary (New Designer Palette Dec 2025) */
  --color-teal-dark: #2b3b4f;      /* Petrol - primary dark */
  --color-teal-primary: #2b3b4f;   /* Petrol - headers, footer */
  --color-teal-light: #00baa3;     /* Teal Green - primary light */

  /* Colors - Accent */
  --color-yellow-primary: #ffb061; /* Warm Orange - CTA buttons */
  --color-yellow-hover: #f5a050;   /* Warm Orange hover */

  /* Colors - Neutrals */
  --color-white: #FFFFFF;
  --color-gray-50: #F8F9FA;
  --color-gray-100: #E9ECEF;
  --color-gray-400: #787a7a;       /* Dark Grey - body text */
  --color-gray-900: #2b3b4f;       /* Petrol - headings */

  /* Gradients (Updated) */
  --gradient-hero: linear-gradient(135deg, #2b3b4f 0%, #00baa3 100%);
  --gradient-teal: linear-gradient(180deg, #2b3b4f 0%, #1e2d3d 100%);

  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Font Sizes */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.5rem;
  --text-2xl: 2rem;
  --text-3xl: 2.5rem;
  --text-4xl: 3rem;

  /* Font Weights */
  --font-light: 300;
  --font-regular: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;

  /* Line Heights */
  --leading-tight: 1.2;
  --leading-normal: 1.5;
  --leading-relaxed: 1.75;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;

  /* Layout */
  --container-max: 1200px;
  --container-padding: 2rem;

  /* Border Radius */
  --radius-sm: 0.5rem;
  --radius-md: 1rem;
  --radius-lg: 2rem;
  --radius-full: 50%;

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.15);

  /* Transitions */
  --transition-fast: all 0.15s ease;
  --transition-base: all 0.3s ease;
  --transition-slow: all 0.5s ease;
}

/* ============================================
   BASE STYLES
   ============================================ */

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

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

body {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  font-weight: var(--font-regular);
  line-height: var(--leading-normal);
  color: var(--color-gray-900);
  background-color: var(--color-white);
}

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

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  color: var(--color-gray-900);
  margin-bottom: var(--space-md);
}

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

p {
  margin-bottom: var(--space-sm);
  color: var(--color-gray-400);
  line-height: var(--leading-relaxed);
}

a {
  color: var(--color-teal-primary);
  text-decoration: none;
  transition: var(--transition-base);
}

a:hover {
  color: var(--color-teal-light);
}

/* ============================================
   LAYOUT UTILITIES
   ============================================ */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.section {
  padding: var(--space-2xl) 0;
}

.section-lg {
  padding: var(--space-3xl) 0;
}

/* ============================================
   COMPONENTS - BUTTONS
   ============================================ */

.btn {
  display: inline-block;
  padding: 0.875rem 2rem;
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  text-align: center;
  text-decoration: none;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: var(--transition-base);
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--color-yellow-primary);
  color: #1F2933;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background-color: var(--color-yellow-hover);
  color: #FFFFFF;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background-color: var(--color-white);
  color: var(--color-teal-primary);
  border: 2px solid var(--color-white);
}

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

.btn-outline {
  background-color: transparent;
  color: var(--color-teal-primary);
  border: 2px solid var(--color-teal-primary);
}

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

/* ============================================
   COMPONENTS - CARDS
   ============================================ */

.card {
  background-color: var(--color-white);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  box-shadow: var(--shadow-md);
  transition: var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.card-icon {
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-teal-primary);
  color: var(--color-white);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-md);
  font-size: var(--text-xl);
}

.card-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--color-gray-900);
  margin-bottom: var(--space-sm);
}

.card-text {
  font-size: var(--text-base);
  color: var(--color-gray-400);
  line-height: var(--leading-relaxed);
}

/* ============================================
   COMPONENTS - NAVIGATION
   ============================================ */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background-color: var(--color-teal-primary);
  padding: var(--space-sm) 0;
  transition: var(--transition-base);
}

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

.navbar-brand {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--color-white);
  text-decoration: none;
  display: flex;
  align-items: center;
}

.navbar-logo {
  height: 32px;
  width: auto;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  list-style: none;
}

.navbar-nav a {
  color: var(--color-white);
  font-weight: var(--font-medium);
  transition: var(--transition-base);
}

.navbar-nav a:hover {
  color: var(--color-yellow-primary);
}

/* Hide hamburger on desktop */
.mobile-menu-toggle {
  display: none;
}

/* ============================================
   GRID SYSTEM
   ============================================ */

.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

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

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

.text-white { color: var(--color-white) !important; }
.text-teal { color: var(--color-teal-primary) !important; }
.text-gray { color: var(--color-gray-400) !important; }

.bg-white { background-color: var(--color-white); }
.bg-gray { background-color: var(--color-gray-50); }
.bg-teal { background-color: var(--color-teal-primary); }

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

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

@media (max-width: 1024px) {
  :root {
    --container-padding: 1.5rem;
    --text-4xl: 2.5rem;
    --text-3xl: 2rem;
    --text-2xl: 1.75rem;
  }

  .grid-cols-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --container-padding: 1rem;
    --text-4xl: 2rem;
    --text-3xl: 1.75rem;
    --text-2xl: 1.5rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
  }

  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4 {
    grid-template-columns: repeat(1, 1fr);
  }

  /* Mobile Menu */
  .mobile-menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
  }

  .mobile-menu-toggle span {
    width: 25px;
    height: 2px;
    background-color: var(--color-white);
    transition: var(--transition-base);
  }

  .mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
  }

  .navbar-nav {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background-color: var(--color-teal-primary);
    flex-direction: column;
    gap: 0;
    padding: var(--space-lg);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    z-index: 1000;
  }

  .navbar-nav.active {
    transform: translateX(0);
  }

  .navbar-nav li {
    width: 100%;
  }

  .navbar-nav a {
    display: block;
    width: 100%;
    padding: var(--space-md) 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .navbar-nav .btn {
    margin-top: var(--space-md);
    text-align: center;
  }
}

/* ============================================
   TOOLTIP COMPONENT
   ============================================ */

.tooltip-wrapper {
  position: relative;
  display: inline-block;
}

.tooltip-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 4px;
  background-color: var(--color-yellow-primary);
  color: var(--color-teal-dark);
  border-radius: 50%;
  font-size: 10px;
  font-weight: var(--font-bold);
  cursor: help;
  vertical-align: super;
  line-height: 1;
  transition: background-color 0.2s ease;
}

.tooltip-trigger:hover {
  background-color: var(--color-yellow-hover);
}

.tooltip-trigger:focus {
  background-color: var(--color-yellow-hover);
  outline: 2px solid var(--color-teal-primary);
  outline-offset: 2px;
}

.tooltip-content {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 12px;
  background-color: var(--color-gray-900);
  color: var(--color-white);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  white-space: nowrap;
  border-radius: 6px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
  z-index: 1000;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.tooltip-content::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--color-gray-900);
}

.tooltip-wrapper:hover .tooltip-content,
.tooltip-wrapper:focus-within .tooltip-content {
  opacity: 1;
  visibility: visible;
}

@media (max-width: 768px) {
  .tooltip-content {
    white-space: normal;
    max-width: 200px;
  }
}
