/* global Theme Colors*/
:root {
  --accent: #8a2be2; /* Main purple color used for buttons and glow */
  --bg1: #140025; /* Deep background color */
  --up: #00ffb7; /* Color for price going up */
  --down: #ff6464; /* Color for price going down */
}

/* Page Body Setup */
body {
  margin: 0;
  font-family: "Inter", sans-serif;
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  background: var(--bg1);
  overflow-x: hidden;
}

#main-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* main box to the top */
.main-box,
.header-box,
.updated {
  position: relative;
  z-index: 1;
}

/* Header Style */
.header-box {
  width: 90%;
  max-width: 800px;
  text-align: center;
  font-size: 15px;
  font-weight: 70;
  background: rgba(255, 255, 255, 0.05);
  padding: 20px;
  margin: 20px 0 10px 0;
  border-radius: 150px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.main-box {
  width: 90%;
  max-width: 800px;
  background: rgba(255, 255, 255, 0.03);
  padding: 20px;
  border-radius: 15px;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  backdrop-filter: blur(4px);
}

.search-container {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
  animation: floatSearch 2s ease-in-out infinite alternate;
}

@keyframes floatSearch {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-6px);
  }
}

#search-input {
  padding: 15px;
  border-radius: 20px;
  border: none;
  width: 60%;
  max-width: 300px;
  outline: none;
}

#search-btn,
#refresh-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  position: relative;
  overflow: hidden;
}

#refresh-btn {
  display: block;
  margin: 20px auto 0 auto;
  padding: 15px 30px;
  font-size: 18px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.prices {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.coin {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px;
  background: rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  font-size: 21px;
}

.coin-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.coin-img {
  width: 40px;
  height: 40px;
}

.coin .price.up {
  color: var(--up);
}
.coin .price.down {
  color: var(--down);
}

.updated {
  margin-top: 15px;
  font-size: 14px;
  opacity: 0.9;
  text-shadow: 0 0 8px rgba(138, 43, 226, 0.8);
  font-weight: 600;
}

.quote-box {
  text-align: center;
  font-style: italic;
  font-size: 14px;
  opacity: 0.9;
  margin-top: 15px;
  transition: opacity 1s ease;
}

.particle,
.emoji {
  position: absolute;
  pointer-events: none;
  z-index: 100;
  font-size: 20px;
  opacity: 1;
  transition: transform 1.2s ease, opacity 1.2s ease;
}

/* Portfolio Overlay */
.portfolio-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(5px);
  z-index: 9999;
}

/* Portfolio Widget inside overlay */
.portfolio-widget {
  background: rgba(20, 0, 37, 0.95);
  border-radius: 20px;
  padding: 20px;
  width: 260px;
  max-width: 90%;
  box-shadow: 0 0 15px rgba(138, 43, 226, 0.4);
  color: white;
  font-family: Inter, sans-serif;
}

.coin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.coin-label {
  width: 35px;
  font-weight: bold;
}
.coin-row input {
  width: 60px;
  border-radius: 12px;
  padding: 4px;
  text-align: center;
  border: none;
}
.coin-value {
  width: 55px;
  text-align: right;
}
.coin-emoji {
  width: 25px;
  text-align: center;
}

.portfolio-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
}
.portfolio-buttons button {
  background: var(--accent);
  border: none;
  border-radius: 12px;
  padding: 6px;
  color: white;
  cursor: pointer;
  font-weight: bold;
  flex: 1;
  margin: 0 3px;
}
.portfolio-buttons button:hover {
  background: #a07bff;
}

/* Open Portfolio Button */
#open-portfolio {
  background: linear-gradient(45deg, #8a2be2, #ff6ec7);
  color: white;
  border: none;
  padding: 14px 28px;
  border-radius: 50px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 0 15px rgba(138, 43, 226, 0.7),
    0 0 30px rgba(255, 110, 199, 0.5);
  transition: transform 0.2s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
  z-index: 1;
  text-shadow: 0 0 5px white;
  animation: pulse 2s infinite;
}

#open-portfolio:hover {
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 0 25px rgba(138, 43, 226, 0.9),
    0 0 45px rgba(255, 110, 199, 0.7);
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.7),
      0 0 30px rgba(255, 110, 199, 0.5);
  }
  50% {
    box-shadow: 0 0 20px rgba(138, 43, 226, 0.9),
      0 0 40px rgba(255, 110, 199, 0.7);
  }
  100% {
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.7),
      0 0 30px rgba(255, 110, 199, 0.5);
  }
}

#open-portfolio::after {
  content: "💰";
  position: absolute;
  top: -10px;
  right: -10px;
  font-size: 20px;
  animation: bounce 1.5s infinite alternate;
}

@keyframes bounce {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-5px);
  }
}
