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

body {
  height: 100vh;
  background: #1a1c2c;
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Main Container */
#main-container {
  display: flex;
  width: 100vw;
  height: 100vh;
  background: #2c2f48 !important;
}

/* Sidebar */
#sidebar {
  background: #1a1c2c;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Content Area */
#content-area {
  flex: 1;
  background: #2c2f48;
  overflow-y: auto;
  padding: 1rem;
}

/* Currency Display */
#currency {
  background: rgba(255, 255, 255, 0.1);
  padding: 1rem;
  border-radius: 0.5rem;
  font-size: 1.2rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  text-align: center;
  margin-bottom: 1rem;
  backdrop-filter: blur(5px);
}

/* Click Area */
#click-area {
  background: #ffbe0b;
  color: #222;
  font-size: 1.4rem;
  padding: 1rem 2rem;
  border-radius: 1rem;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease-in-out;
  box-shadow: 0 4px 15px rgba(255, 190, 11, 0.3);
}

#click-area:hover {
  background: #ff9100;
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(255, 145, 0, 0.4);
}

/* Clicker Button */
#clicker {
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
}

#clicker img {
  width: 10rem;
  transition: transform 0.1s ease-in-out;
}

#clicker:active img {
  transform: scale(0.9);
}

/* Shop Items */
.item {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
  padding: 1rem;
  overflow-y: auto;
  max-height: 43vh;
}

.shop-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  padding: 1rem;
  min-height: 12.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.3s ease;
}

.shop-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.shop-item button {
  padding: 0.8rem 1.6rem;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-weight: bold;
  border: none;
  border-radius: 0.3rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.shop-item button:hover {
  background: #45a049;
  transform: translateY(-1px);
}

/* Sidebar Buttons */
.sidebar-button {
  width: 100%;
  padding: 0.8rem;
  margin: 0.2rem 0;
  background: rgba(255, 255, 255, 0.05);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  border-radius: 0.3rem;
  transition: all 0.3s ease;
}

/* .items-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(250px, 1fr));
  gap: 1rem;
  padding: 1rem;
} */

.items-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, minmax(150px, auto));
  gap: 1rem;
  padding: 1rem;
  max-height: calc(2 * (204px + 1rem));
  overflow-y: auto;
}

@media (min-width: 1200px) {
  .items-grid {
    grid-template-columns: repeat(3, minmax(250px, 1fr));
  }
}

.sidebar-button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-button.active {
  background: rgba(255, 255, 255, 0.15);
  border-left: 3px solid #fff;
}

.tab-emoji {
  font-size: 1.2rem;
}

/* Earn Tab Elements */
.earn-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.8rem;
}

.earn-image {
  width: 3.2rem;
  height: 3.2rem;
  cursor: pointer;
}

.earn-amount {
  font-size: 0.8rem;
  margin-top: 0.4rem;
}

.earn-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem;
}

.clickable-image {
  position: relative;
  cursor: pointer;
}

.main-earn-image {
  width: 12.8rem;
  height: 12.8rem;
  transition: transform 0.1s;
}

.clickable-image:hover .main-earn-image {
  transform: scale(1.05);
}

.click-effect {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}

.money-display {
  margin-top: 1.6rem;
  text-align: center;
}

.money-display h2 {
  margin: 0;
  font-size: 2.4rem;
}

.money-display p {
  margin: 0.8rem 0 0;
  color: #666;
}

/* Hidden Elements */
.hidden {
  display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
  #main-container {
    width: 100vw;
    flex-direction: column;
  }

  #sidebar {
    width: 100%;
    height: 20vh;
    flex-direction: row;
    overflow-x: auto;
    padding: 0.5rem;
  }

  .sidebar-button {
    flex: 0 0 auto;
    width: auto;
    padding: 0.5rem;
  }

  #content-area {
    height: 80vh;
    padding: 0.5rem;
  }

  .item {
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  }

  #click-area {
    font-size: 1rem;
    padding: 0.8rem 1.6rem;
  }
}

.shop-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  padding: 1rem;
  min-height: 12.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.3s ease;
  position: relative;
}

.shop-item.locked {
  opacity: 0.5;
  pointer-events: none;
}

.shop-item.locked::before {
  content: "🔒";
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 1.5rem;
}

.buy-button {
  padding: 0.8rem 1.6rem;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-weight: bold;
  border: none;
  border-radius: 0.3rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.buy-button:hover:not(:disabled) {
  background: #45a049;
  transform: translateY(-1px);
}

.buy-button:disabled {
  background: rgba(255, 255, 255, 0.05);
  cursor: not-allowed;
}

.achievement-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #4CAF50;
  color: white;
  padding: 15px;
  border-radius: 5px;
  z-index: 1000;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
  }

  to {
    transform: translateX(0);
  }
}

/* Achievement Items */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  padding: 1rem;
}

.achievement-item {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 1rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Achievement Variations */
.common {
  border-left: 4px solid #4CAF50;
}

.rare {
  border-left: 4px solid #2196F3;
}

.epic {
  border-left: 4px solid #9C27B0;
}

.legendary {
  border-left: 4px solid #FF9800;
}

/* Hover Effects */
.achievement-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* Progress Bar */
.progress-bar-container {
  margin-top: 1rem;
}

.progress-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.progress {
  height: 100%;
  background: rgba(76, 175, 80, 0.3);
  position: relative;
}

.progress-highlight {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--highlight-color);
  transform-origin: right;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scaleX(1);
    opacity: 0.8;
  }

  50% {
    transform: scaleX(1.5);
    opacity: 1;
  }

  100% {
    transform: scaleX(1);
    opacity: 0.8;
  }
}

/* Notifications */
.achievement-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 1rem;
  z-index: 1000;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
}

.achievement-notification.visible {
  opacity: 1;
  transform: translateX(0);
}

.notification-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.notification-text {
  color: white;
}

.common .progress-highlight {
  background-color: #4CAF50;
}

.rare .progress-highlight {
  background-color: #2196F3;
}

.epic .progress-highlight {
  background-color: #9C27B0;
}

.legendary .progress-highlight {
  background-color: #FF9800;
}