/* ==========================================
   GEMSBOK ECOSYSTEM - STYLE.CSS
   Dark theme with neon cyan and red accents
   Glassmorphism design with smooth animations
   ========================================== */

/* ==========================================
   CSS RESET & BASE STYLES
   ========================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #ffffff;
  background: #0a0a0f;
  line-height: 1.6;
}

/* ==========================================
   BACKGROUND VIDEO
   ========================================== */
.bg-video {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}

/* ==========================================
   DARK TRANSLUCENT OVERLAY
   ========================================== */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    rgba(10, 10, 15, 0.85) 0%,
    rgba(20, 20, 30, 0.75) 50%,
    rgba(10, 10, 15, 0.85) 100%
  );
  z-index: -1;
}

/* ==========================================
   MAIN CONTENT LAYOUT
   ========================================== */
.content {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  z-index: 1;
}

/* ==========================================
   HEADER
   ========================================== */
.header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.header-label {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #00e5ff;
  margin-bottom: 0.5rem;
}

.header-sublabel {
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.7);
}

/* ==========================================
   INTRO SECTION
   ========================================== */
.intro {
  text-align: center;
  max-width: 600px;
  margin-bottom: 2rem;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: #ffffff;
  letter-spacing: 0.02em;
}

.section-description {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.8);
  max-width: 540px;
  margin: 0 auto;
}

/* ==========================================
   SEARCH CONTAINER
   ========================================== */
.search-container {
  position: relative;
  max-width: 400px;
  margin: 1.5rem auto 0;
}

.search-input {
  width: 100%;
  padding: 0.875rem 1rem 0.875rem 3rem;
  background: rgba(20, 20, 35, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: 24px;
  color: #ffffff;
  font-size: 0.9375rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  transition: all 0.3s ease;
  outline: none;
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.search-input:focus {
  border-color: rgba(0, 229, 255, 0.5);
  background: rgba(25, 25, 45, 0.7);
  box-shadow: 0 0 24px rgba(0, 229, 255, 0.15);
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(0, 229, 255, 0.6);
  pointer-events: none;
}

/* ==========================================
   ECOSYSTEM CIRCLE CONTAINER
   ========================================== */
.ecosystem-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 1200px;
  margin: 1rem 0;
}

.ecosystem-circle {
  position: relative;
  width: min(750px, 95vw);
  height: min(750px, 95vw);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================
   CENTER BADGE (GEMSBOK GROUP HUB)
   ========================================== */
.center-badge {
  position: relative;
  z-index: 50;
  width: 200px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  background: transparent;
  transition: transform 0.3s ease;
}

/* Animated Logo in Center */
.center-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 20px rgba(212, 175, 55, 0.6))
          drop-shadow(0 0 40px rgba(212, 175, 55, 0.4))
          drop-shadow(0 0 60px rgba(220, 38, 38, 0.3));
  animation: logoGlowPulse 3s ease-in-out infinite;
}

@keyframes logoGlowPulse {
  0%, 100% {
    filter: drop-shadow(0 0 15px rgba(212, 175, 55, 0.5))
            drop-shadow(0 0 30px rgba(212, 175, 55, 0.3))
            drop-shadow(0 0 50px rgba(220, 38, 38, 0.2));
    transform: scale(1);
  }
  50% {
    filter: drop-shadow(0 0 25px rgba(212, 175, 55, 0.8))
            drop-shadow(0 0 50px rgba(212, 175, 55, 0.5))
            drop-shadow(0 0 80px rgba(220, 38, 38, 0.4));
    transform: scale(1.02);
  }
}

.center-badge:hover {
  transform: scale(1.08);
}

.center-badge:hover .center-logo {
  filter: drop-shadow(0 0 30px rgba(212, 175, 55, 1))
          drop-shadow(0 0 60px rgba(212, 175, 55, 0.7))
          drop-shadow(0 0 100px rgba(220, 38, 38, 0.5));
}

.center-badge:active {
  transform: scale(0.98);
  transition: transform 0.1s ease;
}

