@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: #0a0a0a;
  color: #c8c8c8;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  opacity: 0;
  animation: fadeIn 0.6s ease forwards;
}

@keyframes fadeIn {
  to { opacity: 1; }
}

/* Stars Background */
.stars-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.star {
  position: absolute;
  background: #ffc7c4;
  image-rendering: pixelated;
  animation: twinkle var(--duration) ease-in-out infinite, drift var(--drift-duration) linear infinite, fall var(--fall-duration) linear infinite;
  opacity: 0;
}

.star::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: var(--size);
  height: var(--size);
  background: inherit;
  box-shadow: 
    calc(var(--size) * -1) 0 0 0 inherit,
    calc(var(--size) * 1) 0 0 0 inherit,
    0 calc(var(--size) * -1) 0 0 inherit,
    0 calc(var(--size) * 1) 0 0 inherit;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.1; }
  50% { opacity: var(--max-opacity); }
}

@keyframes drift {
  0% { transform: translateX(0) translateY(0); }
  25% { transform: translateX(var(--drift-x)) translateY(var(--drift-y)); }
  50% { transform: translateX(calc(var(--drift-x) * -0.5)) translateY(calc(var(--drift-y) * 0.5)); }
  75% { transform: translateX(calc(var(--drift-x) * 0.3)) translateY(calc(var(--drift-y) * -0.3)); }
  100% { transform: translateX(0) translateY(0); }
}

@keyframes fall {
  0% { transform: translateY(-10px); }
  100% { transform: translateY(calc(100vh + 10px)); }
}

/* Navigation */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 24px;
  padding: 20px 0;
  background: transparent;
  z-index: 100;
}

nav a {
  color: #555;
  text-decoration: none;
  font-size: 14px;
  font-weight: 400;
  padding: 4px 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  letter-spacing: 0.3px;
}

nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: #ffc7c4;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

nav a:hover {
  color: #999;
}

nav a:hover::after {
  transform: scaleX(0.6);
}

nav a.active {
  color: #ffc7c4;
}

nav a.active::after {
  transform: scaleX(1);
}

/* Main content container */
.content-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 20px 40px;
}

.container {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

/* Profile section - centered */
.profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.avatar-container {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #1a1a1a;
  border: 1px solid #333;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.avatar-container:hover {
  border-color: #444;
}

.profile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-placeholder {
  font-size: 20px;
  color: #666;
}

.storename {
  color: #666;
  font-size: 13px;
  font-weight: 400;
}

/* Shop title - left aligned */
.shop-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  color: #e0e0e0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}

.shop-title::after {
  content: '';
  width: 20px;
  height: 1px;
  background: #ffc7c4;
  opacity: 0.5;
}

/* Description - left aligned */
.description {
  color: #888;
  font-size: 14px;
  line-height: 1.7;
  max-width: 100%;
  text-align: left;
}

.description strong {
  color: #ccc;
  font-weight: 500;
}

.description .accent {
  color: #ffc7c4;
  font-weight: 400;
  opacity: 0.8;
}

/* Shop items - left aligned */
.shop-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}

