@font-face {
  font-family: Font1;
  src: url(fonts/font1.otf);
}

@font-face {
   font-family: Font2;
   src: url(fonts/font2.otf);
}

@font-face {
   font-family: Font3;
   src: url(fonts/font3.ttf);
}

@font-face {
  font-family: Font4;
  src: url(fonts/font4.ttf);
}

@font-face {
  font-family: Font5;
  src: url(fonts/font5.otf);
}

@font-face {
  font-family: Font6;
  src: url(fonts/font6.ttf);
}

@font-face {
  font-family: Font7;
  src: url(fonts/font7.ttf);
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
  cursor: url('cursorHover.png'), auto;
  position: relative;
  min-height: 100vh;
  background-color: #f0f0f0;
}

/* Infinite Scrolling Background */
.scrolling-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background-image: url('images/blueBG1.png');
  background-size: 1920px 1080px;
  animation: scrollBackground 20s linear infinite;
}

@keyframes scrollBackground {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 400px 0;
  }
}

.scrolling-background::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.3);
}

/* Navigation Bar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(33, 61, 109, 0.9);
  padding: 15px 30px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Sound Control */
.sound-control {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 999;
}

.sound-control button {
  background-color: rgba(33, 61, 109, 0.8);
  color: white;
  border: 2px solid white;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.sound-control button:hover {
  background-color: rgba(33, 61, 109, 1);
  transform: scale(1.1);
}

.logo {
  height: 100px;
  transition: transform 0.3s ease;
}

.logo:hover {
  transform: scale(1.1);
}

.dropdown {
  position: relative;
  display: inline-block;
}

.dropbtn {
  background-color: #6e8efb;
  color: white;
  padding: 10px 20px;
  border: none;
  cursor: pointer;
  font-size: 30px;
  transition: background-color 0.3s;
}

.dropbtn:hover {
  background-color: #5d7de8;
}

.dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  background-color: #f9f9f9;
  min-width: 160px;
  box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
  z-index: 1;
  border: 2px solid black;
}

.dropdown-content a {
  color: black;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  transition: background-color 0.2s;
}

.dropdown-content a:hover {
  background-color: #cccccc;
}

.dropdown.show .dropdown-content {
  display: block;
}

/* Main Content */
.container {
  max-width: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  z-index: 1;
  padding-top: 140px; /* Space for navbar */
  min-height: 50vh;
}

.shop-title {
  width: 100%;
  text-align: center;
  margin-bottom: 30px;
}

.shop-title h1 {
  font-family: Font7;
  font-size: 50px;
  color: #ffffff;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
  animation: pulse 3s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

.shop-wrapper {
  display: flex;
  justify-content: space-between;
  width: 90%;
  margin: 0 auto;
  gap: 30px;
}

/* Shop Items Section */
.shop-items {
  background-color: rgba(255, 255, 255, 0.9);
  padding: 20px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  width: 50%;
  border: 2px solid black;
  border-radius: 10px;
  max-height: 70vh;
  overflow-y: auto;
}

.shop-items h2 {
  font-size: 30px;
  font-family: Font7;
  margin-bottom: 20px;
  color: #333;
  text-align: center;
  border-bottom: 2px solid #6e8efb;
  padding-bottom: 10px;
}

.item-list {
  list-style: none;
}

.shop-item {
  display: flex;
  margin-bottom: 20px;
  padding: 15px;
  background-color: rgba(240, 240, 240, 0.8);
  border: 2px solid #333;
  border-radius: 8px;
  transition: transform 0.2s;
  cursor: pointer;
}

.shop-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  background-color: rgba(220, 240, 255, 0.9);
}

.shop-item img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border: 1px solid #ccc;
  border-radius: 5px;
}

.item-info {
  margin-left: 15px;
  flex-grow: 1;
}

.item-info h3 {
  font-family: Font1;
  font-size: 22px;
  color: #333;
  margin-bottom: 5px;
}

.item-info p {
  font-size: 14px;
  color: #666;
  margin-bottom: 15px;
}

.buy-button {
  background-color: #6e8efb;
  color: white;
  border: none;
  padding: 8px 15px;
  font-size: 16px;
  cursor: pointer;
  border-radius: 5px;
  transition: background-color 0.3s;
  font-family: Font5;
}

.buy-button:hover {
  background-color: #5d7de8;
}

/* Shopkeeper Section */
.shop-character {
  width: 45%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.shopkeeper-container {
  background-color: rgba(255, 255, 255, 0.8);
  border: 2px solid black;
  border-radius: 10px;
  width: 100%;
  height: 400px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
  overflow: hidden;
}

.shopkeeper-image {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  transition: transform 0.5s;
}

.shopkeeper-image:hover {
  transform: scale(1.05);
}

.dialog-box {
  background-color: rgba(255, 255, 255, 0.9);
  border: 3px solid #333;
  border-radius: 10px;
  padding: 20px;
  width: 100%;
  min-height: 150px;
  position: relative;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.dialog-box:before {
  content: '';
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 0 20px 20px 20px;
  border-style: solid;
  border-color: transparent transparent #333 transparent;
}

#dialog-text {
  font-family: Font6;
  font-size: 18px;
  line-height: 1.4;
  margin-bottom: 15px;
}

.dialog-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.dialog-buttons button {
  background-color: #6e8efb;
  color: white;
  border: none;
  padding: 8px 15px;
  font-size: 16px;
  cursor: pointer;
  border-radius: 5px;
  transition: all 0.3s;
  font-family: Font5;
}

.dialog-buttons button:hover {
  background-color: #5d7de8;
  transform: translateY(-2px);
}

#buy-item {
  background-color: #4CAF50;
}

#buy-item:hover {
  background-color: #3e8e41;
}

.hidden {
  display: none;
}

/* Responsive Styles */
@media (max-width: 992px) {
  .shop-wrapper {
    flex-direction: column;
  }
  
  .shop-items, .shop-character {
    width: 100%;
    margin-bottom: 30px;
  }
  
  .shopkeeper-container {
    height: 300px;
  }
}

@media (max-width: 576px) {
  .shop-item {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  .item-info {
    margin-left: 0;
    margin-top: 10px;
  }
}