/* ========================
   Technology Tree Structure
   Vertical Linear Layout
   ======================== */

.technology-page-section .section-header {
  margin-bottom: var(--space-22);
}

/* Tree Wrapper */
.technology-tree-wrapper {
  position: relative;
  width: 100%;
  padding: var(--space-12) var(--space-6);
}

/* SVG Connectors */
.technology-connectors-svg {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.tree-connector-line {
  stroke: var(--bs-primary-25);
  stroke-width: 2;
  fill: none;
}

/* Tree Container */
.technology-tree-container {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-20);
  margin: 0 auto;
}
.technology-tree-container::after {
  content: "";
  position: absolute;
  top: calc(14.75rem / 2);
  left: calc(50% - 0.0625rem);
  width: 0.125rem;
  height: calc(100% - 14.75rem);
  background-color: var(--bs-primary-25);
  z-index: -1;
}

/* Tree Node */
.technology-tree-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  position: relative;
}

/* Root Node Styling */
.technology-tree-node[data-is-root="true"] {
  margin-bottom: var(--space-8);
}

/* Node Circle */
.tree-node-circle {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14.75rem;
  height: 14.75rem;
  border-radius: 50%;
  flex-shrink: 0;
  margin-bottom: var(--space-20);
}

.tree-node-icon {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 50%;
}

.tree-node-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.tree-expand-btn {
  position: absolute;
  width: 2rem;
  height: 2rem;
  background: var(--bs-success);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  top: 1rem;
  right: 1rem;
  z-index: 12;
  transition: all 0.3s ease;
  padding: 0;
  color: var(--bs-primary-800);
}

.tree-expand-btn:hover {
  background: var(--bs-success-100);
}

.tree-expand-btn:focus {
  outline: 0.125rem solid var(--bs-primary-25);
  outline-offset: 0.125rem;
}

/* Content Card */
.tree-content-card {
  background: var(--bs-primary-900);
  border-radius: var(--radius-2xl);
  padding: 1.5rem 1.5rem;
  width: 100%;
  max-width: 34.375rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: relative;
  flex-grow: 1;
}
.tree-node-heading-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-7);
  text-align: center;
}
.tree-node-title {
  margin: 0;
  color: var(--bs-primary-50);
  font-size: var(--font-size-tree-level1-fluid);
  font-weight: var(--font-weight-medium);
  line-height: 1;
  text-align: center;
}

.tree-node-tagline {
  font-size: var(--font-size-16);
  font-weight: var(--font-weight-medium);
  font-family: var(--font-family-mono);
  text-transform: uppercase;
  color: var(--bs-success);
  line-height: 1.5;
  margin: 0;
  text-align: center;
}

.tree-node-description {
  color: var(--bs-primary-25);
  font-size: var(--font-size-16);
  line-height: 1.5;
  margin: 0;
}

/* Children Container */
.tree-children-container {
  display: flex;
  flex-direction: column;

  gap: var(--space-20);
  width: 100%;
  margin-top: var(--space-16);
  position: relative;
}

/* Level 1 (children of root) - Side by side layout */
.technology-tree-node[data-level="1"] {
  width: calc(50% - var(--space-6));
}

.technology-tree-node[data-level="1"] .tree-content-card {
  max-width: 30.125rem;
}

.technology-tree-node[data-level="1"] .tree-node-title {
  width: 87%;
  line-height: 1.25;
}

.tree-children-container[data-parent-id] {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-12);
}

/* Modal Content (Hidden) */
.technology-modal-content {
  display: none;
}

/* Technology Modal */
.technology-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
}

.technology-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  cursor: pointer;
}

.technology-modal-dialog {
  position: relative;
  z-index: 1001;
  background: var(--bs-primary-900);
  border-radius: var(--radius-2xl);
  max-width: 56.25rem;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 0;
  box-shadow: 0 1.25rem 3.75rem rgba(0, 0, 0, 0.5);
}

.technology-modal-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bs-success);
  border: none;
  border-radius: var(--radius-full);
  color: var(--bs-primary-800);
  font-size: var(--font-size-2xl);
  cursor: pointer;
  z-index: 1002;
  transition: all 0.3s ease;
}

.technology-modal-close:hover {
  background: var(--bs-success-100);
}