.center-badge.click-ripple .center-logo {
  animation: logoClickFlash 0.6s ease-out;
}

@keyframes logoClickFlash {
  0% {
    filter: drop-shadow(0 0 20px rgba(212, 175, 55, 0.6))
            drop-shadow(0 0 40px rgba(212, 175, 55, 0.4));
  }
  50% {
    filter: drop-shadow(0 0 40px rgba(255, 255, 255, 0.9))
            drop-shadow(0 0 80px rgba(212, 175, 55, 0.8))
            drop-shadow(0 0 120px rgba(220, 38, 38, 0.6));
  }
  100% {
    filter: drop-shadow(0 0 20px rgba(212, 175, 55, 0.6))
            drop-shadow(0 0 40px rgba(212, 175, 55, 0.4));
  }
}

.center-badge:focus {
  outline: 2px solid #00e5ff;
  outline-offset: 4px;
}

/* ==========================================
   CONNECTOR LINES
   ========================================== */
.node-line {
  position: absolute;
  width: 1px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    #00e5ff 20%,
    #00bcd4 80%,
    transparent 100%
  );
  transform-origin: top center;
  pointer-events: none;
  opacity: 0.4;
  transition: opacity 0.3s ease;
}

/* ==========================================
   OUTER NODES (BRAND CARDS)
   ========================================== */
.ecosystem-node {
  position: absolute;
  transform: translate(-50%, -50%);
  text-decoration: none;
  color: #ffffff;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  z-index: 10;
}

.ecosystem-node:active:not(.placeholder) .node-card {
  transform: translateY(-2px) scale(0.98);
  transition: transform 0.1s ease;
}

.ecosystem-node.click-ripple {
  animation: clickPulse 0.6s ease-out;
}

@keyframes clickPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 229, 255, 0.7);
  }
  50% {
    box-shadow: 0 0 0 20px rgba(0, 229, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 229, 255, 0);
  }
}

.ecosystem-node:focus {
  outline: 2px solid #00e5ff;
  outline-offset: 4px;
  border-radius: 24px;
}

.node-card {
  background: rgba(20, 20, 35, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 229, 255, 0.15);
  border-radius: 24px;
  padding: 0.875rem 1.25rem;
  min-width: 160px;
  max-width: 200px;
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
}

