@import url('glass-ui.css');

:root {
  --bg: #0f0f12;
  --panel: rgba(35, 35, 45, 0.7);
  --panel-2: rgba(50, 50, 60, 0.6);
  --panel-3: rgba(60, 60, 70, 0.5);
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.5);
  --primary: #1689ff;
  --primary-light: #4da6ff;
  --accent: #49df64;
  --gold: #f5a623;
  --border: rgba(255, 255, 255, 0.08);
  --border-light: rgba(255, 255, 255, 0.12);
  
  /* Glass */
  --blur-sm: 8px;
  --blur-md: 16px;
  --blur-lg: 24px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --transition-normal: 0.25s ease;
}

* { box-sizing: border-box; }

html, body { 
  height: 100%; 
  margin: 0;
  overflow-x: hidden;
}

body {
  background: #0d0d14;
  color: var(--text);
  font-family: 'SFProText', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  position: relative;
}

/* Animated gradient background - VISIBLE colored orbs */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle 400px at 10% 20%, rgba(99, 102, 241, 0.35) 0%, transparent 60%),
    radial-gradient(circle 350px at 90% 15%, rgba(236, 72, 153, 0.3) 0%, transparent 60%),
    radial-gradient(circle 300px at 50% 90%, rgba(34, 211, 238, 0.25) 0%, transparent 60%),
    radial-gradient(circle 250px at 5% 70%, rgba(168, 85, 247, 0.25) 0%, transparent 60%),
    radial-gradient(circle 280px at 85% 80%, rgba(34, 197, 94, 0.2) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
  animation: bgFloat 20s ease-in-out infinite;
}

body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 50% 50%, transparent 0%, rgba(13, 13, 20, 0.5) 100%);
  pointer-events: none;
  z-index: 0;
}

@keyframes bgFloat {
  0%, 100% { transform: scale(1) translate(0, 0); }
  25% { transform: scale(1.1) translate(-2%, 3%); }
  50% { transform: scale(1.05) translate(2%, -2%); }
  75% { transform: scale(1.15) translate(-1%, -3%); }
}

.app { 
  min-height: 100%; 
  display: flex; 
  flex-direction: column;
  padding-bottom: 80px;
  position: relative;
  z-index: 1;
}

/* Hide Snowflakes */
.snowflakes {
  display: none !important;
}

/* Glass Balance Bar */
.balance-bar {
  display: flex;
  justify-content: space-between;
  padding: 10px 16px;
  gap: 12px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(15, 15, 20, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  height: 56px;
  align-items: center;
}

.balance-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all var(--transition-normal);
}

.balance-item.stars {
  background: rgba(247, 181, 0, 0.1);
  border: 1px solid rgba(247, 181, 0, 0.2);
  padding: 8px 14px;
}

.balance-item.ton {
  background: rgba(22, 137, 255, 0.1);
  border: 1px solid rgba(22, 137, 255, 0.2);
  padding: 8px 8px 8px 12px;
}

.balance-item:hover {
  transform: scale(1.02);
}

.balance-icon-star {
  font-size: 16px;
  color: #f7b500;
}

.balance-icon-img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.balance-amount {
  color: var(--text);
}

.balance-add {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
  line-height: 1;
  transition: all var(--transition-normal);
}

.balance-add:hover {
  background: var(--primary);
  transform: scale(1.1);
  box-shadow: 0 0 10px rgba(22, 137, 255, 0.4);
}

/* Glass Profile Header */
.profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 80px 20px 20px;
}

