/* Base & Telegram Theme Variables */
:root {
  --bg-color: var(--tg-theme-bg-color, #ffffff);
  --text-color: var(--tg-theme-text-color, #000000);
  --hint-color: var(--tg-theme-hint-color, #8e8e93);
  --link-color: var(--tg-theme-link-color, #007aff);
  --secondary-bg: var(--tg-theme-secondary-bg-color, #f2f2f7);
  --border-color: rgba(142, 142, 147, 0.2);
  --glass-bg: rgba(255, 255, 255, 0.75); 
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: var(--tg-theme-bg-color, #020B2A);
    --text-color: var(--tg-theme-text-color, #ffffff);
    --secondary-bg: var(--tg-theme-secondary-bg-color, #1B2740);
    --border-color: rgba(255, 255, 255, 0.15);
    --glass-bg: rgba(2, 11, 42, 0.75);
  }
}

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

a, a:link, a:visited, a:hover, a:active {
  text-decoration: none !important;
  color: inherit !important;
  outline: none !important;
  border: none !important;
  -webkit-text-decoration-line: none !important;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  padding-bottom: 120px; 
  overflow-x: hidden;
}

.sticky-header-container {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--glass-bg);
  backdrop-filter: saturate(180%) blur(25px);
  -webkit-backdrop-filter: saturate(180%) blur(25px);
  border-bottom: 1px solid var(--border-color);
}

.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center; 
  padding: 85px 20px 15px; 
}

.header-titles {
  flex: 1; 
  padding-right: 15px; 
}

.date-display {
  font-size: 12px;
  color: var(--hint-color);
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}

.greeting-text {
  font-size: 26px; 
  font-weight: 800;
  letter-spacing: -0.5px;
  margin: 0;
  line-height: 1.2;
}

.premium-badge {
  font-size: 20px;
  display: inline-block;
  animation: shine 2s infinite linear;
}
@keyframes shine {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.profile-icon {
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  max-width: 40px !important;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  display: block;
}

.search-bar-container {
  padding: 5px 20px 15px;
  background-color: transparent; 
}

.search-box {
  display: flex;
  align-items: center;
  background-color: var(--secondary-bg);
  border-radius: 12px;
  padding: 10px 14px;
}

.search-icon {
  width: 18px;
  height: 18px;
  color: var(--hint-color);
  margin-right: 8px;
}

.search-box input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-color);
  font-size: 17px;
  outline: none;
}

.search-box input::placeholder {
  color: var(--hint-color);
}

.featured-section {
  margin-top: 20px;
  margin-bottom: 30px;
}

.carousel {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0 20px 20px;
  gap: 16px;
}

.carousel::-webkit-scrollbar {
  display: none;
}

.hero-card, .quick-app, .card, .tab-item, .see-all {
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.hero-card:active, .quick-app:active, .card:active, .see-all:active {
  transform: scale(0.96);
}

.hero-card {
  flex: 0 0 90%;
  scroll-snap-align: center;
  border-radius: 20px;
  padding: 24px;
  color: white !important; 
  display: flex;
  flex-direction: column;
  height: 240px;
  position: relative;
  overflow: hidden;
}

.hero-tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  opacity: 0.9;
  margin-bottom: 6px;
}

.hero-title {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 8px;
  color: white !important;
}

.hero-subtitle {
  font-size: 15px;
  opacity: 0.9;
  color: white !important;
}

.esign-hero { 
  background: linear-gradient(to bottom, rgba(10, 132, 255, 0.4), rgba(2, 11, 42, 0.9)), url('https://images.unsplash.com/photo-1611162617474-5b21e879e113?q=80&w=1000&auto=format&fit=crop') center/cover no-repeat !important;
  box-shadow: 0 15px 30px rgba(10, 132, 255, 0.4) !important;
}

.flare-hero { 
  background: linear-gradient(to bottom, rgba(255, 45, 85, 0.4), rgba(2, 11, 42, 0.9)), url('https://images.unsplash.com/photo-1550745165-9bc0b252726f?q=80&w=1000&auto=format&fit=crop') center/cover no-repeat !important;
  box-shadow: 0 15px 30px rgba(255, 45, 85, 0.4) !important; 
}

.get-btn {
  background: rgba(255, 255, 255, 0.95);
  color: #FF2D55 !important;
  text-align: center;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  width: max-content;
}

.flare-btn {
  width: 100%;
  padding: 14px 0;
  font-size: 16px;
  border-radius: 25px;
  margin-top: auto;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.section-container {
  padding: 0 20px;
  margin-bottom: 30px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
  margin-bottom: 16px;
}

.section-header h2 {
  font-size: 22px;
  font-weight: 700;
}

.see-all {
  color: var(--link-color) !important;
  font-size: 15px;
  font-weight: 500;
}

.quick-apps-row {
  display: flex;
  overflow-x: auto;
  gap: 18px;
  padding-bottom: 10px;
  scroll-snap-type: x mandatory;
}

.quick-apps-row::-webkit-scrollbar { display: none; }

.quick-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 72px;
  flex-shrink: 0;
  scroll-snap-align: start;
}

.app-icon {
  width: 64px;
  height: 64px;
  background-color: var(--secondary-bg);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin-bottom: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
  overflow: hidden;
}

.app-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.app-name {
  color: var(--text-color) !important;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 2px;
  text-align: center;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-type {
  font-size: 10px;
  color: var(--hint-color) !important;
  text-align: center;
}

.card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

.card:last-child { border-bottom: none; }

.card .left {
  display: flex;
  align-items: center;
  flex: 1;
  overflow: hidden;
}

.card .icon {
  width: 56px !important;
  height: 56px !important;
  min-width: 56px !important;
  max-width: 56px !important;
  border-radius: 14px;
  background-color: var(--secondary-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-right: 14px;
  overflow: hidden;
  flex-shrink: 0;
}

.card .icon img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  display: block;
}

.card .title {
  color: var(--text-color) !important;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card .sub {
  color: var(--hint-color) !important;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-btn {
  background-color: var(--secondary-bg);
  color: var(--link-color) !important;
  font-size: 14px;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 16px;
  margin-left: 10px;
}

.skeleton {
  background-color: var(--secondary-bg);
  background-image: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0));
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite linear;
}

body.theme-light .skeleton {
  background-image: linear-gradient(90deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0));
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.bottom-tab-bar {
  position: fixed;
  bottom: 25px; 
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  min-width: 220px;
  background: var(--glass-bg);
  backdrop-filter: saturate(180%) blur(25px);
  -webkit-backdrop-filter: saturate(180%) blur(25px);
  border: 1px solid var(--border-color);
  border-radius: 40px; 
  display: flex;
  justify-content: space-between;
  gap: 40px;
  padding: 12px 35px;
  z-index: 100;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3); 
}

.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--hint-color) !important;
  font-size: 11px;
  font-weight: 600;
  gap: 4px;
}

.tab-item.active {
  color: var(--link-color) !important;
}

/* --- MANUAL THEME OVERRIDES --- */
body.theme-dark {
  --bg-color: #020B2A !important;
  --text-color: #ffffff !important;
  --hint-color: #8e8e93 !important;
  --secondary-bg: #1B2740 !important;
  --border-color: rgba(255, 255, 255, 0.1) !important;
  --glass-bg: rgba(2, 11, 42, 0.75) !important;
}

body.theme-light {
  --bg-color: #ffffff !important;
  --text-color: #000000 !important;
  --hint-color: #8e8e93 !important;
  --secondary-bg: #f2f2f7 !important;
  --border-color: rgba(142, 142, 147, 0.2) !important;
  --glass-bg: rgba(255, 255, 255, 0.75) !important;
}