.technology-modal-close:focus {
  outline: 0.125rem solid var(--bs-primary-25);
  outline-offset: 0.125rem;
}

/* Modal Banner */
.technology-modal-banner {
  width: 100%;
  height: auto;
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  overflow: hidden;
  background: #000;
  position: relative;
}

.technology-modal-banner.image-banner {
  min-height: auto;
}

.technology-modal-banner.image-banner img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.technology-modal-banner.video-banner {
  width: 100%;
  height: 0;
  padding-block-end: 56.25%;
  position: relative;
}

.technology-modal-banner.video-banner iframe {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  border: none;
  background-color: #000;
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
}

/* Modal Body */
.technology-modal-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-9);
  padding: var(--space-20);
}
.technology-modal-heading-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-7);
}
.technology-modal-title {
  margin: 0;
  color: var(--bs-primary-25);
  font-size: var(--font-size-50);
  font-weight: var(--font-weight-normal);
  line-height: 1;
}

.technology-modal-tagline {
  font-size: var(--font-size-16);
  font-weight: var(--font-weight-normal);
  font-family: var(--font-family-mono);
  text-transform: uppercase;
  color: var(--bs-success);
  line-height: 1;
}

.technology-modal-description {
  color: var(--bs-primary-25);
  font-size: var(--font-size-16);
  line-height: var(--line-height-body);
  display: flex;
  flex-direction: column;
  gap: var(--space-13);
}

.technology-modal-description p {
  color: var(--bs-primary-25);
  font-size: var(--font-size-16);
  line-height: var(--line-height-body);
  margin-bottom: 0;
}

.technology-modal-description ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.technology-modal-description ul li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-5);
  color: var(--bs-primary-25);
  font-size: var(--font-size-16);
  line-height: var(--line-height-body);
}

.technology-modal-description ul li::before {
  content: "";
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='10' cy='10' r='9' stroke='currentColor' stroke-width='1.5'/%3E%3Cpath d='M6 10L9 13L14 7' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='10' cy='10' r='9' stroke='currentColor' stroke-width='1.5'/%3E%3Cpath d='M6 10L9 13L14 7' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  background-color: var(--bs-primary-25);
  margin-top: var(--space-1);
}

/* Modal Gallery */
.technology-modal-gallery {
  display: flex;
  flex-direction: row;
  gap: var(--space-2);
  margin-top: 0;
}

.gallery-image-item {
  width: 16.25rem;
  height: 16.25rem;
  flex-shrink: 0;
  border-radius: 0;
  overflow: hidden;
  background: var(--overlay-dark-primary-04);
}

.gallery-image-item:first-child {
  border-radius: var(--radius-2xl) 0 0 var(--radius-2xl);
}

.gallery-image-item:last-child {
  border-radius: 0 var(--radius-2xl) var(--radius-2xl) 0;
}

.gallery-image-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ========================
   RESPONSIVE DESIGN
   ======================== */

/* Mobile (up to 576px) */
@media (max-width: 575px) {
  .technology-tree-wrapper {
    padding: var(--space-6) var(--space-3);
  }

  .tree-node-circle {
    width: 7.5rem;
    height: 7.5rem;
    margin-bottom: var(--space-12);
  }

  .tree-content-card {
    padding: 1rem 1.25rem;
    gap: 0.75rem;
    max-width: 100%;
  }

  .tree-node-tagline {
    font-size: 0.875rem;
  }

  .tree-node-description {
    font-size: 0.875rem;
  }

  .tree-expand-btn {
    width: 1.75rem;
    height: 1.75rem;
    top: 0.75rem;
    right: 0.75rem;
  }

  .tree-expand-btn::before {
    font-size: 1rem;
  }

  .technology-tree-container {
    gap: var(--space-12);
  }

  .tree-children-container {
    gap: var(--space-12);
    margin-top: var(--space-12);
  }

  .technology-tree-node[data-level="1"] {
    width: 100%;
  }

  .technology-tree-node[data-level="1"] .tree-content-card {
    max-width: 100%;
  }

  .technology-tree-node[data-level="1"] .tree-node-title {
    width: 100%;
  }

  .tree-children-container[data-parent-id] {
    flex-direction: column;
    gap: var(--space-12);
  }

  .technology-modal-gallery {
    flex-direction: column;
  }
  .gallery-image-item {
    width: 100%;
  }
  .gallery-image-item:first-child {
    border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  }
  .gallery-image-item:last-child {
    border-radius: 0 0 var(--radius-2xl) var(--radius-2xl);
  }
}

