@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500;600;700;800;900&display=swap");

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

body {
  background: #1a1a1a url('assets/scanlines2.jpg') repeat;
  color: #f0f0f0;
  font-family: 'Roboto', sans-serif;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Scanlines (CRT effect) */
.scanlines {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 1px);
  background-size: 100% 2px;
  opacity: 0.3;
  pointer-events: none;
  z-index: 10;
}

/* Container */
.container {
  max-width: 600px;
  width: 90%;
  padding: 20px;
  text-align: center;
  z-index: 1;
}

/* Header */
header {
  margin-bottom: 30px;
}

h1 {
  font-family: 'Press Start 2P', cursive;
  font-size: 2rem;
  color: #ff3b3b;
  text-shadow: 2px 2px #00d4b9;
  margin-bottom: 10px;
}

.subtitle {
  font-size: 1.2rem;
  color: #f4ff57;
}

/* Card with CRT curvature */
.card {
  background: #2a2a2a;
  border: 4px solid #ff3b3b;
  border-radius: 20px;
  padding: 20px;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 59, 59, 0.5);
  position: relative;
  overflow: hidden;
}

/* Form */
.form-group {
  margin-bottom: 20px;
  text-align: left;
}

label {
  display: block;
  font-family: 'Press Start 2P', cursive;
  font-size: 0.9rem;
  color: #f0f0f0;
  margin-bottom: 5px;
}

select, input[type="text"], input[type="file"] {
  width: 100%;
  padding: 10px;
  background: #3a3a3a;
  border: 2px solid #00d4b9;
  border-radius: 5px;
  color: #f0f0f0;
  font-family: 'Roboto', sans-serif;
  font-size: 1rem;
}

select:focus, input:focus {
  outline: none;
  border-color: #ff3b3b;
  box-shadow: 0 0 10px rgba(255, 59, 59, 0.5);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 15px;
  background: #ff3b3b;
  border: 2px solid #f0f0f0;
  border-radius: 5px;
  color: #f0f0f0;
  font-family: 'Press Start 2P', cursive;
  font-size: 0.6rem;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
  margin-top: 20px;
}

.btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(255, 59, 59, 0.7);
}

.btn-export {
  background: #00d4b9;
}

.btn-search {
  background: #003168;
  padding: 10px 5px;
  font-size: 0.7rem;
  display: inline-block;
  border: 2px solid #f0f0f0;
  border-radius: 5px;
  color: #f0f0f0;
  font-family: 'Press Start 2P', cursive;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
}

/* Icons */
.icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  vertical-align: middle;
  margin-left: 5px;
  background: #ff3b3b; /* Debug: Red to confirm visibility */
}

.icon-floppy {
  background: linear-gradient(45deg, #f0f0f0 50%, #ccc 50%);
  clip-path: polygon(0 0, 80% 0, 100% 20%, 100% 100%, 20% 100%, 0 80%);
}

.icon-download {
  background: transparent;
  position: relative;
}

.icon-download::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 10px;
  background: #f0f0f0;
}

.icon-download::after {
  content: '';
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 6px;
  height: 6px;
  border-bottom: 2px solid #f0f0f0;
  border-right: 2px solid #f0f0f0;
}

/* Status */
.status {
  margin-top: 20px;
  padding: 10px;
  background: #3a3a3a;
  border: 2px solid #00d4b9;
  border-radius: 5px;
  font-size: 1rem;
  color: #f0f0f0;
  min-height: 40px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Progress Bar */
.progress {
  width: 100%;
  height: 10px;
  background: #2a2a2a;
  border: 1px solid #00d4b9;
  border-radius: 5px;
  overflow: hidden;
}

.progress-bar {
  width: 0;
  height: 100%;
  background: #ff3b3b;
  transition: width 0.3s ease;
}

.progress.hidden {
  display: none;
}

/* Responsive */
@media (max-width: 600px) {
  h1 {
    font-size: 1.5rem;
  }
  .subtitle {
    font-size: 1rem;
  }
  .card {
    padding: 15px;
    border-radius: 15px;
  }
  .btn {
    width: 100%;
    margin-top: 10px;
  }
}

#stats { 
  margin-top: 20px; 
  padding: 10px; 
  border: 1px solid #ddd; 
}

#stats table { 
  width: 100%; 
  border-collapse: collapse;
}

#stats th, #stats td { 
  border: 1px solid #ddd; 
  padding: 5px; 
  text-align: left; 
}

#auth-nav, #menu {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: transparent;
  padding: 10px;
}

#menu {
  /*background: #f0f0f0 url('assets/scanlines3.jpg') repeat;*/
  width: 100%;
  flex-wrap: wrap;
}

#menu a {
  background: #003168;
  padding: 10px 5px;
  font-size: 0.7rem;
  display: inline-block;
  border: 2px solid #f0f0f0;
  border-radius: 5px;
  color: #f0f0f0;
  font-family: 'Press Start 2P', cursive;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
}

