/* ==========================================
   SX-HUB STYLES (V3 - BIGGER & CLICKABLE)
========================================== */
.sx-hub-section {
  --sx-hub-bg: transparent;
  --sx-hub-blue: #00aaff;
  --sx-hub-dark: #121212;
  --sx-hub-border: #333333;
  --sx-hub-text: #e0e0e0;
  --sx-radius: 5%; 
  
  padding: 60px 20px;
  background: var(--sx-hub-bg);
  font-family: 'Helvetica Neue', Arial, sans-serif;
  color: var(--sx-hub-text);
  overflow: hidden;
}

.sx-hub-header { text-align: center; max-width: 700px; margin: 0 auto 50px auto; }
.sx-hub-header h2 { font-size: 2.2rem; color: #626262; margin-bottom: 15px; font-weight: 300; }
.sx-hub-header p { color: #000; line-height: 1.6; }

/* The Grid Layout - Expanded to 1100px to fit larger center */
.sx-hub-container {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-rows: 1fr auto 1fr;
  gap: 30px;
  max-width: 1100px; 
  margin: 0 auto;
  align-items: center;
  justify-items: center;
  position: relative;
}

.node-tl { grid-column: 1 / 2; grid-row: 1 / 2; justify-self: end; align-self: end; }
.node-tr { grid-column: 3 / 4; grid-row: 1 / 2; justify-self: start; align-self: end; }
.node-bl { grid-column: 1 / 2; grid-row: 3 / 4; justify-self: end; align-self: start; }
.node-br { grid-column: 3 / 4; grid-row: 3 / 4; justify-self: start; align-self: start; }
.sx-hub-center { grid-column: 2 / 3; grid-row: 2 / 3; }

/* The Nodes */
.sx-hub-node {
  display: block;
  text-decoration: none; 
  background: rgba(20, 20, 20, 0.8);
  border: 1px solid var(--sx-hub-border);
  border-radius: var(--sx-radius); 
  padding: 25px;
  width: 280px;
  backdrop-filter: blur(10px);
  cursor: pointer;
  /* Smooth transition for the hover state */
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  z-index: 2;
}

/* The Tiny Hover Effect: Slight lift, soft glow, and blue border */
.sx-hub-node:hover {
  border-color: var(--sx-hub-blue);
  box-shadow: 0 8px 25px rgba(0, 170, 255, 0.12);
  /* A very subtle pop towards the user */
  transform: translateY(-3px) scale(1.02); 
}

.sx-node-icon { 
  font-size: 1.8rem; 
  display: block; 
  margin-bottom: 10px; 
}

.sx-hub-node h4 { 
  color: #fff !important; 
  font-size: 1.2rem; 
  margin: 0 0 10px 0; 
}

.sx-hub-node p { 
  color: #aaa; 
  font-size: 0.9rem; 
  margin: 0; 
  line-height: 1.5; 
}

/* (Make sure you deleted the old @keyframes float and the .node-tr / .node-bl animation-delays!) */

/* The Central Hub - INCREASED SIZE & MADE LINK */
.sx-hub-center {
  position: relative;
  display: block;
  text-decoration: none;
  width: 320px;  /* Increased from 250px */
  height: 320px; /* Increased from 250px */
  z-index: 10;
  border-radius: var(--sx-radius);
}

.sx-hub-ring {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: var(--sx-radius);
  background: rgba(0, 170, 255, 0.05);
  box-shadow: 0 0 20px rgba(0, 170, 255, 0);
  transition: all 0.5s ease;
  z-index: 1;
}

.sx-hub-image-wrapper {
  position: absolute;
  top: 15px; left: 15px; right: 15px; bottom: 15px;
  background: #1a1a1a;
  border-radius: var(--sx-radius);
  border: 1px solid #444;
  overflow: hidden;
  z-index: 2;
  transition: border-color 0.4s ease;
}

.sx-center-default {
  width: 100%; height: 100%; object-fit: cover;
  transition: opacity 0.4s ease, transform 0.4s ease;
  position: absolute; top: 0; left: 0; z-index: 3;
}

/* --- NEW: "See Products" Overlay --- */
.sx-center-products-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  padding: 25px;
  background: rgba(18, 18, 18, 0.95); /* Dark background */
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; color: #fff;
  opacity: 0; pointer-events: none;
  transition: opacity 0.4s ease;
  z-index: 4; /* Below the app content, above the GIF */
}

.sx-center-products-overlay h5 { font-size: 1.3rem; margin: 0 0 5px 0; color: #fff;}
.sx-center-products-overlay p { font-size: 0.9rem; margin: 0; opacity: 0.9;}

/* The Application Text Descriptions */
.sx-center-content {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0; padding: 25px;
  background: rgba(18, 18, 18, 0.95);
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; opacity: 0; pointer-events: none; transition: opacity 0.4s ease;
  z-index: 5; /* Highest z-index to sit on top of everything */
}
.sx-center-content h5 { color: var(--sx-hub-blue); font-size: 1.2rem; margin: 0 0 10px 0; }
.sx-center-content p { color: #ddd; font-size: 0.9rem; line-height: 1.6; margin: 0; }

/* --- INTERACTIVE STATES --- */

/* 1. When Hovering Directly over the Center Hub (AND NOT over a node) */
.sx-hub-center:hover:not([data-active]) .sx-center-products-overlay { opacity: 1; }
.sx-hub-center:hover:not([data-active]) .sx-center-default { transform: scale(1.1); opacity: 0.2; }
.sx-hub-center:hover:not([data-active]) .sx-hub-image-wrapper { border-color: var(--sx-hub-blue); }
.sx-hub-center:hover:not([data-active]) .sx-hub-ring {
  background: rgba(0, 170, 255, 0.2);
  box-shadow: 0 0 40px rgba(0, 170, 255, 0.6);
  transform: scale(1.05);
}

/* 2. When Hovering over an Application Node (Triggered by JS) */
.sx-hub-center[data-active] .sx-hub-ring {
  background: rgba(0, 170, 255, 0.1); box-shadow: 0 0 40px rgba(0, 170, 255, 0.5); transform: scale(1.05);
}
.sx-hub-center[data-active] .sx-hub-image-wrapper { border-color: var(--sx-hub-blue); }
.sx-hub-center[data-active] .sx-center-default { opacity: 0; }

.sx-hub-center[data-active="1"] #center-content-1,
.sx-hub-center[data-active="2"] #center-content-2,
.sx-hub-center[data-active="3"] #center-content-3,
.sx-hub-center[data-active="4"] #center-content-4 { opacity: 1; }

/* Mobile Responsiveness */
/* ==========================================
   RESPONSIVE LAYOUT LOGIC
========================================== */

/* 1. TABLET LAYOUT (1020px down to 768px)
   Hub at the top, applications in a 2-column grid */
@media (max-width: 1020px) {
  .sx-hub-container {
    grid-template-columns: 1fr 1fr; /* Forces exactly 2 equal columns */
    grid-template-rows: auto auto auto;
    gap: 25px;
    max-width: 800px; /* Narrows container slightly for better tablet reading */
  }
  
  /* Force the Central Hub to the top and span both columns */
  .sx-hub-center {
    grid-column: 1 / -1; 
    grid-row: 1 / 2;
    margin-bottom: 30px; 
  }

  /* Reset the desktop corner positioning so cards align perfectly in the center of their columns */
  .node-tl, .node-tr, .node-bl, .node-br {
    grid-column: auto;
    grid-row: auto;
    justify-self: center;
    align-self: stretch; /* Makes sure cards in the same row are the same height */
  }

  /* Adjust card width to look balanced on iPads/Tablets */
  .sx-hub-node {
    width: 100%;
    max-width: 340px; 
  }
}

/* 2. MOBILE PHONE LAYOUT (767px and below)
   Hub at the top, applications in a 1-column stack */
@media (max-width: 767px) {
  .sx-hub-container {
    grid-template-columns: 1fr; /* Forces a single column */
    gap: 20px;
  }
  
  .sx-hub-center {
    width: 100%;
    max-width: 320px; /* Prevents the GIF from overflowing small screens */
    margin-bottom: 20px;
  }

  /* Let the cards expand nicely to fill the phone screen */
  .sx-hub-node {
    max-width: 100%; 
  }
}