.profile-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7b68ee, #87ceeb);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: 
    0 4px 20px rgba(123, 104, 238, 0.4),
    0 0 30px rgba(135, 206, 235, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-letter {
  font-size: 40px;
  font-weight: 600;
  color: white;
  text-transform: uppercase;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.profile-name {
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

/* Glass Stats */
.profile-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  padding: 20px;
  margin: 0 16px 20px;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
}

.stat-item {
  text-align: center;
}

.stat-value {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 4px;
}

.stat-number {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.stat-icon {
  font-size: 14px;
}

.stat-icon-svg {
  width: 16px;
  height: 16px;
  color: var(--text);
}

.stat-icon-ton {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.stat-divider {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: center;
}

.stat-divider span {
  width: 4px;
  height: 1px;
  background: var(--muted);
}

.stat-label {
  font-size: 13px;
  color: var(--muted);
}

/* Glass Profile Actions */
.profile-actions {
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-action-btn {
  width: 100%;
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.profile-action-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-light);
  transform: translateY(-1px);
}

.profile-action-btn:active {
  transform: scale(0.98);
  background: rgba(255, 255, 255, 0.06);
}

/* Glass Modals */
.sync-modal,
.history-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  padding: 20px;
}

.sync-modal.active,
.history-modal.active {
  opacity: 1;
  visibility: visible;
}

.sync-modal-overlay,
.history-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.sync-modal-content,
.history-modal-content {
  position: relative;
  background: linear-gradient(
    180deg,
    rgba(40, 40, 50, 0.95) 0%,
    rgba(30, 30, 40, 0.98) 100%
  );
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px 24px;
  max-width: 320px;
  width: 100%;
  text-align: center;
  transform: scale(0.9);
  transition: transform 0.3s;
}

.sync-modal.active .sync-modal-content,
.history-modal.active .history-modal-content {
  transform: scale(1);
}

.sync-modal-icon,
.history-modal-icon {
  margin-bottom: 16px;
  color: var(--muted);
}

.sync-modal-icon svg,
.history-modal-icon svg {
  width: 48px;
  height: 48px;
}

.sync-modal-title,
.history-modal-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 8px 0;
}

.sync-modal-text,
.history-modal-text {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 24px 0;
  line-height: 1.5;
}

.sync-modal-btn,
.history-modal-btn {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
  margin-bottom: 10px;
}

.history-modal-btn.primary {
  background: linear-gradient(135deg, var(--primary) 0%, #0d5fb8 100%);
  border: none;
  box-shadow: 0 4px 12px rgba(22, 137, 255, 0.3);
  margin-bottom: 10px;
}

.history-modal-btn.secondary {
  background: rgba(255, 255, 255, 0.06);
  margin-bottom: 0;
}

.sync-modal-btn:hover,
.history-modal-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-light);
}

.history-modal-btn.primary:hover {
  box-shadow: 0 6px 20px rgba(22, 137, 255, 0.4);
  transform: translateY(-1px);
}

.sync-modal-btn:active,
.history-modal-btn:active {
  transform: scale(0.98);
}

/* ===== FLOATING GLASS TABBAR ===== */
.tabbar {
  position: fixed;
  bottom: 10px;
  left: 16px;
  right: 16px;
  display: flex;
  gap: 6px;
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.tabbar-main {
  flex: 0 1 auto;
  display: flex;
  justify-content: center;
  gap: 2px;
  background: rgba(120, 120, 140, 0.18);
  backdrop-filter: blur(80px) saturate(180%);
  -webkit-backdrop-filter: blur(80px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  padding: 4px 6px;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 6px 12px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 9px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  border-radius: 16px;
  background: transparent;
}

.tab:hover {
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.08);
}

.tab.active {
  color: white;
  background: linear-gradient(135deg, rgba(22, 137, 255, 0.95) 0%, rgba(13, 95, 184, 0.95) 100%);
  box-shadow: 
    0 4px 16px rgba(22, 137, 255, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.tab-icon-wrap {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tab-icon {
  width: 16px;
  height: 16px;
  transition: all 0.3s ease;
  color: rgba(255, 255, 255, 0.5);
  stroke: rgba(255, 255, 255, 0.5);
  fill: none;
}

.tab:hover .tab-icon {
  color: rgba(255, 255, 255, 0.8);
  stroke: rgba(255, 255, 255, 0.8);
}

.tab.active .tab-icon {
  color: white;
  stroke: white;
  fill: white;
}

.tab-label {
  font-size: 9px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.tab.active .tab-label {
  color: white;
}

/* Tab Avatar - Separate Circle */
.tab-avatar {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  backdrop-filter: blur(80px) saturate(180%);
  -webkit-backdrop-filter: blur(80px) saturate(180%);
  border: 2px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  text-decoration: none;
}

.tab-avatar:hover {
  transform: scale(1.05);
  border-color: rgba(255, 255, 255, 0.3);
}

.tab-avatar.active {
  border: 2px solid var(--primary);
  box-shadow: 
    0 0 20px rgba(22, 137, 255, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.tab-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: none;
}

.tab-avatar-img.loaded,
.tab-avatar-img[src]:not([src=""]) {
  display: block;
}

.tab-avatar-img.loaded + .tab-avatar-letter,
.tab-avatar-img[src]:not([src=""]) + .tab-avatar-letter {
  display: none;
}

.tab-avatar-letter {
  font-size: 14px;
  font-weight: 600;
  color: white;
  text-transform: uppercase;
}

/* Referral Block */
.referral-block {
  margin: 16px;
  padding: 16px;
  background: 
    radial-gradient(ellipse at top left, rgba(22, 137, 255, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at top right, rgba(245, 166, 35, 0.1) 0%, transparent 50%),
    linear-gradient(180deg, #1e1e1e 0%, #141414 100%);
  border-radius: 14px;
  border: 1px solid var(--border);
}

.referral-header {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.referral-header-icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  background: linear-gradient(135deg, #1a9fff 0%, #0066cc 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.referral-header-icon svg {
  width: 18px;
  height: 18px;
}

.referral-header-text h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 2px 0;
}

.referral-header-text p {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
  line-height: 1.4;
}

.referral-features {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 14px;
}

.referral-feature {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.referral-feature:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.referral-feature-icon {
  width: 20px;
  height: 20px;
  min-width: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.referral-feature-icon.check {
  color: var(--accent);
}

.referral-feature-icon.star {
  color: #f5a623;
}

.referral-feature-icon.ton img {
  width: 18px;
  height: 18px;
}

.referral-feature-icon svg {
  width: 18px;
  height: 18px;
}

.referral-feature-text h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 2px 0;
}

.referral-feature-text p {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
  line-height: 1.3;
}

.referral-btn {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: none;
  background: var(--primary);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.referral-btn:active {
  transform: scale(0.98);
  opacity: 0.9;
}
