/* Base styles */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "yearis199x", sans-serif;
  cursor: url(./cursors/Glove\ Normal.cur), auto;
  background-color: #000;
  overflow-x: hidden;
}

/* Typography */
h1 {
  font-size: 36px;
  font-family: "name", sans-serif;
}

h2 {
  margin: 10px 0;
  text-align: center;
  font-size: 24px;
}

p {
  line-height: 1.6;
}

/* Links */
a {
  color: inherit;
  text-decoration: none;
  cursor: url(./cursors/Glove\ Link.cur), auto;
}

a:hover {
  text-decoration: underline;
}

/* Font faces */
@font-face {
  font-family: "name";
  src: url("./fonts/Saturn-Boing.woff");
}

@font-face {
  font-family: "yearis199x";
  src: url("./fonts/KiwiSoda.ttf");
}

@font-face {
  font-family: "dialogue_content";
  src: url("./fonts/VCR_OSD_MONO_1.001.ttf");
}

/* Background animations */
.background-animated {
  width: 100%;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: -2;
  animation: infiniteScrollBg 12s linear infinite;
  background-size: 256px 256px;
}

.background-animated::before {
  content: "";
  background-size: cover;
  opacity: 100%;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

.background-animated2 {
  width: 100%;
  height: 100vh;
  opacity: 0.33;
  position: fixed;
  top: 0;
  left: 0;
  z-index: -1;
  animation: infiniteScrollBg2 8s linear infinite;
  background-size: 256px 256px;
}

@keyframes infiniteScrollBg {
  0% {
    background-position: 128px -256px;
  }
  100% {
    background-position: 128px 256px;
  }
}

@keyframes infiniteScrollBg2 {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 256px 256px;
  }
}

/* Main container */
.textContainer {
  border-radius: 25px;
  background-image: linear-gradient(180deg, rgba(20, 20, 20, 0.8), rgba(20, 20, 20, 0.6), rgba(0, 0, 0, 0));
  color: white;
  position: absolute;
  font-family: "yearis199x", sans-serif;
  font-size: 18px;
  top: 5%;
  left: 2.5%;
  bottom: 10%;
  right: 2.5%;
  overflow-y: auto;
  max-height: 85vh;
}

/* Tab system */
.tab {
  overflow: hidden;
  border: 0;
  border-radius: 25px;
  display: flex;
}

.tab button {
  background-color: rgba(20, 20, 20, 0.5);
  width: 25%;
  flex-grow: 1;
  border: none;
  outline: none;
  cursor: pointer;
  padding: 14px;
  transition: 0.3s;
  color: wheat;
  font-family: "yearis199x", sans-serif;
  font-size: larger;
}

.tab button:hover {
  background-color: rgba(123, 124, 125, 1);
  cursor: url(./cursors/Glove\ Link.cur), auto;
}

.tab button.active {
  background-color: rgba(60, 60, 60, 0.8);
}

.tabcontent {
  display: none;
  padding: 6px 12px;
  margin: 1%;
  border: 0;
  color: wheat;
}

/* Portrait and dialog */
#portrait {
  display: block;
  margin-left: auto;
  margin-right: auto;
  width: 25%;
  margin-top: 25px;
  margin-bottom: 30px;
  border-radius: 100px;
  box-shadow: 0 0 0 3px wheat, 0 0 0 12px #251C00;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  user-drag: none;
  -webkit-user-drag: none;
}

#dialog {
  height: 120px;
  background: #1c1c1c;
  margin: auto;
  border-radius: 25px;
  box-shadow: 0 0 0 6px wheat, 0 0 0 12px #251C00;
  color: wheat;
  font-family: "dialogue_content", monospace;
  font-size: 16px;
  font-weight: bold;
  padding: 10px;
  position: relative;
  text-transform: uppercase;
  word-spacing: 3px;
  width: 500px;
  max-width: 90%;
  cursor: url(./cursors/Glove\ Link.cur), auto;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Arrow animation */
@keyframes arrow_anim {
  from { margin-top: 14%; }
  to { margin-top: 16%; }
}

@-webkit-keyframes arrow_anim {
  from { margin-top: 14%; }
  to { margin-top: 16%; }
}

#arrow {
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 10px solid wheat;
  height: 0;
  margin: 70px 0 0 85%;
  position: absolute;
  width: 0;
  animation: arrow_anim 0.3s steps(3) infinite;
  -webkit-animation: arrow_anim 0.3s steps(3) infinite;
}

/* Gallery */
div.gallery {
  margin: 1%;
  margin-top: 5px;
  float: left;
  width: 25%;
  margin-right: 10px;
  overflow: visible;
  background-color: rgba(20, 20, 20, 0.6);
  border: 0;
  border-radius: 25px;
  transition: transform 0.2s;
}

div.gallery:hover {
  text-decoration: underline;
  transform: scale(1.05);
}

div.gallery.gallery-large {
  margin: 0;
  float: none;
  width: 100%;
  max-width: 280px;
}

div.gallery.gallery-large img {
  width: 100%;
  height: auto;
  max-height: 200px;
  object-fit: cover;
}

