html {
  box-sizing: border-box;
  --bgColorMenu: #1d1d27;
  --duration: .7s;
  --icon-color: #ffffff; /* Icon color for light theme */
  --value-up: #00ff95;
  --value-down: #ff4d4d;
  --background-color: linear-gradient(135deg, #14141f, #1a2a3e);
  --text-color: #ffffff;
}

html *,
html *::before,
html *::after {
  box-sizing: inherit;
}

body {
  font-family: 'Roboto', sans-serif;
  background: var(--background-color);
  text-align: left;
  color: var(--text-color);
  margin: 0;
  padding: 0;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  width: 100vw;
  transition: background-color var(--duration);
}

/* Dark theme adjustments */
@media (prefers-color-scheme: dark) {
  :root {
    --icon-color: #cccccc;
    --background-color: linear-gradient(135deg, #0f0f17, #152238);
  }
}

/* Icon styles */
.icon-svg {
  width: 20px;
  height: 20px;
  fill: var(--icon-color);
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background: rgba(0, 0, 0, 0.5);
  box-shadow: 0 2px 8px rgba(0, 255, 149, 0.3);
}

.icon-button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.site-logo {
  height: 40px;
}

/* Search */
.search-container {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
}

.search-input {
  flex: 1;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-color);
}

.search-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.copy {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.tooltip {
  position: absolute;
  top: -30px;
  background: var(--text-color);
  color: var(--bgColorMenu);
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
}

.copy.copied .clipboard {
  display: none;
}

.copy.copied .checkmark {
  display: inline;
}

.checkmark {
  display: none;
}

.tool-icon {
  cursor: pointer;
}

.bookmark svg {
  width: 20px;
  height: 20px;
  fill: var(--icon-color);
}

/* PNL Stats */
.pnl-stats-slider {
  padding: 20px;
}

.pnl-stats-container {
  display: flex;
  gap: 20px;
}

.pnl-column {
  flex: 1;
}

.pnl-stat-item {
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.05);
  padding: 10px;
  border-radius: 4px;
}

.pnl-label {
  display: block;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

.pnl-value {
  font-size: 16px;
  font-weight: bold;
}

.value-up {
  color: var(--value-up);
}

.value-down {
  color: var(--value-down);
}

/* Chart */
.chart-toolbar {
  padding: 10px 20px;
}

.chart-selector select {
  padding: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-color);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.pnl-chart-container {
  padding: 20px;
}

.chart-container {
  position: relative;
  height: 300px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  padding: 10px;
}

.chart-error {
  color: var(--value-down);
  text-align: center;
}

/* Assets */
.assets-container {
  padding: 20px;
}

.assets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.asset-item {
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
}

.asset-name {
  font-size: 16px;
  font-weight: bold;
}

.asset-details p {
  margin: 5px 0;
  font-size: 14px;
}

.asset-details p::before {
  content: attr(data-label) ": ";
  font-weight: bold;
  color: rgba(255, 255, 255, 0.7);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bgColorMenu);
  padding: 20px;
  border-radius: 8px;
  z-index: 1001;
  color: var(--text-color);
}

.modal-content {
  position: relative;
}

.close {
  position: absolute;
  top: 10px;
  right: 10px;
  cursor: pointer;
  font-size: 20px;
  color: var(--text-color);
}

.wallets-list {
  list-style: none;
  padding: 0;
}

.wallets-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
}

.select-wallet, .delete-wallet {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--text-color);
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
}

.select-wallet:hover, .delete-wallet:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Backdrop */
.backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

/* Loading overlay */
.loading-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
  z-index: 1002;
}

.loader {
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--value-up);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Message styles */
.message {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 10px 20px;
  border-radius: 4px;
  z-index: 1003;
}

.message.error {
  background-color: var(--value-down);
  color: white;
}

.message.success {
  background-color: var(--value-up);
  color: white;
}