#login-btn, #logout-btn {
  background: #a4af04;
  padding: 10px 5px;
  font-size: 0.7rem;
  display: inline-block;
  border: 2px solid #f0f0f0;
  border-radius: 5px;
  color: #04094e;
  font-family: 'Press Start 2P', cursive;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
}

#auth-nav { 
  margin: 20px; 
}

#system-select { 
  margin: 20px; 
}

#games-list { 
  margin: 20px; 
}

.game-item { 
  margin: 10px 0; border: 1px solid #ddd; padding: 10px; 
}

.edit-form { 
  display: none; 
}

.hidden { 
  display: none; 
}

#system-select, #search-input {
  width: 100%;
  max-width: 400px;
  margin-bottom: 10px;
}

#games-list .game-item {
  display: flex;
  flex-direction: column;
  margin-bottom: 20px;
}

.edit-form {
  display: flex;
  flex-direction: column;
}

/* Enhanced styles for game items (cards) */
.game-item {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  padding: 20px;
  margin-bottom: 20px;
  transition: box-shadow 0.3s ease;
}

.game-item:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.game-item h3 {
  margin-top: 0;
  font-size: 1.2em;
  color: #333;
}

.game-item p {
  margin: 5px 0;
  color: #666;
}

.game-item button {
  background-color: #007bff;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.game-item button:hover {
  background-color: #0056b3;
}

.edit-form input, .edit-form textarea {
  width: 100%;
  margin-bottom: 10px;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.9em;
}

.edit-form textarea {
  height: 100px;
}

.edit-form button {
  margin-right: 10px;
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 10px;
}

/* Media Queries for Mobile */
@media (max-width: 768px) {
  #auth-nav, #menu {
    flex-direction: column;
  }

  #system-select, #search-input {
    max-width: 100%;
  }

  .game-item {
    padding: 10px;
  }

  button, a {
    width: 100%;
    margin-bottom: 10px;
  }
}

.footer {
  position: relative;
  width: 100%;
  background: url('assets/cat.png') center;
  min-height: 750px;
  padding: 20px 50px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  border-radius: 15px;
}

.social-icon,
.menu {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 10px 0;
  flex-wrap: wrap;
  z-index: 1000;
}

.social-icon__item,
.menu__item {
  list-style: none;
}

.social-icon__link {
  font-size: 2rem;
  color: #fff;
  margin: 0 10px;
  display: inline-block;
  transition: 0.5s;
}
.social-icon__link:hover {
  transform: translateY(-10px);
}

.menu__link {
  font-size: 1.2rem;
  color: #f7f445;
  margin: 0 10px;
  display: inline-block;
  transition: 0.5s;
  text-decoration: none;
  opacity: 0.75;
  font-weight: 300;
}

.menu__link:hover {
  opacity: 1;
}

.footer p {
  color: #9ff515;
  margin: 15px 0 10px 0;
  font-size: 1rem;
  font-weight: 300;
}

.wave {
  position: absolute;
  top: 340px;
  left: 0;
  width: 100%;
  height:120px;
  background: url("assets/scanlines4.png");
  background-size: 1000px 100px;
}

.wave#wave1 {
  z-index: 0;
  opacity: 1;
  bottom: 0;
  animation: animateWaves 4s linear infinite;
}

.wave#wave2 {
  z-index: 1;
  opacity: 0.5;
  bottom: 10px;
  animation: animate 4s linear infinite !important;
}

.wave#wave3 {
  z-index: 1000;
  opacity: 0.2;
  bottom: 15px;
  animation: animateWaves 3s linear infinite;
}

.wave#wave4 {
  z-index: 2;
  opacity: 0.7;
  bottom: 20px;
  animation: animate 3s linear infinite;
}

@keyframes animateWaves {
  0% {
    background-position-x: 1000px;
  }
  100% {
    background-positon-x: 0px;
  }
}

@keyframes animate {
  0% {
    background-position-x: -1000px;
  }
  100% {
    background-positon-x: 0px;
  }
}

@media (min-width: 50px) and (max-width: 366px) {

  .wave {
    height: 100px;
  }

  .menu {
    margin-top: 120px;
    font-size: 12px;
  }

}

@media (min-width: 367px) and (max-width: 766px) {

  .wave {
    height: 225px;
  }

  .menu {
    margin-top: 120px;
    font-size: 12px;
  }

}

@media (max-width: 767px) {

  .footer .content {
    display: flex;
    flex-direction: column;
    font-size: 14px;
  }

}

@media (min-width: 768px) and (max-width: 1024px) {
  .footer .content,
  .footer {
    font-size: 14px;
  }
}

@media (orientation: landscape) and (max-height: 500px) {
  .footer {
    position: unset;
  }
}