/* Magnus Archives GM Tool - Tab Navigation */

.tab-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  justify-content: center;
  gap: 0;
  margin-bottom: 30px;
  padding: 0;
  background: linear-gradient(135deg, #1a1a1a 0%, #0d1a0d 100%);
  border: 2px solid #317e30;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.tab-button {
  background: linear-gradient(135deg, #2a2a2a 0%, #1a2a1a 100%);
  color: #888;
  border: none;
  border-right: 1px solid #444;
  padding: 14px 10px;
  font-family: "libre baskerville", serif;
  font-size: 0.75em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 0;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Remove right border from last button in each row */
.tab-button:nth-child(4n) {
  border-right: none;
}

/* Add bottom border to first row */
.tab-button:nth-child(-n + 4) {
  border-bottom: 1px solid #444;
}

.tab-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(49, 126, 48, 0.3),
    transparent
  );
  transition: left 0.5s ease;
}

.tab-button:hover::before {
  left: 100%;
}

.tab-button:hover {
  color: #4caf50;
  background: linear-gradient(135deg, #2a3a2a 0%, #1a2a1a 100%);
  z-index: 1;
}

.tab-button.active {
  background: linear-gradient(135deg, #317e30 0%, #2a6528 100%);
  color: #fff;
  box-shadow: inset 0 0 10px rgba(76, 175, 80, 0.3);
  z-index: 2;
}

.tab-button.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 3px;
  background: #4caf50;
  box-shadow: 0 0 10px #4caf50;
}

/* Tab Content */
.tab-content {
  display: none;
  animation: fadeIn 0.4s ease-in;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Avatar Tab Special Styling */
.tab-button[data-tab="avatar"] {
  background: linear-gradient(135deg, #2a1a1a 0%, #1a0d0d 100%);
  border-right: 1px solid #661111;
  color: #aa4444;
}

.tab-button[data-tab="avatar"]::before {
  background: linear-gradient(
    90deg,
    transparent,
    rgba(170, 68, 68, 0.3),
    transparent
  );
}

.tab-button[data-tab="avatar"]:hover {
  color: #ff4444;
  border-color: #aa3333;
  background: linear-gradient(135deg, #3a1a1a 0%, #2a0d0d 100%);
  box-shadow: 0 4px 12px rgba(170, 68, 68, 0.3);
}

.tab-button[data-tab="avatar"].active {
  background: linear-gradient(135deg, #7e3030 0%, #652828 100%);
  color: #fff;
  border-color: #ff4444;
  box-shadow: 0 0 20px rgba(255, 68, 68, 0.6),
    inset 0 0 10px rgba(255, 68, 68, 0.3);
  text-shadow: 0 0 10px rgba(255, 68, 68, 0.8);
  animation: avatarPulse 3s ease-in-out infinite;
}

.tab-button[data-tab="avatar"].active::after {
  background: #ff4444;
  box-shadow: 0 0 10px #ff4444, 0 0 20px rgba(255, 68, 68, 0.5);
}

@keyframes avatarPulse {
  0%,
  100% {
    box-shadow: 0 0 20px rgba(255, 68, 68, 0.6),
      inset 0 0 10px rgba(255, 68, 68, 0.3);
  }
  50% {
    box-shadow: 0 0 30px rgba(255, 68, 68, 0.8),
      inset 0 0 15px rgba(255, 68, 68, 0.4);
  }
}

/* Responsive Adjustments */
@media (max-width: 1200px) {
  .tab-button {
    padding: 12px 8px;
    font-size: 0.75em;
  }
}

@media (max-width: 768px) {
  .tab-buttons {
    grid-template-columns: repeat(2, 1fr);
  }

  .tab-button:nth-child(4n) {
    border-right: 1px solid #444;
  }

  .tab-button:nth-child(2n) {
    border-right: none;
  }

  .tab-button:nth-child(-n + 4) {
    border-bottom: 1px solid #444;
  }

  .tab-button:nth-child(n + 3) {
    border-bottom: 1px solid #444;
  }

  .tab-button:nth-child(n + 7) {
    border-bottom: none;
  }

  .tab-button {
    padding: 14px 10px;
    font-size: 0.75em;
  }
}

@media (max-width: 480px) {
  .tab-buttons {
    grid-template-columns: 1fr;
  }

  .tab-button {
    border-right: none;
    border-bottom: 1px solid #444;
  }

  .tab-button:last-child {
    border-bottom: none;
  }
}