/* Tablet Portrait (576px - 767px) */
@media (min-width: 576px) and (max-width: 767px) {
  .technology-tree-wrapper {
    padding: var(--space-8) var(--space-4);
  }

  .tree-node-circle {
    width: 10rem;
    height: 10rem;
    margin-bottom: var(--space-16);
  }

  .tree-content-card {
    padding: 1.25rem 1.5rem;
    gap: 1rem;
    max-width: 100%;
  }

  .tree-node-tagline {
    font-size: 0.875rem;
  }

  .tree-node-description {
    font-size: 0.875rem;
  }

  .tree-expand-btn {
    width: 1.875rem;
    height: 1.875rem;
    top: 0.875rem;
    right: 0.875rem;
  }

  .tree-expand-btn::before {
    font-size: 1.125rem;
  }

  .technology-tree-container {
    gap: var(--space-16);
  }

  .tree-children-container {
    gap: var(--space-16);
    margin-top: var(--space-14);
  }

  .technology-tree-node[data-level="1"] {
    width: 100%;
  }

  .technology-tree-node[data-level="1"] .tree-content-card {
    max-width: 100%;
  }

  .technology-tree-node[data-level="1"] .tree-node-title {
    width: 100%;
  }

  .tree-children-container[data-parent-id] {
    flex-direction: column;
    gap: var(--space-14);
  }

  .technology-modal-gallery {
    flex-direction: column;
  }
  .gallery-image-item {
    width: 100%;
  }
  .gallery-image-item:first-child {
    border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  }
  .gallery-image-item:last-child {
    border-radius: 0 0 var(--radius-2xl) var(--radius-2xl);
  }
}

/* Tablet Landscape (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
  .technology-tree-wrapper {
    padding: var(--space-10) var(--space-5);
  }

  .tree-node-circle {
    width: 12.5rem;
    height: 12.5rem;
    margin-bottom: var(--space-18);
  }

  .tree-content-card {
    padding: 1.375rem 1.75rem;
    gap: 1.125rem;
    max-width: 30rem;
  }

  .tree-node-tagline {
    font-size: 0.9375rem;
  }

  .tree-node-description {
    font-size: 0.9375rem;
  }

  .tree-expand-btn {
    width: 1.9375rem;
    height: 1.9375rem;
    top: 0.9375rem;
    right: 0.9375rem;
  }

  .tree-expand-btn::before {
    font-size: 1.1875rem;
  }

  .technology-tree-container {
    gap: var(--space-18);
  }

  .tree-children-container {
    gap: var(--space-16);
    margin-top: var(--space-16);
  }

  .technology-tree-node[data-level="1"] {
    width: calc(50% - var(--space-8));
  }

  .technology-tree-node[data-level="1"] .tree-content-card {
    max-width: 22.5rem;
  }

  .technology-tree-node[data-level="1"] .tree-node-title {
    width: 90%;
  }

  .tree-children-container[data-parent-id] {
    flex-direction: row;
    gap: var(--space-14);
  }
}

/* Desktop (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
  .tree-node-circle {
    width: 13.75rem;
    height: 13.75rem;
  }

  .tree-content-card {
    max-width: 32.5rem;
  }

  .technology-tree-node[data-level="1"] .tree-content-card {
    max-width: 23.75rem;
  }

  .technology-modal-banner {
    min-height: auto;
  }
}

/* Large Desktop (1200px - 1399px) */
@media (min-width: 1200px) and (max-width: 1399px) {
  .tree-node-circle {
    width: 14.375rem;
    height: 14.375rem;
  }

  .tree-content-card {
    max-width: 33.75rem;
  }
}

/* Extra Large Desktop (1400px+) */
@media (min-width: 1400px) {
  .tree-node-circle {
    width: 15rem;
    height: 15rem;
  }

  .tree-content-card {
    max-width: 35rem;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  .tree-expand-btn,
  .technology-modal-close {
    transition: none;
  }

  .tree-expand-btn:hover {
    transform: none;
  }
}
