/**
 * ============================================================================
 * 3D SERVICE GRAPH STYLES
 * ============================================================================
 * Styles for the animated sphere graph visualization
 */

/* ============================================================================
   GRAPH CONTAINER & SVG
   ============================================================================ */

.services__graph {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow: visible;
}

.service-graph {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  display: block;
  overflow: visible;
}

/* ============================================================================
   EDGES (Connection Lines)
   ============================================================================ */

.service-graph__edge {
  fill: none;
  transition: stroke-opacity 0.1s ease-out;
  will-change: stroke-opacity;
}

.service-graph__edge--relationship {
  stroke: #ffffff;
  stroke-width: 1px;
  stroke-dasharray: 4, 4;
  stroke-opacity: 0.15;
}

/* ============================================================================
   NODES (Service Icons)
   ============================================================================ */

/* Invisible click target around each node */
.service-graph__node-hitarea {
  fill: transparent;
  stroke: none;
}

/* Node container with GPU-accelerated transforms */
.service-graph__node--category {
  will-change: transform, opacity;
  transition: opacity 0.1s ease-out;
}

/* Hover effect - enlarge icon */
.service-graph__node--category:hover .service-graph__node-icon {
  font-size: 3rem;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

/* Icon emoji styling */
.service-graph__node-icon {
  pointer-events: none;
  user-select: none;
  transition: font-size 0.15s ease, filter 0.15s ease;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* ============================================================================
   LABELS (Service Names)
   ============================================================================ */

.service-graph__label {
  fill: var(--text-dark);
  font-size: 0.75rem;
  font-weight: 500;
  pointer-events: none;
  user-select: none;
  will-change: transform, opacity;
  transition: opacity 0.1s ease-out;
}

.service-graph__label--category {
  font-size: 0.875rem;
  font-weight: 600;
}

/* ============================================================================
   DETAIL PANEL (Click-to-View Service Info)
   ============================================================================ */

.service-graph__panel {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  box-shadow: var(--shadow-xl);
  transition: opacity 0.3s ease;
  overflow-y: auto;
}

.service-graph__panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  background-color: var(--bg-card);
  z-index: 1;
}

.service-graph__panel-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.service-graph__panel-icon {
  font-size: 1.5rem;
}

.service-graph__panel-title h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--text-dark);
  line-height: 1.3;
}

.service-graph__panel-close {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.25rem;
  transition: all 0.2s ease;
}

.service-graph__panel-close:hover {
  background-color: var(--bg-light);
  color: var(--text-dark);
}

.service-graph__panel-description {
  padding: 1rem;
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-light);
  line-height: 1.5;
  border-bottom: 1px solid var(--border-color);
}

.service-graph__panel-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.service-graph__panel-item {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.service-graph__panel-item:last-child {
  border-bottom: none;
}

.service-graph__panel-item-title {
  display: block;
  color: var(--text-dark);
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.service-graph__panel-item-desc {
  margin: 0;
  color: var(--text-light);
  font-size: 0.8rem;
  line-height: 1.4;
}

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

/* Desktop: Height-bounded square */
@media (min-width: 769px) {
  .services {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .services__graph {
    height: calc(100vh - 100px); /* Account for hero */
    width: auto;
    aspect-ratio: 1;
    max-width: calc(100vw - 400px); /* Leave room for panel */
    margin: 0 auto;
  }
  
  .service-graph__panel {
    position: fixed;
    top: 50%;
    right: 2rem;
    transform: translateY(-50%);
    width: 320px;
    max-height: 80vh;
    z-index: 1001;
  }
}

/* Tablet: Slightly smaller panel */
@media (min-width: 769px) and (max-width: 1200px) {
  .services__graph {
    max-width: calc(100vw - 320px);
  }
  
  .service-graph__panel {
    position: fixed;
    width: 280px;
    right: 1rem;
  }
}

/* Mobile: Width-bounded square, panel below */
@media (max-width: 768px) {
  /* Allow vertical scrolling */
  .services {
    display: block;
    width: 100%;
    min-height: auto;
  }
  
  /* Stack graph and panel vertically */
  .services__graph {
    width: 100%;
    height: auto;
    min-height: auto;
    padding: 0 1rem;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  
  /* SVG maintains square aspect, doesn't shrink */
  .service-graph {
    width: calc(100vw - 2rem);
    height: calc(100vw - 2rem);
    flex-shrink: 0;
  }
  
  /* Panel appears below graph in document flow */
  .service-graph__panel {
    position: static !important;
    transform: none !important;
    width: 100vw !important;
    max-width: 100vw !important;
    margin: 0 -1rem !important;
    padding: 1.5rem 1rem !important;
    max-height: none !important;
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
    border-top: 1px solid var(--border-color) !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    bottom: auto !important;
    z-index: auto !important;
  }
}
