/* Majatsebo Holdings - Brand Design System */

/* ============================================
   CSS Custom Properties (Brand Variables)
   ============================================ */

:root {
  /* Primary Brand Colors (from CLAUDE.md) */
  --maj-primary: #2F4156;      /* Navy Blue - trust, professionalism */
  --maj-teal: #567C8D;          /* Teal - innovation, growth */
  --maj-sky: #C8D9E6;           /* Sky Blue - accessibility, clarity */

  /* Secondary Colors */
  --maj-beige: #F5EFE8;         /* Warmth, accessibility */
  --maj-white: #FFFFFF;

  /* Screenshot-Inspired Palette */
  --maj-accent: #4FC3F7;        /* Bright teal/cyan accent from screenshots */
  --maj-proto-navy: #1B365D;    /* Deep navy from prototype */
  --maj-proto-cream: #E8D5B7;   /* Cream/Beige from prototype */
  --maj-proto-gray-blue: #4A5F7A; /* Darker Gray-Blue for light backgrounds */
  --maj-proto-text: #2F4156;    /* Dark text for light backgrounds */
  --maj-proto-bg: transparent;  /* Transparent to show background image */
  --maj-card-bg: rgba(255, 255, 255, 0.85); /* Light card background with transparency */
  --maj-text-muted: #4A6B8A;    /* Darker muted text for light backgrounds */

  /* Semantic Colors */
  --maj-text-primary: #1B365D;  /* Dark navy for main text */
  --maj-text-secondary: var(--maj-text-muted);
  --maj-bg-dark: var(--maj-proto-bg);
  --maj-bg-light: #F5F5F5;

  /* Typography */
  --font-heading: 'Playfair Display', serif;
  --font-body: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* ============================================
   Typography
   ============================================ */

body {
  font-family: var(--font-body);
  background-color: transparent;
  color: #1B365D;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  max-width: 100vw;
}

/* Ensure media elements are responsive */
img, svg, video {
  max-width: 100%;
  height: auto;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
}

/* ============================================
   Utility Classes
   ============================================ */

/* Text Colors */
.text-maj-primary { color: #1B365D !important; }
.text-maj-secondary { color: var(--maj-proto-cream) !important; }
.text-maj-support { color: #4A6B8A !important; }
.text-maj-teal { color: #567C8D !important; }
.text-maj-sky { color: var(--maj-sky) !important; }

/* Background Colors */
.bg-maj-primary { background-color: var(--maj-primary); }
.bg-maj-secondary { background-color: var(--maj-proto-cream); }
.bg-maj-support { background-color: var(--maj-proto-gray-blue); }
.bg-maj-teal { background-color: var(--maj-teal); }
.bg-maj-sky { background-color: var(--maj-sky); }

/* ============================================
   Component Styles
   ============================================ */

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, #2563EB 0%, #3B82F6 100%);
  color: var(--maj-white);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.btn-secondary {
  background: transparent;
  color: var(--maj-white);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.btn-secondary:active {
  transform: translateY(0);
}

/* Badges */
.badge-accent {
  background: rgba(79, 195, 247, 0.1);
  color: var(--maj-accent);
  border: 1px solid rgba(79, 195, 247, 0.2);
  font-weight: 500;
  transition: transform 0.2s ease;
}

.badge-accent:hover {
  transform: scale(1.02);
}

/* Cards */
.card {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(47, 65, 86, 0.15);
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  color: #1B365D;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(79, 195, 247, 0.4);
  box-shadow: 0 10px 30px rgba(47, 65, 86, 0.15);
}

/* Surfaces */
.surface {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(47, 65, 86, 0.15);
  backdrop-filter: blur(10px);
  color: #1B365D;
}

.soft-surface {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.8));
}

/* Dividers */
.divider {
  border-color: rgba(47, 65, 86, 0.15);
}

/* ============================================
   Gradient Effects
   ============================================ */

.hero-gradient-text {
  background: linear-gradient(135deg, #4FC3F7 0%, #29B6F6 50%, #03A9F4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-gradient-bg {
  background: radial-gradient(50% 50% at 50% 30%, rgba(79, 195, 247, 0.08) 0%, rgba(10, 15, 30, 0) 70%),
              linear-gradient(180deg, rgba(255, 255, 255, 0.01), rgba(255, 255, 255, 0));
}

/* Service Card Gradients */
.gradient-training {
  background: linear-gradient(135deg, #2563EB 0%, #3B82F6 100%);
}

.gradient-construction {
  background: linear-gradient(135deg, #7C3AED 0%, #A855F7 100%);
}

.gradient-consulting {
  background: linear-gradient(135deg, #059669 0%, #10B981 100%);
}

/* Director Profile Cards */
.director-profile-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.director-profile-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Credentials Page Cards */
.credential-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.credential-card:hover {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

/* ============================================
   Header & Navigation
   ============================================ */

header {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  max-width: 100vw;
  overflow-x: hidden;
}

header .font-bold {
  color: #1B365D !important;
}

header nav a {
  color: #4A6B8A;
}

header nav a:hover {
  color: #1B365D;
}

/* Prevent horizontal scrolling on mobile */
@media (max-width: 640px) {
  header .flex {
    min-width: 0;
  }

  header a,
  header button {
    flex-shrink: 0;
  }
}

/* ============================================
   Footer
   ============================================ */

footer {
  background: transparent;
  color: #1B365D;
}

footer h3 {
  color: #1B365D;
}

footer .font-bold {
  color: #1B365D;
}

footer .text-maj-support {
  color: #4A6B8A;
}

footer a {
  color: #4A6B8A;
}

footer a:hover {
  color: #1B365D;
}

/* ============================================
   Animation Enhancements
   ============================================ */

/* Icon animations */
.icon-hover {
  transition: transform 0.2s ease;
}

.icon-hover:hover {
  transform: scale(1.1);
}

/* Loading animations */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.animate-fade-in {
  animation: fadeIn 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-slide-down {
  animation: slideDown 0.3s ease-out;
}

/* Success/Error message animations */
.message-enter {
  animation: slideDown 0.3s ease-out;
}

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
}

/* ============================================
   Accessibility - WCAG 2.1 AA Compliant
   ============================================ */

/* Skip to main content link */
.skip-to-main {
  position: absolute;
  left: -9999px;
  z-index: 999;
  padding: 1rem 1.5rem;
  background-color: var(--maj-primary);
  color: var(--maj-white);
  text-decoration: none;
  border-radius: 0 0 0.5rem 0;
  font-weight: 600;
}

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

/* Focus states for keyboard navigation - 2px minimum */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--maj-teal);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Enhanced focus for interactive elements */
.btn-primary:focus-visible,
.btn-secondary:focus-visible {
  outline: 3px solid var(--maj-teal);
  outline-offset: 3px;
  box-shadow: 0 0 0 3px rgba(86, 124, 141, 0.3);
}

/* Focus for cards and interactive elements */
.card:focus-visible,
article:focus-visible {
  outline: 3px solid var(--maj-teal);
  outline-offset: 2px;
}

/* Focus for navigation links */
nav a:focus-visible {
  outline: 3px solid var(--maj-teal);
  outline-offset: 2px;
  background-color: rgba(86, 124, 141, 0.1);
}

/* Screen reader only content */
.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;
}

.sr-only-focusable:focus,
.sr-only-focusable:active {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* Enhanced color contrast for links */
a {
  text-decoration-skip-ink: auto;
}

/* Ensure sufficient color contrast for text - WCAG AA compliant */
.text-maj-support {
  color: #4A6B8A !important;
}

.text-maj-teal {
  color: #567C8D !important;
}

.text-maj-primary {
  color: #1B365D !important;
}

/* Ensure header text is always visible */
header .font-bold {
  color: #1B365D !important;
}

/* Mobile menu visibility */
#mobileMenuNav {
  background: rgba(255, 255, 255, 0.98) !important;
}

#mobileMenuNav a {
  color: #4A6B8A !important;
}

#mobileMenuNav a:hover {
  color: #1B365D !important;
}

#mobileMenuNav .btn-primary {
  color: #ffffff !important;
}

/* Ensure all headings use consistent colors */
h1, h2, h3, h4, h5, h6 {
  color: #1B365D;
}

/* Paragraph text */
p {
  color: #4A6B8A;
}

/* Form error states */
input:invalid:not(:placeholder-shown),
textarea:invalid:not(:placeholder-shown),
select:invalid:not(:placeholder-shown) {
  border-color: #ef4444;
}

/* Live regions for dynamic content */
[aria-live="polite"],
[aria-live="assertive"] {
  position: relative;
}

/* Focus trap for modals */
.modal-open {
  overflow: hidden;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.75);
  z-index: 1000;
}

/* Reduced motion support */
@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;
  }

  html {
    scroll-behavior: auto;
  }

  .card:hover {
    transform: none;
  }

  .btn-primary:hover,
  .btn-secondary:hover {
    transform: none;
  }

  .icon-hover:hover {
    transform: none;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .card,
  .surface {
    border-width: 2px;
    border-color: currentColor;
  }

  .btn-primary,
  .btn-secondary {
    border: 2px solid currentColor;
  }
}

/* Keyboard navigation indicators */
*:focus:not(:focus-visible) {
  outline: none;
}

/* Ensure buttons have sufficient touch target size (44x44px minimum) */
button,
.btn-primary,
.btn-secondary,
a[role="button"] {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Visible focus indicators for all interactive elements */
input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible {
  outline: 3px solid var(--maj-teal);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px rgba(86, 124, 141, 0.2);
}

/* Form labels - ensure proper association visibility */
label {
  cursor: pointer;
  user-select: none;
}

/* Error states with sufficient contrast */
.border-red-500,
input.border-red-500,
textarea.border-red-500,
select.border-red-500 {
  border-color: #ef4444 !important;
  border-width: 2px;
}

/* Success states */
.border-green-500 {
  border-color: #22c55e !important;
  border-width: 2px;
}

/* ARIA live regions styling */
[role="alert"],
[role="status"] {
  padding: 1rem;
  border-radius: 0.75rem;
  margin-top: 0.5rem;
}

/* Ensure proper text sizing (responsive rem/em, not fixed px) */
html {
  font-size: 16px; /* Base size */
}

body {
  font-size: 1rem; /* 16px */
  line-height: 1.5;
}

h1 { font-size: clamp(2rem, 5vw, 4rem); line-height: 1.2; }
h2 { font-size: clamp(1.75rem, 4vw, 3rem); line-height: 1.3; }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.4; }
h4 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); line-height: 1.4; }
h5 { font-size: clamp(1.125rem, 2vw, 1.25rem); line-height: 1.5; }
h6 { font-size: 1rem; line-height: 1.5; }

