/* ====================================================================
   TELEGRAM MINI APP KABINETI - MOBIL DIZAYN TIZIMI
   ==================================================================== */

:root {
  --tg-theme-bg-color: #F8FAFC;
  --tg-theme-text-color: #0F172A;
  --tg-theme-hint-color: #64748B;
  --tg-theme-link-color: #2563EB;
  --tg-theme-button-color: #2563EB;
  --tg-theme-button-text-color: #FFFFFF;
  --tg-theme-secondary-bg-color: #FFFFFF;
  
  --primary-blue: #2563EB;
  --accent-gold: #F59E0B;
  --success-green: #10B981;
  --danger-red: #EF4444;
  
  --card-radius: 18px;
  --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.05);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', Roboto, sans-serif;
  background-color: var(--tg-theme-bg-color);
  color: var(--tg-theme-text-color);
  padding-bottom: 80px; /* pastki navigatsiya uchun joy */
  user-select: none;
}

.miniapp-header {
  padding: 16px 20px;
  background: #FFFFFF;
  border-bottom: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-user-info h3 {
  font-size: 16px;
  font-weight: 700;
  color: #0F172A;
}

.header-user-info span {
  font-size: 12px;
  color: #64748B;
}

.avatar-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563EB, #1D4ED8);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
  overflow: hidden;
  flex-shrink: 0;
}

.avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

/* APP SCREENS / TABS */
.tab-content {
  display: none;
  padding: 16px;
}

.tab-content.active {
  display: block;
}

/* 1. SCORE HERO CARD */
.hero-score-card {
  background: linear-gradient(135deg, #1E3A8A, #0F172A);
  color: white;
  border-radius: var(--card-radius);
  padding: 24px 20px;
  margin-bottom: 18px;
  box-shadow: 0 10px 25px rgba(30, 58, 138, 0.25);
  position: relative;
  overflow: hidden;
}

.hero-score-card::after {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 150px;
  height: 150px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}

.hero-main-stat {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 16px;
}

.hero-main-stat .label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #93C5FD;
}

.hero-main-stat .value {
  font-size: 42px;
  font-weight: 800;
  line-height: 1;
}

.hero-sub-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.hero-sub-item .sub-label {
  font-size: 10px;
  color: #94A3B8;
  text-transform: uppercase;
}

.hero-sub-item .sub-value {
  font-size: 16px;
  font-weight: 700;
  color: #F8FAFC;
}

/* QUICK ACTION BUTTONS */
.quick-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}

.action-card-btn {
  background: white;
  padding: 14px;
  border-radius: var(--card-radius);
  border: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  text-decoration: none;
  color: #0F172A;
  font-weight: 600;
  font-size: 13px;
  transition: transform 0.15s;
}

.action-card-btn:active {
  transform: scale(0.97);
}

.action-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

/* CATEGORY POINTS GRID */
.section-title {
  font-size: 14px;
  font-weight: 700;
  color: #0F172A;
  margin: 18px 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.categories-horizontal {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.category-mini-card {
  background: white;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #E2E8F0;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
}

.category-mini-card .cat-name {
  font-size: 11px;
  color: #64748B;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.category-mini-card .cat-pts {
  font-size: 18px;
  font-weight: 800;
  color: #0F172A;
  margin-top: 4px;
}

/* ENTRIES LIST */
.entries-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.entry-item-card {
  background: white;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid #E2E8F0;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.entry-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.entry-title {
  font-size: 13px;
  font-weight: 600;
  color: #0F172A;
}

.entry-pts {
  font-size: 15px;
  font-weight: 800;
}

.entry-pts.pts-pos { color: #10B981; }
.entry-pts.pts-neg { color: #EF4444; }

.entry-meta {
  font-size: 11px;
  color: #64748B;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* BOTTOM NAVIGATION BAR */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: #FFFFFF;
  border-top: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
}

.nav-tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: #94A3B8;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  flex: 1;
}

.nav-tab-btn.active {
  color: var(--primary-blue);
}

.nav-tab-btn .nav-icon {
  font-size: 20px;
}

/* QR SCANNER POPUP MODAL */
.qr-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}

.qr-scanner-box {
  width: 280px;
  height: 280px;
  border: 3px solid #38BDF8;
  border-radius: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 30px rgba(56, 189, 248, 0.4);
}

.scanner-laser {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: #38BDF8;
  box-shadow: 0 0 10px #38BDF8;
  animation: scan 2s linear infinite;
}

@keyframes scan {
  0% { top: 0%; }
  50% { top: 96%; }
  100% { top: 0%; }
}