.ecosystem-node:hover .node-card {
  transform: translateY(-4px);
  background: rgba(25, 25, 45, 0.75);
  border-color: rgba(0, 229, 255, 0.4);
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.5),
    0 0 24px rgba(0, 229, 255, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.node-title {
  font-size: 0.9375rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  line-height: 1.3;
  color: #ffffff;
}

.node-tag {
  font-size: 0.75rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.4;
}

/* Placeholder nodes styling (coming soon - not yet available) */
.ecosystem-node.placeholder {
  cursor: not-allowed;
}

.ecosystem-node.placeholder .node-card {
  opacity: 0.7;
  border-color: rgba(255, 255, 255, 0.1);
  position: relative;
}

.ecosystem-node.placeholder .node-card::after {
  content: 'Coming Soon';
  position: absolute;
  top: -8px;
  right: -8px;
  background: rgba(0, 229, 255, 0.15);
  border: 1px solid rgba(0, 229, 255, 0.3);
  color: #00e5ff;
  font-size: 0.5625rem;
  padding: 2px 6px;
  border-radius: 8px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.ecosystem-node.placeholder:hover .node-card {
  transform: none;
  background: rgba(20, 20, 35, 0.65);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* ==========================================
   FOOTER
   ========================================== */
.footer {
  text-align: center;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 2rem;
  padding: 1rem;
}

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

/* Tablet and smaller */
@media (max-width: 768px) {
  .content {
    padding: 1.5rem 0.75rem;
  }

  .section-title {
    font-size: 1.75rem;
  }

  .section-description {
    font-size: 0.875rem;
    padding: 0 1rem;
  }

  .ecosystem-circle {
    width: min(580px, 95vw);
    height: min(580px, 95vw);
  }

  .center-badge {
    width: 150px;
    height: 150px;
  }

  .node-card {
    min-width: 135px;
    max-width: 165px;
    padding: 0.7rem 0.95rem;
  }

  .node-title {
    font-size: 0.85rem;
  }

  .node-tag {
    font-size: 0.675rem;
  }

  .ecosystem-node.placeholder .node-card::after {
    font-size: 0.5rem;
    padding: 1px 5px;
  }
}

/* Mobile */
@media (max-width: 480px) {
  .content {
    padding: 1.25rem 0.5rem;
  }

  .header {
    margin-bottom: 1rem;
  }

  .header-label {
    font-size: 0.8125rem;
  }

  .header-sublabel {
    font-size: 0.6875rem;
  }

  .intro {
    margin-bottom: 1.5rem;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .section-description {
    font-size: 0.8125rem;
    padding: 0 0.5rem;
  }

  .ecosystem-circle {
    width: min(480px, 98vw);
    height: min(480px, 98vw);
  }

  .center-badge {
    width: 120px;
    height: 120px;
  }

  .node-card {
    min-width: 110px;
    max-width: 140px;
    padding: 0.6rem 0.8rem;
    border-radius: 18px;
  }

  .node-title {
    font-size: 0.75rem;
    line-height: 1.25;
  }

  .node-tag {
    font-size: 0.6rem;
    line-height: 1.3;
  }

  .ecosystem-node.placeholder .node-card::after {
    font-size: 0.4375rem;
    padding: 1px 4px;
    top: -6px;
    right: -6px;
  }

  .footer {
    font-size: 0.75rem;
    margin-top: 1.5rem;
  }
}

/* Extra small mobile */
@media (max-width: 360px) {
  .ecosystem-circle {
    width: min(340px, 100vw);
    height: min(340px, 100vw);
  }

  .center-badge {
    width: 65px;
    height: 65px;
  }

  .node-card {
    min-width: 65px;
    max-width: 85px;
    padding: 0.3rem 0.45rem;
    border-radius: 10px;
  }

  .node-title {
    font-size: 0.55rem;
    line-height: 1.15;
  }

  .node-tag {
    font-size: 0.45rem;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .search-container {
    max-width: 280px;
  }

  .search-input {
    padding: 0.75rem 0.875rem 0.75rem 2.5rem;
    font-size: 0.875rem;
  }

  .search-icon {
    width: 16px;
    height: 16px;
    left: 0.75rem;
  }
}

/* Landscape mobile orientation */
@media (max-height: 500px) and (orientation: landscape) {
  .content {
    padding: 0.75rem 1rem;
    min-height: auto;
  }

  .header {
    margin-bottom: 0.5rem;
  }

  .intro {
    margin-bottom: 0.75rem;
  }

  .section-title {
    font-size: 1.25rem;
    margin-bottom: 0.375rem;
  }

  .section-description {
    font-size: 0.75rem;
    display: none;
  }

  .search-container {
    margin-top: 0.5rem;
  }

  .ecosystem-container {
    margin: 0.5rem 0;
  }

  .ecosystem-circle {
    width: min(280px, 50vh);
    height: min(280px, 50vh);
  }

  .center-badge {
    width: 70px;
    height: 70px;
  }

  .badge-text-large {
    font-size: 0.75rem;
  }

  .badge-text-medium {
    font-size: 0.625rem;
  }

  .badge-text-small {
    font-size: 0.375rem;
  }

  .node-card {
    min-width: 85px;
    max-width: 110px;
    padding: 0.4rem 0.5rem;
  }

  .node-title {
    font-size: 0.625rem;
  }

  .node-tag {
    font-size: 0.5rem;
  }

  .footer {
    margin-top: 0.5rem;
    padding: 0.5rem;
  }
}

/* ==========================================
   ACCESSIBILITY IMPROVEMENTS
   ========================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .node-card {
    border-width: 2px;
    border-color: rgba(0, 229, 255, 0.5);
  }

  .center-badge {
    border: 2px solid rgba(255, 255, 255, 0.3);
  }
}

/* ==========================================
   UTILITY CLASSES
   ========================================== */
.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;
}

/* ==========================================
   MODAL
   ========================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 20, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-content {
  position: relative;
  background: rgba(20, 20, 35, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: 24px;
  padding: 2.5rem 2rem;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 
    0 24px 48px rgba(0, 0, 0, 0.8),
    0 0 64px rgba(0, 229, 255, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: rgba(255, 255, 255, 0.8);
  font-size: 2rem;
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
  line-height: 1;
  padding: 0;
  z-index: 110;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.modal-close:hover,
.modal-close:active {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

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

.modal-category {
  display: inline-block;
  background: rgba(0, 229, 255, 0.15);
  border: 1px solid rgba(0, 229, 255, 0.3);
  color: #00e5ff;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.375rem 0.875rem;
  border-radius: 16px;
  margin-bottom: 1rem;
}

.modal-title {
  font-size: 1.875rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.modal-tag {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 1.5rem;
  font-weight: 500;
}

.modal-description {
  font-size: 1rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 2rem;
}

.modal-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.modal-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  background: linear-gradient(135deg, #dc2626, #1e3a8a);
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: 24px;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.3),
    0 0 24px rgba(220, 38, 38, 0.2);
}

.modal-button:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 6px 24px rgba(0, 0, 0, 0.4),
    0 0 32px rgba(220, 38, 38, 0.4);
  border-color: rgba(0, 229, 255, 0.5);
}

.modal-button svg {
  width: 16px;
  height: 16px;
}

/* ==========================================
   MODAL RESPONSIVE STYLES
   ========================================== */
@media (max-width: 480px) {
  .modal-content {
    padding: 2rem 1.5rem;
    width: 95%;
    border-radius: 20px;
  }

  .modal-close {
    top: 0.75rem;
    right: 0.75rem;
    width: 36px;
    height: 36px;
    font-size: 1.75rem;
  }

  .modal-category {
    font-size: 0.6875rem;
    padding: 0.3rem 0.75rem;
  }

  .modal-title {
    font-size: 1.5rem;
    padding-right: 2rem;
  }

  .modal-tag {
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
  }

  .modal-description {
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
  }

  .modal-button {
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
    width: 100%;
    justify-content: center;
  }

  .modal-actions {
    flex-direction: column;
  }
}

@media (max-width: 360px) {
  .modal-content {
    padding: 1.5rem 1.25rem;
  }

  .modal-title {
    font-size: 1.25rem;
  }

  .modal-tag {
    font-size: 0.8125rem;
  }

  .modal-description {
    font-size: 0.8125rem;
  }

  .modal-button {
    padding: 0.6875rem 1.25rem;
    font-size: 0.875rem;
  }
}

/* ==========================================
   TOUCH-FRIENDLY IMPROVEMENTS
   ========================================== */
@media (pointer: coarse) {
  /* Larger touch targets for mobile */
  .ecosystem-node .node-card {
    min-height: 44px;
  }

  .center-badge {
    min-width: 100px;
    min-height: 100px;
  }

  .search-input {
    min-height: 48px;
    font-size: 16px; /* Prevents iOS zoom on focus */
  }

  .modal-close {
    min-width: 44px;
    min-height: 44px;
  }

  .modal-button {
    min-height: 48px;
  }
}

/* ==========================================
   SAFE AREA SUPPORT (NOTCHED DEVICES)
   ========================================== */
@supports (padding: max(0px)) {
  .content {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }

  .modal-content {
    margin-left: max(0.5rem, env(safe-area-inset-left));
    margin-right: max(0.5rem, env(safe-area-inset-right));
    margin-bottom: max(0.5rem, env(safe-area-inset-bottom));
  }
}

/* ==========================================
   DARK MODE SYSTEM PREFERENCE
   ========================================== */
@media (prefers-color-scheme: light) {
  /* The site is designed for dark mode, but provide slight adjustments 
     if user prefers light - we keep dark for design consistency */
  body {
    background: #0a0a0f;
  }
}