/* Ensure sufficient spacing for readability */
p, li {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

/* Link underlining for better accessibility */
main a:not(.btn-primary):not(.btn-secondary):not([class*="button"]) {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

main a:not(.btn-primary):not(.btn-secondary):not([class*="button"]):hover {
  text-decoration-thickness: 2px;
}

/* ============================================
   Parallax Background
   ============================================ */

.parallax-bg {
  will-change: transform, opacity, filter;
  transition: transform 0.1s ease-out, opacity 0.3s cubic-bezier(0.4, 0.0, 0.2, 1), filter 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
  max-width: 100vw;
  overflow: hidden;
}

/* ============================================
   Responsive Utilities
   ============================================ */

/* Prevent horizontal overflow on all screen sizes */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

/* Ensure all major containers respect viewport width */
header, main, section, footer {
  max-width: 100vw;
  overflow-x: hidden;
}

@media (max-width: 768px) {
  .hero-gradient-text {
    font-size: clamp(2rem, 8vw, 4rem);
  }

  /* Ensure proper spacing on mobile */
  .max-w-7xl {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* Extra small devices (phones, less than 375px) */
@media (max-width: 374px) {
  /* Make header even more compact */
  header .flex {
    gap: 0.5rem;
  }

  /* Reduce logo size further if needed */
  header a > img {
    height: 2rem;
    width: 2rem;
  }

  /* Make company name smaller but still readable */
  header a > span {
    font-size: 0.875rem;
  }
}