div.gallery img {
  border-radius: 10px;
  width: 100%;
  height: auto;
}

div.desc {
  margin: 10px;
  text-align: center;
  font-size: 18px;
}

.role-subtitle {
  font-size: medium;
}

/* Project descriptions */
.project-description {
  font-family: "dialogue_content", monospace;
  margin: 15px;
  font-size: 14px;
}

/* Preview gallery */
.preview_gallery {
  clear: both;
  padding: 20px 0;
  text-align: center;
}

.preview_gallery img {
  margin: 5px;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.2s;
}

.preview_gallery img:hover {
  transform: scale(1.05);
}

/* Footer */
.footer {
  position: fixed;
  left: 15%;
  right: 15%;
  bottom: 1%;
  padding: 10px;
  max-height: 8%;
  background-color: rgba(20, 20, 20, 0.8);
  color: wheat;
  text-align: center;
  border-radius: 10px;
  z-index: 100;
}

/* Lightbox */
#fullpage {
  display: none;
  position: absolute;
  z-index: 9999;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center center;
  background-color: black;
  cursor: pointer;
}

/* Utility classes */
.hide {
  display: none;
}

/* General image styles */
img {
  border-radius: 10px;
}

/* Responsive design */
@media (max-width: 768px) {
  .textContainer {
    font-size: 16px;
    left: 1%;
    right: 1%;
  }
  
  .tab button {
    font-size: medium;
    padding: 10px 5px;
  }
  
  div.gallery {
    width: 45%;
  }
  
  div.gallery.gallery-large {
    width: 90%;
  }
  
  #portrait {
    width: 40%;
  }
  
  #dialog {
    width: 90%;
    font-size: 14px;
    padding: 15px;
  }
  
  .footer {
    left: 5%;
    right: 5%;
    font-size: 14px;
  }
  
  .preview_gallery img {
    width: 150px;
  }
}

/* Clear floats */
.tabcontent::after {
  content: "";
  display: table;
  clear: both;
}

/* Project Layout */
.project-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 10px 20px;
  height: calc(100% - 80px);
  max-height: 600px;
}

.project-left {
  flex: 0 0 280px;
}

.project-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 15px;
  overflow-y: auto;
  max-height: 100%;
}

/* Screenshot Gallery */
.screenshot-gallery {
  display: flex;
  flex-direction: row;
  gap: 10px;
  flex-wrap: wrap;
}

.screenshot-thumb {
  width: 120px;
  height: auto;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.screenshot-thumb:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(245, 222, 179, 0.3);
}

.project-details {
  margin: 0;
}

.project-details p {
  margin: 8px 0;
  font-size: 14px;
  line-height: 1.5;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  overflow: auto;
  animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  margin: auto;
  display: block;
  max-width: 90%;
  max-height: 80vh;
  margin-top: 5vh;
  animation: modalZoomIn 0.3s ease;
}

@keyframes modalZoomIn {
  from { transform: scale(0.8); }
  to { transform: scale(1); }
}

.modal-caption {
  margin: auto;
  display: block;
  width: 80%;
  max-width: 700px;
  text-align: center;
  color: wheat;
  padding: 10px 0;
  font-family: "dialogue_content", monospace;
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 35px;
  color: wheat;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s;
}

.modal-close:hover,
.modal-close:focus {
  color: #fff;
}

/* Modal Navigation */
.modal-nav {
  position: absolute;
  top: 50%;
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 20px;
  box-sizing: border-box;
  pointer-events: none;
}

.modal-prev,
.modal-next {
  color: wheat;
  font-size: 50px;
  cursor: pointer;
  user-select: none;
  pointer-events: all;
  transition: color 0.3s;
  background-color: rgba(0, 0, 0, 0.5);
  padding: 10px 20px;
  border-radius: 5px;
}

.modal-prev:hover,
.modal-next:hover {
  color: #fff;
  background-color: rgba(0, 0, 0, 0.8);
}

/* Modal Dots */
.modal-dots {
  text-align: center;
  padding: 20px 0;
  position: absolute;
  bottom: 20px;
  width: 100%;
}

.modal-dot {
  cursor: pointer;
  height: 12px;
  width: 12px;
  margin: 0 5px;
  background-color: rgba(245, 222, 179, 0.3);
  border-radius: 50%;
  display: inline-block;
  transition: background-color 0.3s ease;
}

.modal-dot.active,
.modal-dot:hover {
  background-color: wheat;
}

/* Responsive Modal */
@media (max-width: 768px) {
  .project-layout {
    flex-direction: column;
  }
  
  .project-left {
    flex: 1 1 auto;
    width: 100%;
  }
  
  .screenshot-gallery {
    flex-direction: row;
    justify-content: center;
  }
  
  .screenshot-thumb {
    width: 100px;
  }
  
  .modal-prev,
  .modal-next {
    font-size: 30px;
    padding: 5px 10px;
  }
  
  .modal-close {
    font-size: 30px;
    right: 20px;
  }
  
  .modal-content {
    margin-top: 10vh;
  }
}