@tailwind base;
@tailwind components;
@tailwind utilities;

html, body {
    scroll-behavior: smooth;
}

.left-50 {
    left: 50%;
}
.right-50 {
    right: 50%;
}
.top-50 {
    top: 50%;
}



.-z-1 {
    z-index: -1;
}

.secondary-title {
    @apply text-3xl font-bold;
}

.secondary-title::before {
    content: "";
    @apply block w-12 h-2 rounded-full mb-1;
    background-color: #EFF107;
}

.section-paragraph {
    @apply text-secondary mb-6 w-full max-w-3xl;
}

.badge {
    @apply px-4 py-2 text-sm rounded bg-badge;
}

[id] {
scroll-margin-top: 100px;
}

.left-percentage {
    left: 5%;
}

.h-screen-partial {
    height: 80vh;
}

.nav-dot {
    transition: background 200ms, border-color 200ms;
}

.selected-circle {
    @apply border-theme bg-theme;
}

.nav-dot:hover span {
    opacity: 1;
}

/* From Uiverse.io by hexday */
.terminal-card {
  background-color: #111117;
  backdrop-filter: blur(8px);
  border-radius: 0;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  width: 100%;
}

.terminal-header {
  background-color: #111117;
  padding: 10px 15px;
  display: flex;
  align-items: center;
}

.terminal-title {
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.terminal-icon {
  color: #3F3FFF;
}

.terminal-body {
  background-color: #111117;
  color: #ffffff;
  padding: 15px;
  font-family: "Courier New", Courier, monospace;
  min-height: 60px;
}

/* Card/Window Styling */
.card {
  border-radius: 0;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.titlebar {
  padding: 8px 12px;
  display: flex;
  align-items: center;
  min-height: 32px;
}

.buttons {
  display: flex;
  gap: 8px;
  align-items: center;
}

.buttons button {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.minimize {
  background-color: #ffbd2e;
}

.maximize {
  background-color: #28ca41;
}

.close {
  background-color: #ff5f56;
}

.buttons button svg {
  width: 6px;
  height: 6px;
  fill: rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity 0.2s;
}

.buttons:hover button svg {
  opacity: 1;
}

.cppcode {
  background-color: #1e1e1e;
  overflow: hidden;
}

/* Pac-Man Loader Animation */
/* From Uiverse.io by andrew-demchenk0 */
.loader-wrapper {
  position: relative;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  margin: auto;
}

.loader-wrapper .packman::before {
  content: '';
  position: absolute;
  width: 112px;
  height: 57px;
  background-color: #EFF107;
  border-radius: 100px 100px 0 0;
  transform: translate(-50%, -50%);
  animation: pac-top 0.5s linear infinite;
  transform-origin: center bottom;
}

.loader-wrapper .packman::after {
  content: '';
  position: absolute;
  width: 112px;
  height: 57px;
  background-color: #EFF107;
  border-radius: 0 0 100px 100px;
  transform: translate(-50%, 50%);
  animation: pac-bot 0.5s linear infinite;
  transform-origin: center top;
}

@keyframes pac-top {
  0% {
    transform: translate(-50%, -50%) rotate(0)
  }

  50% {
    transform: translate(-50%, -50%) rotate(-30deg)
  }

  100% {
    transform: translate(-50%, -50%) rotate(0)
  }
}

@keyframes pac-bot {
  0% {
    transform: translate(-50%, 50%) rotate(0)
  }

  50% {
    transform: translate(-50%, 50%) rotate(30deg)
  }

  100% {
    transform: translate(-50%, 50%) rotate(0)
  }
}

.dots .dot {
  position: absolute;
  z-index: -1;
  top: 18px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
}

.dots .dot:nth-child(1) {
  left: 202px;
  animation: dot-stage1 0.5s infinite;
}

.dots .dot:nth-child(2) {
  left: 135px;
  animation: dot-stage1 0.5s infinite;
}

.dots .dot:nth-child(3) {
  left: 67px;
  animation: dot-stage1 0.5s infinite;
}

.dots .dot:nth-child(4) {
  left: 22px;
  animation: dot-stage2 0.5s infinite;
}

@keyframes dot-stage1 {
  0% {
    transform: translate(0, 0);
  }

  100% {
    transform: translate(-54px, 0);
  }
}

@keyframes dot-stage2 {
  0% {
    transform: scale(1);
  }

  5%, 100% {
    transform: scale(0);
  }
}

/* Tablet-specific Pac-Man sizing */
@media (min-width: 768px) and (max-width: 1023px) {
  .loader-wrapper .packman::before {
    width: 84px;
    height: 42.75px;
  }

  .loader-wrapper .packman::after {
    width: 84px;
    height: 42.75px;
  }

  .dots .dot {
    width: 16.5px;
    height: 16.5px;
    top: 13.5px;
  }

  .dots .dot:nth-child(1) {
    left: 151.5px;
  }

  .dots .dot:nth-child(2) {
    left: 101.25px;
  }

  .dots .dot:nth-child(3) {
    left: 50.25px;
  }

  .dots .dot:nth-child(4) {
    left: 16.5px;
  }

  @keyframes dot-stage1 {
    0% {
      transform: translate(0, 0);
    }
    100% {
      transform: translate(-40.5px, 0);
    }
  }
}