/* Curved Corner Star */
.curved-corner-star {
  display: flex;
  position: relative;
}

#curved-corner-bottomleft,
#curved-corner-bottomright,
#curved-corner-topleft,
#curved-corner-topright {
  width: 4px;
  height: 5px;
  overflow: hidden;
  position: relative;
}

#curved-corner-bottomleft:before,
#curved-corner-bottomright:before,
#curved-corner-topleft:before,
#curved-corner-topright:before {
  content: "";
  display: block;
  width: 200%;
  height: 200%;
  position: absolute;
  border-radius: 50%;
}

#curved-corner-bottomleft:before {
  bottom: 0;
  left: 0;
  box-shadow: -5px 5px 0 0 var(--value-up);
}

#curved-corner-bottomright:before {
  bottom: 0;
  right: 0;
  box-shadow: 5px 5px 0 0 var(--value-up);
}

#curved-corner-topleft:before {
  top: 0;
  left: 0;
  box-shadow: -5px -5px 0 0 var(--value-up);
}

#curved-corner-topright:before {
  top: 0;
  right: 0;
  box-shadow: 5px -5px 0 0 var(--value-up);
}

/* Star Animations */
@keyframes twinkling {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.8; }
}

#star-1 {
  position: absolute;
  left: -30px;
  top: -20px;
  animation: twinkling 3s infinite;
}

#star-2 {
  position: absolute;
  left: -50px;
  top: 40px;
  animation: twinkling 2s infinite;
}

#star-3 {
  position: absolute;
  left: 180px;
  top: 100px;
  animation: twinkling 4s infinite;
}

#star-4 {
  position: absolute;
  left: 150px;
  top: 200px;
  animation: twinkling 3s infinite;
}

#star-5 {
  position: absolute;
  left: 30px;
  top: 180px;
  animation: twinkling 1.5s infinite;
}

#star-6 {
  position: absolute;
  left: 200px;
  top: -30px;
  animation: twinkling 4s infinite;
}

#star-7 {
  position: absolute;
  left: 220px;
  top: 50px;
  animation: twinkling 2s infinite;
}

/* Additional Animations */
@keyframes rotate {
  100% { transform: rotate(360deg); }
}

@keyframes slideDown {
  0% { transform: translateY(-20px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

@keyframes slideUp {
  0% { transform: translateY(10px); opacity: 0; }
  100% { transform: translateY(-10px); opacity: 1; }
}

@keyframes pulse-logo {
  0% { transform: translateX(-50%) translateY(0) scale(1); }
  50% { transform: translateX(-50%) translateY(0) scale(1.05); }
  100% { transform: translateX(-50%) translateY(0) scale(1); }
}

@keyframes pulse {
  0% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
  100% { opacity: 0.7; transform: scale(1); }
}

@keyframes blink {
  0% { opacity: 0.5; }
  50% { opacity: 1; }
  100% { opacity: 0.5; }
}

@keyframes fadeMove {
  0% { opacity: 0.7; transform: translateX(-50%) translateY(0); }
  50% { opacity: 1; transform: translateX(-50%) translateY(-5px); }
  100% { opacity: 0.7; transform: translateX(-50%) translateY(0); }
}

@keyframes timeSlideIn {
  0% { transform: translateY(20px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

@keyframes timeSlideOut {
  0% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(-20px); opacity: 0; }
}

@keyframes iconMoveUp {
  0% { transform: translateY(0) scale(1); }
  100% { transform: perspective(600px) translateY(-56px) rotateX(10deg) scale(1.333); }
}

/* Responsive Design */
@media (max-width: 600px) {
  body {
    font-size: 16px;
    padding-bottom: 10px;
  }
  .header {
    padding: 10px;
  }
  .search-container {
    padding: 10px;
  }
  .pnl-stats-container {
    flex-direction: column;
    gap: 10px;
  }
  .assets-grid {
    grid-template-columns: 1fr;
  }
}