@keyframes fadeIn {
  from {
      opacity: 0;
      transform: translateY(-5px);
  }
  to {
      opacity: 1;
      transform: translateY(0);
  }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    animation: fadeIn 0.3s ease-in-out;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #13161b;
  color: #fff;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px;
  scroll-behavior: smooth;
  background-image: linear-gradient(to bottom right, #13161b, #1e232a);
}

form {
    width: 100%;
    max-width: 500px;
    padding: 30px;
    border-radius: 15px;
    background-color: #1c1f26;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

input[type="file"] {
    display: block;
    margin: 20px auto;
    padding: 12px;
    background-color: #13161b;
    border: 1px solid #2d323a;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    transition: border-color 0.3s;
}

input[type="file"]:hover {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(69, 80, 233, 0.5);
}

button[type="submit"] {
    display: block;
    margin: 0 auto;
    cursor: default;
}

#categoryFilter {
  display: block;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #2d323a;
  background-color: #13161b;
  color: #fff;
  font-size: 16px;
  transition: border-color 0.3s, box-shadow 0.3s;
  margin: 20px auto;
}

#categoryFilter:hover {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(69, 80, 233, 0.5);
}

#aiVersion {
  display: inline;
  position: relative;
  padding: 5px;
  border-radius: 8px;
  border: 1px solid #2d323a;
  background-color: #13161b;
  color: #fff;
  font-size: 16px;
  transition: border-color 0.3s, box-shadow 0.3s;
  vertical-align: center;
  margin-bottom: 10px;
}

#aiVersion:hover {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(69, 80, 233, 0.5);
}

.category-label {
    font-size: 1rem;
    margin-top: 15px;
    display: block;
    text-align: left;
    color: #888;
}

.header {
    text-align: center;
    margin-bottom: 20px;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.header p {
    font-size: 1.2rem;
    color: #888;
    margin-bottom: 0;
}

.centered {
    text-align: center;
}

.result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    margin-bottom: 10px;
    border: 1px solid #2d323a;
    border-radius: 5px;
    background-color: transparent;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: default;
    pointer-events: auto;
}

.result-item:hover {
    transform: translateY(-5px);
    background-color: #1e232a;
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.2);
}

.preset-box {
    display: flex;
    align-items: center;
}

#loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 999;
}

.loading-gif {
    max-width: 400px;
    max-height: 400px;
}

#upload-p {
    position: absolute;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    top: 80%;
    left: 40%;
}

.load-algo-text {
    margin-top: 350px;
}

.tip-text {
    margin-top: 0;
    font-size: small;
    color: #888;
}

.btn-101,
.btn-101 *,
.btn-101 :after,
.btn-101 :before,
.btn-101:after,
.btn-101:before {
  border: 1px solid #2d323a;
  box-sizing: border-box;
}
.btn-101 {
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: button;
  appearance: button;
  background-color: #000;
  background-image: none;
  color: #fff;
  line-height: 1.5;
  margin: 0;
  -webkit-mask-image: -webkit-radial-gradient(#000, #fff);
  mask-image: radial-gradient(#000, #fff);
  padding: 0;
  text-transform: uppercase;
}
.btn-101:disabled {
  cursor: default;
}
.btn-101:-moz-focusring {
  outline: auto;
}
.btn-101 svg {
  vertical-align: middle;
}
.btn-101 [hidden] {
  display: none;
}
.btn-101 {
  --thickness: 0.3rem;
  --roundness: 1.2rem;
  --color: #3498db;
  --opacity: 0.6;
  -webkit-backdrop-filter: blur(100px);
  backdrop-filter: blur(100px);
  background-color: #13161b;
  border: none;
  border-radius: var(--roundness);
  color: #fff;
  padding: 0.8rem 3rem;
}
.btn-101:hover {
  filter: brightness(1.2);
}
.btn-101:active {
  --opacity: 0;
  background: hsla(0, 0%, 100%, 0.1);
}
.btn-101 svg {
  border-radius: var(--roundness);
  display: block;
  filter: url(#glow);
  height: 100%;
  left: 0;
  position: absolute;
  top: 0;
  width: 100%;
}
.btn-101 rect {
  fill: none;
  stroke: var(--color);
  stroke-width: var(--thickness);
  rx: var(--roundness);
  stroke-linejoin: round;
  stroke-dasharray: 185%;
  stroke-dashoffset: 80;
  -webkit-animation: snake 2s linear infinite;
  animation: snake 2s linear infinite;
  -webkit-animation-play-state: paused;
  animation-play-state: paused;
  height: 100%;
  opacity: 0;
  transition: opacity 0.2s;
  width: 100%;
}
.btn-101:hover rect {
  -webkit-animation-play-state: running;
  animation-play-state: running;
  opacity: var(--opacity);
}
@-webkit-keyframes snake {
  to {
    stroke-dashoffset: 370%;
  }
}
@keyframes snake {
  to {
    stroke-dashoffset: 370%;
  }
}

#help-button {
  display: inline;
  position: relative;
  margin-top: 10px;
  margin-left: 5px;
  padding: 0;
  background-color: transparent;
  border: none;
  color: #bdbdbd;
  cursor: pointer;
  transition: color 0.3s ease;
}

#help-button:hover {
  color: #3498db;
  text-shadow: 0 0 5px rgba(69, 80, 233, 0.5);
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  height: auto;
  justify-content: center;
  align-items: center;
  animation: fadeInSimple 0.5s ease-in-out;
}

.modal-content {
  background-color: #13161b;
  padding: 20px;
  border-radius: 10px;
  width: 100%;
  height: 100%;
  position: relative;
}

@keyframes fadeInSimple {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

#close-btn {
  position: absolute;
  top: 5px;
  right: 15px;
  color: #fff;
  font-size: 35px;
  cursor: pointer;
}

#close-btn:hover {
  color: #3498db;
  text-shadow: 0 0 5px rgba(69, 80, 233, 0.5);
}