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

:root {
  --font-sans: "Montserrat", sans-serif;
  --font-display: "Cinzel", Georgia, serif;
  --font-main: "Cinzel", Georgia, serif;
  --font-arabic: "Tajawal", "Segoe UI", sans-serif;
  --ui-accent: #d8ad70;
  --ui-accent-light: #efcf98;
  --ui-accent-soft: #c59c7d;
  --text-main: #f4f0ea;
  --text-muted: rgba(244, 240, 234, 0.58);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: #0b0f14;
  color: var(--text-main);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button,
a {
  font: inherit;
  color: inherit;
}

.project-list-scroll,
.scrollbar-hidden,
.admin-scroll {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.project-list-scroll::-webkit-scrollbar,
.scrollbar-hidden::-webkit-scrollbar,
.admin-scroll::-webkit-scrollbar {
  display: none;
}

/* Day / Night Switch Component */
.switch,
.switch__input {
  -webkit-tap-highlight-color: transparent;
  display: block;
}

.switch {
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  cursor: pointer;
  margin: auto;
  position: relative;
}

.switch__input {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background: linear-gradient(145deg, rgba(64, 58, 52, 0.82), rgba(42, 38, 35, 0.8));
  width: 2.75em;
  height: 1.5em;
  -webkit-backdrop-filter: blur(26px) saturate(118%);
  backdrop-filter: blur(26px) saturate(118%);
  border: 1px solid rgba(216, 173, 112, 0.34);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  pointer-events: auto;
  border-radius: 0.75em;
  outline: transparent;
  transition:
    background 0.2s,
    border-color 0.2s,
    box-shadow 0.2s;
}

.switch:hover .switch__input {
  background: linear-gradient(145deg, rgba(88, 75, 63, 0.9), rgba(55, 47, 41, 0.88));
  border-color: rgba(239, 207, 152, 0.72);
  box-shadow: 0 0 16px rgba(216, 173, 112, 0.24);
}

.switch__input:focus-visible {
  border-color: rgba(239, 207, 152, 0.72);
  box-shadow: 0 0 16px rgba(216, 173, 112, 0.24);
}

.switch__icon {
  pointer-events: none;
  width: 0.75em;
  height: 0.75em;
  transition:
    color 0.6s,
    opacity 0.6s,
    transform 0.6s cubic-bezier(0.65, 0, 0.35, 1);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
  position: absolute;
  top: 0.375em;
  left: 0.375em;
}

.switch__icon--sun {
  color: rgba(244, 240, 234, 0.58);
}

.switch__icon--moon {
  color: rgba(244, 240, 234, 0.58);
  left: auto;
  right: 0.375em;
}

.switch__inner,
.switch__inner-icons {
  pointer-events: none;
  border-radius: 0.5em;
  width: 2.25em;
  height: 1em;
  display: block;
  position: absolute;
  top: 0.25em;
  left: 0.25em;
  overflow: hidden;
}

.switch__inner:before,
.switch__inner-icons {
  transition: transform 0.6s cubic-bezier(0.65, 0, 0.35, 1);
  transform: translate(-1.25em);
}

.switch__inner:before {
  content: "";
  border-radius: inherit;
  width: 100%;
  height: 100%;
  transition:
    transform 0.6s cubic-bezier(0.65, 0, 0.35, 1),
    background 0.6s ease,
    box-shadow 0.6s ease;
  background: linear-gradient(135deg, #ffd84a 0%, #ffc928 55%, #f5b900 100%);
  display: block;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.68),
    inset 0 -1px rgba(190, 130, 0, 0.2),
    0 2px 7px rgba(0, 0, 0, 0.22),
    0 0 8px rgba(255, 205, 35, 0.18);
}

.switch__input:checked ~ .switch__inner:before {
  background: linear-gradient(135deg, #262626 0%, #111 55%, #020202 100%);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.18),
    inset 0 -1px rgba(0, 0, 0, 0.65),
    0 2px 8px rgba(0, 0, 0, 0.4);
}

.switch__inner-icons {
  pointer-events: none;
}

.switch__inner-icons .switch__icon {
  color: #fff;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.28));
  top: 0.125em;
  left: 0.125em;
  transform: translate(1.25em);
}

.switch__inner-icons .switch__icon:nth-child(2) {
  left: auto;
  right: 0.125em;
}

.switch__active-sun,
.switch__active-moon {
  color: rgba(255, 255, 255, 0.98) !important;
}

.switch__input:checked ~ .switch__inner:before,
.switch__input:checked ~ .switch__inner-icons {
  transform: translate(1.25em);
}

.switch__input:not(:checked) ~ .switch__icon--sun {
  color: #f4f0ea;
}

.switch__input:not(:checked) ~ .switch__icon--moon {
  color: rgba(244, 240, 234, 0.58);
}

.switch__input:checked ~ .switch__icon--sun {
  color: rgba(244, 240, 234, 0.58);
}

.switch__input:checked ~ .switch__icon--moon {
  color: #f4f0ea;
}

.switch__input:not(:checked) ~ .switch__icon:first-of-type,
.switch__input:checked ~ .switch__icon:nth-of-type(2) {
  transform: rotate(360deg);
}

.switch__input:checked ~ .switch__inner-icons .switch__icon:first-of-type {
  transform: translate(-1.25em) rotate(-360deg);
}

.switch__input:checked ~ .switch__inner-icons .switch__icon:nth-of-type(2) {
  transform: translate(0) rotate(0);
}

.switch__sr {
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  width: 1px;
  height: 1px;
  position: absolute;
  overflow: hidden;
}

/* Loader / HashLoader Animation */
.hash-loader {
  display: inherit;
  position: relative;
  width: 64px;
  height: 64px;
  transform: rotate(165deg);
  color: #efcf98;
}

.hash-bar-1,
.hash-bar-2 {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: 12.8px;
  height: 12.8px;
  border-radius: 6.4px;
  transform: translate(-50%, -50%);
  animation-fill-mode: none;
}

.hash-bar-1 {
  animation: hashLoaderBefore 2s infinite;
}

.hash-bar-2 {
  animation: hashLoaderAfter 2s infinite;
}

@keyframes hashLoaderBefore {
  0% {
    width: 12.8px;
    box-shadow:
      25.6px -12.8px rgba(239, 207, 152, 0.75),
      -25.6px 12.8px rgba(239, 207, 152, 0.75);
  }
  35% {
    width: 64px;
    box-shadow:
      0 -12.8px rgba(239, 207, 152, 0.75),
      0 12.8px rgba(239, 207, 152, 0.75);
  }
  70% {
    width: 12.8px;
    box-shadow:
      -25.6px -12.8px rgba(239, 207, 152, 0.75),
      25.6px 12.8px rgba(239, 207, 152, 0.75);
  }
  100% {
    box-shadow:
      25.6px -12.8px rgba(239, 207, 152, 0.75),
      -25.6px 12.8px rgba(239, 207, 152, 0.75);
  }
}

@keyframes hashLoaderAfter {
  0% {
    height: 12.8px;
    box-shadow:
      12.8px 25.6px #efcf98,
      -12.8px -25.6px #efcf98;
  }
  35% {
    height: 64px;
    box-shadow:
      12.8px 0 #efcf98,
      -12.8px 0 #efcf98;
  }
  70% {
    height: 12.8px;
    box-shadow:
      12.8px -25.6px #efcf98,
      -12.8px 25.6px #efcf98;
  }
  100% {
    box-shadow:
      12.8px 25.6px #efcf98,
      -12.8px -25.6px #efcf98;
  }
}

/* Animations */
@keyframes pinGlow {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.25);
    opacity: 1;
  }
}

@keyframes markerPopupIn {
  from {
    opacity: 0;
    transform: translate(-50%, -40%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}
