/* ========================
   Introduction Bio Grid (New Visual Layout)
   ======================== */

.intro-bio-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 30px;
  width: 100%;
  box-sizing: border-box;
}

.intro-bio-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  overflow: hidden;
  height: 320px;
  /* Fixed height for consistency */
}

.intro-bio-card:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.25);
  border-color: rgba(0, 255, 255, 0.4);
}

.intro-bio-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #00ffff, #ff00ff);
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 2;
}

.intro-bio-card:hover::before {
  opacity: 1;
}

.bio-header {
  display: flex;
  align-items: center;
  gap: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
  /* Prevent header from shrinking */
}

.bio-icon-wrapper {
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.bio-title {
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.bio-title span {
  display: block;
  font-size: 14px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 2px;
}

.bio-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  /* Take up remaining space */
  overflow-y: auto;
  /* Enable vertical scrolling */
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  /* Smooth scrolling for iOS */
  padding-right: 5px;
  /* Space for scrollbar */
}

.bio-row {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 16px;
}

.bio-row-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
  opacity: 0.8;
}

.tag-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bio-tag {
  background: rgba(0, 255, 255, 0.1);
  color: #e0ffff;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 14px;
  border: 1px solid rgba(0, 255, 255, 0.2);
  transition: all 0.2s;
  user-select: none;
  cursor: default;
}

.bio-tag:hover {
  background: rgba(0, 255, 255, 0.25);
  border-color: rgba(0, 255, 255, 0.5);
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0, 255, 255, 0.2);
}

/* Color variations for tags based on category */
.personality-tag {
  background: rgba(255, 105, 180, 0.1);
  color: #ffe0f0;
  border-color: rgba(255, 105, 180, 0.2);
}

.personality-tag:hover {
  background: rgba(255, 105, 180, 0.25);
  border-color: rgba(255, 105, 180, 0.5);
  box-shadow: 0 2px 8px rgba(255, 105, 180, 0.2);
}

.hobby-tag {
  background: rgba(255, 215, 0, 0.1);
  color: #fffacd;
  border-color: rgba(255, 215, 0, 0.2);
}

.hobby-tag:hover {
  background: rgba(255, 215, 0, 0.25);
  border-color: rgba(255, 215, 0, 0.5);
  box-shadow: 0 2px 8px rgba(255, 215, 0, 0.2);
}

/* ========================
   Responsive Design
   ======================== */

@media screen and (max-width: 480px) {
  .intro-bio-grid {
    grid-template-columns: 1fr;
  }

  .bio-row,
  .bio-row div,
  .bio-row span {
    font-size: 18px !important;
  }

  .bio-tag {
    font-size: 16px;
    /* Slightly smaller for tags to fit better, but still much larger than before */
    padding: 8px 16px;
  }

  .bio-title {
    font-size: 22px;
  }

  .bio-title span {
    font-size: 16px;
  }

  .bio-content div[style*="font-size: 14px"] {
    font-size: 16px !important;
  }

  #skills-card {
    height: auto !important;
  }

  #skills-card .bio-content {
    overflow: visible !important;
  }

  .icons-container {
    grid-template-columns: repeat(4, 72px);
    gap: 8px 20px;
    padding: 10px 12px 5px 12px;
  }

  .ios-icon {
    width: 70px;
    height: 70px;
  }

  .icon-label {
    font-size: 12px;
    width: 72px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .icon-item {
    min-height: 95px;
    width: 72px;
  }

  body.is-admin .icon-item {
    min-height: auto;
  }

  .section {
    padding: 15px 5px !important;
  }

  .dock {
    gap: 3px;
    padding: 8px 5px;
  }

  .dock-item {
    min-width: 44px;
    padding: 2px;
  }

  .dock-icon {
    font-size: 36px;
  }

  .dock-label {
    font-size: 9px;
  }

  .spec-value {
    text-align: right;
    flex: 1;
    width: 100%;
    margin-top: 5px;
  }

  /* Keep gallery as 4 columns even on mobile */
  .gallery {
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
  }

  .gallery .icon-label {
    font-size: 10px; /* Smaller font on mobile */
  }

  .gallery img {
    border-radius: 8px;
  }
}

/* ========================
   Walking Robot on Dock (Mobile Only)
   ======================== */
.dock-robot-wrapper {
  position: absolute;
  bottom: 85px;
  /* Sits on top of the dock */
  left: 0;
  width: 50px !important;
  height: 50px !important;
  max-width: 50px !important;
  max-height: 50px !important;
  z-index: 9990;
  /* Behind tooltip/modals but above dock items if needed, or non-interfering */
  pointer-events: none;
  display: none;
  /* Hidden on desktop */
  opacity: 0.9;
  filter: drop-shadow(0 4px 5px rgba(0, 0, 0, 0.3));
}

.dock-robot {
  width: 100% !important;
  height: 100% !important;
  max-width: 50px !important;
  max-height: 50px !important;
  object-fit: contain !important;
}

/* Walking Animation on the container */
@keyframes dockWalkPath {
  0% {
    left: 0%;
  }

  45% {
    left: calc(100% - 50px);
  }

  50% {
    left: calc(100% - 50px);
  }

  95% {
    left: 0%;
  }

  100% {
    left: 0%;
  }
}

@keyframes dockWalkFlip {
  0%, 45% {
    transform: scaleX(1);
  }
  50%, 95% {
    transform: scaleX(-1);
  }
  100% {
    transform: scaleX(1);
  }
}

@media screen and (max-width: 1024px) {
  .dock-robot-wrapper {
    display: block;
    bottom: 90px;
    animation: dockWalkPath 40s linear infinite;
  }
  
  .dock-robot {
    animation: dockWalkFlip 40s linear infinite;
  }
}
@media screen and (max-width: 480px) {
  .ios-icon-path-active {
    animation: dockWalkPath 24s linear infinite;
  }
}

/* Admin Counter Visibility Control (Icons) */
.click-count {
  display: none !important;
}

body.is-admin .click-count {
  display: inline-block !important;
}

/* Label Marquee Styles */
.icon-label.scrolling-label {
  text-align: left !important;
  text-overflow: clip !important;
  padding-left: 5px;
  padding-right: 5px;
  display: block !important;
  white-space: nowrap !important;
  overflow: hidden !important;
}

.icon-label.scrolling-label .marquee-inner {
  display: inline-block;
  animation: label-marquee var(--duration, 6s) ease-in-out infinite alternate;
}

@keyframes label-marquee {
  0% {
    transform: translateX(0);
  }
  10% {
    transform: translateX(0);
  }
  90% {
    transform: translateX(var(--scroll-dist));
  }
  100% {
    transform: translateX(var(--scroll-dist));
  }
}