.shop-item {
  color: #777;
  font-size: 14px;
  font-weight: 400;
  padding: 6px 0;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.shop-item:hover {
  color: #ddd;
}

.shop-item::before {
  content: '›';
  color: #ffc7c4;
  margin-right: 8px;
  font-weight: 400;
  opacity: 0;
  transition: all 0.25s;
  display: inline-block;
  transform: translateX(-4px);
}

.shop-item:hover::before {
  opacity: 0.7;
  transform: translateX(0);
}

.shop-item .price {
  color: #ffc7c4;
  font-weight: 500;
  margin-left: 4px;
  opacity: 0.8;
}

/* Cart Button */
.cart-button {
  position: fixed;
  top: 16px;
  right: 20px;
  z-index: 101;
  background: rgba(17, 17, 17, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 199, 196, 0.2);
  border-radius: 10px;
  padding: 10px 16px;
  display: none;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: #e0e0e0;
  font-size: 14px;
}

.cart-button.visible {
  display: flex;
}

.cart-button:hover {
  border-color: rgba(255, 199, 196, 0.4);
  transform: translateY(-1px);
}

.cart-icon {
  font-size: 18px;
}

.cart-count {
  background: #ffc7c4;
  color: #000;
  font-size: 11px;
  font-weight: 600;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-total {
  color: #ffc7c4;
  font-weight: 600;
  font-size: 13px;
}

/* Cart Modal */
.cart-modal .modal {
  max-width: 400px;
}

.cart-items {
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 16px;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: #1a1a1a;
  border-radius: 8px;
  margin-bottom: 8px;
}

.cart-item-info {
  flex: 1;
}

.cart-item-name {
  font-size: 14px;
  color: #e0e0e0;
  margin-bottom: 4px;
}

.cart-item-price {
  font-size: 13px;
  color: #ffc7c4;
}

.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-item-remove {
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  padding: 4px 8px;
  font-size: 16px;
  transition: color 0.2s;
}

.cart-item-remove:hover {
  color: #ff6b6b;
}

.cart-summary {
  border-top: 1px solid #2a2a2a;
  padding-top: 16px;
  margin-bottom: 16px;
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 14px;
  color: #888;
}

.cart-summary-row.total {
  font-size: 16px;
  font-weight: 600;
  color: #e0e0e0;
}

.cart-summary-row.total span:last-child {
  color: #ffc7c4;
}

.cart-actions {
  display: flex;
  gap: 8px;
}

.btn-buy-now {
  flex: 1;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  background: linear-gradient(135deg, #ffc7c4 0%, #ffb8b5 100%);
  color: #000;
}

.btn-buy-now:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 199, 196, 0.3);
}

.btn-clear-cart {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid #2a2a2a;
  background: transparent;
  color: #888;
}

.btn-clear-cart:hover {
  color: #fff;
  border-color: #444;
}

/* Product actions */
.product-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.btn-add-cart {
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid rgba(255, 199, 196, 0.3);
  background: transparent;
  color: #ffc7c4;
}

.btn-add-cart:hover {
  background: rgba(255, 199, 196, 0.1);
  border-color: rgba(255, 199, 196, 0.5);
}

.btn-add-cart.added {
  background: rgba(255, 199, 196, 0.15);
  border-color: #ffc7c4;
  color: #ffc7c4;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background-color: #111;
  border: 1px solid rgba(255, 199, 196, 0.1);
  border-radius: 12px;
  padding: 20px;
  width: 100%;
  max-width: 320px;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.modal-product-name {
  font-size: 11px;
  color: #ffc7c4;
  margin-bottom: 4px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.7;
}

.modal-title {
  font-size: 14px;
  font-weight: 600;
  color: #e0e0e0;
}

.modal-close {
  background: none;
  border: none;
  color: #666;
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: all 0.2s;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.modal-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

/* Quantity selector */
.quantity-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.quantity-btn {
  width: 32px;
  height: 32px;
  border: 1px solid #2a2a2a;
  background-color: #1a1a1a;
  color: #ffc7c4;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.quantity-btn:hover {
  background-color: rgba(255, 199, 196, 0.1);
  border-color: rgba(255, 199, 196, 0.3);
}

.quantity-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.quantity-value {
  width: 48px;
  height: 32px;
  background-color: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  color: #fff;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
}

/* Total */
.modal-total {
  text-align: center;
  margin-bottom: 20px;
  font-size: 13px;
  color: #888;
}

.modal-total strong {
  color: #ffc7c4;
  font-size: 16px;
  font-weight: 600;
}

/* Modal buttons */
.modal-actions {
  display: flex;
  gap: 8px;
}

.btn {
  flex: 1;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
}

.btn-cancel {
  background-color: transparent;
  color: #888;
  border: 1px solid #2a2a2a;
}

.btn-cancel:hover {
  color: #fff;
  border-color: #444;
}

.btn-continue {
  background: linear-gradient(135deg, #ffc7c4 0%, #ffb8b5 100%);
  color: #000;
  font-weight: 600;
}

.btn-continue:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 199, 196, 0.3);
}

.btn-continue:active {
  transform: translateY(0);
}

/* Auth Modal */
.auth-modal .modal {
  max-width: 360px;
}

.auth-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background-color: #1a1a1a;
  border-radius: 8px;
  padding: 4px;
}

.auth-tab {
  flex: 1;
  padding: 8px;
  border: none;
  background: transparent;
  color: #888;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-tab:hover {
  color: #fff;
}

.auth-tab.active {
  background-color: rgba(255, 199, 196, 0.15);
  color: #ffc7c4;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-input {
  width: 100%;
  padding: 10px 12px;
  background-color: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-input:focus {
  border-color: rgba(255, 199, 196, 0.4);
  box-shadow: 0 0 0 3px rgba(255, 199, 196, 0.1);
}

.auth-input::placeholder {
  color: #555;
}

.otp-inputs {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.otp-input {
  width: 40px;
  height: 48px;
  background-color: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  outline: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.otp-input:focus {
  border-color: rgba(255, 199, 196, 0.4);
  box-shadow: 0 0 0 3px rgba(255, 199, 196, 0.1);
}

.auth-message {
  text-align: center;
  font-size: 12px;
  color: #666;
  margin-top: 8px;
}

.auth-message.error {
  color: #ff6b6b;
}

.auth-message.success {
  color: #51cf66;
}

/* Payment Modal */
.payment-modal .modal {
  max-width: 380px;
}

.payment-info {
  text-align: center;
  margin-bottom: 20px;
}

.payment-amount {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #ffc7c4;
}

.payment-address {
  background-color: #1a1a1a;
  border: 1px solid rgba(255, 199, 196, 0.15);
  border-radius: 6px;
  padding: 12px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 11px;
  word-break: break-all;
  margin-bottom: 12px;
  color: #ccc;
  line-height: 1.5;
}

.payment-status {
  font-size: 13px;
  color: #888;
  margin-bottom: 16px;
  font-weight: 500;
}

.payment-status.pending {
  color: #ffc7c4;
}

.payment-status.completed {
  color: #51cf66;
}

/* User info bar */
.user-bar {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: rgba(17, 17, 17, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 199, 196, 0.15);
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  z-index: 50;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.user-bar:hover {
  border-color: rgba(255, 199, 196, 0.3);
  transform: translateY(-2px);
}

.user-bar.hidden {
  display: none;
}

.user-email {
  color: #888;
}

.user-balance {
  color: #ffc7c4;
  font-weight: 600;
}

.user-logout {
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s;
}

.user-logout:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

/* Page transition animations */
.page-enter {
  animation: slideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Staggered item animations */
.shop-item {
  opacity: 0;
  animation: fadeInItem 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fadeInItem {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Responsive */
@media (max-width: 600px) {
  .content-wrapper {
    padding: 70px 16px 20px;
  }
  
  .modal {
    margin: 20px;
    max-width: calc(100% - 40px);
  }
}
