/* =========================================================
   TELEGRAM LOADING & REDIRECT PAGE - VINI PERSONAL
   Design and Layout based on Telegram Web App
   ========================================================= */

:root {
  --tg-blue: #2AABEE;
  --tg-blue-hover: #229ED9;
  --tg-blue-dark: #1E88E5;
  --tg-bg-dark: #0f1721;
  --tg-card-bg: #212121;
  --tg-card-border: rgba(255, 255, 255, 0.07);
  --tg-text-white: #ffffff;
  --tg-text-gray: #7e8b9b;
  --tg-text-subtle: #999999;
  --tg-header-bg: #17212b;
  --font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen, Ubuntu, Cantarell, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  width: 100%;
  height: 100%;
  font-family: var(--font-family);
  background-color: var(--tg-bg-dark);
  color: var(--tg-text-white);
  overflow-x: hidden;
  position: relative;
}

/* ---------------------------------------------------------
   BACKGROUND PATTERN
   --------------------------------------------------------- */
.bg-pattern {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('assets/bg.png');
  background-repeat: repeat;
  background-size: 360px auto;
  background-position: center top;
  opacity: 0.85;
  z-index: 1;
  pointer-events: none;
}

.bg-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(14, 22, 33, 0.4) 0%, rgba(10, 15, 24, 0.85) 100%);
  z-index: 2;
  pointer-events: none;
}

/* ---------------------------------------------------------
   HEADER
   --------------------------------------------------------- */
.tg-header {
  position: relative;
  z-index: 10;
  width: 100%;
  background: rgba(23, 33, 43, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.header-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tg-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  cursor: default;
}

.tg-logo-icon {
  width: 34px;
  height: 34px;
  filter: drop-shadow(0 2px 6px rgba(42, 171, 238, 0.4));
  transition: transform 0.3s ease;
}

.tg-brand:hover .tg-logo-icon {
  transform: rotate(-8deg) scale(1.05);
}

.tg-brand-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.2px;
}

.tg-btn-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--tg-blue);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-decoration: none;
  padding: 8px 18px;
  border-radius: 20px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 10px rgba(42, 171, 238, 0.3);
}

.tg-btn-download:hover {
  background-color: var(--tg-blue-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(42, 171, 238, 0.45);
}

/* ---------------------------------------------------------
   MAIN CONTENT & CARD
   --------------------------------------------------------- */
.main-wrapper {
  position: relative;
  z-index: 10;
  min-height: calc(100vh - 65px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 40px;
}

.tg-card {
  width: 100%;
  max-width: 380px;
  background: rgba(33, 33, 33, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--tg-card-border);
  border-radius: 28px;
  padding: 40px 24px 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
  animation: cardFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* ---------------------------------------------------------
   AVATAR WITH ANIMATED RING
   --------------------------------------------------------- */
.avatar-container {
  position: relative;
  width: 130px;
  height: 130px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-ring {
  position: absolute;
  top: -5px;
  left: -5px;
  width: 140px;
  height: 140px;
  transform: rotate(-90deg);
  pointer-events: none;
}

.progress-ring__circle {
  stroke-dasharray: 402.12; /* 2 * PI * 64 */
  stroke-dashoffset: 402.12;
  transition: stroke-dashoffset 0.05s linear;
  filter: drop-shadow(0 0 6px rgba(42, 171, 238, 0.7));
}

.avatar-wrapper {
  position: relative;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  border: 3px solid rgba(255, 255, 255, 0.1);
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.tg-card:hover .avatar-img {
  transform: scale(1.04);
}

.status-indicator {
  position: absolute;
  bottom: 8px;
  right: 12px;
  width: 20px;
  height: 20px;
  background: #212121;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #212121;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.status-dot {
  width: 11px;
  height: 11px;
  background-color: #4cd964;
  border-radius: 50%;
  box-shadow: 0 0 8px #4cd964;
  animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(0.85);
    opacity: 0.8;
  }
}

/* ---------------------------------------------------------
   PROFILE TYPOGRAPHY
   --------------------------------------------------------- */
.profile-name {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--tg-text-white);
  margin-bottom: 5px;
  letter-spacing: -0.3px;
}

.profile-handle {
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--tg-text-gray);
  margin-bottom: 24px;
}

/* ---------------------------------------------------------
   LOADING & PROGRESS SECTION
   --------------------------------------------------------- */
.loading-section {
  width: 100%;
  margin-bottom: 22px;
}

.progress-bar-container {
  width: 100%;
  height: 6px;
  background-color: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.3);
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2AABEE 0%, #00d2ff 100%);
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(42, 171, 238, 0.8);
  transition: width 0.05s linear;
}

.loading-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--tg-text-gray);
}

.loading-text {
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.countdown-badge {
  background: rgba(42, 171, 238, 0.15);
  color: var(--tg-blue);
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.78rem;
  border: 1px solid rgba(42, 171, 238, 0.25);
}

/* ---------------------------------------------------------
   START BOT BUTTON
   --------------------------------------------------------- */
.tg-btn-start {
  position: relative;
  width: 100%;
  height: 50px;
  background-color: var(--tg-blue);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-decoration: none;
  border-radius: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(42, 171, 238, 0.45);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  margin-bottom: 24px;
  cursor: pointer;
}

.tg-btn-start:hover {
  background-color: var(--tg-blue-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(42, 171, 238, 0.6);
}

.tg-btn-start:active {
  transform: translateY(1px);
  box-shadow: 0 2px 10px rgba(42, 171, 238, 0.3);
}

.btn-arrow-icon {
  transition: transform 0.2s ease;
}

.tg-btn-start:hover .btn-arrow-icon {
  transform: translateX(3px);
}

/* Efeito de brilho contínuo no botão */
.tg-btn-start::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -60%;
  width: 40%;
  height: 200%;
  background: linear-gradient(
    60deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.25) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(25deg);
  animation: buttonShine 3s infinite ease-in-out;
}

@keyframes buttonShine {
  0% {
    left: -60%;
  }
  30%, 100% {
    left: 140%;
  }
}

/* ---------------------------------------------------------
   FOOTER NOTICE
   --------------------------------------------------------- */
.footer-notice {
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--tg-text-subtle);
  max-width: 290px;
}

.footer-notice strong {
  color: #d1d5db;
  font-weight: 600;
}

/* ---------------------------------------------------------
   RESPONSIVE ADJUSTMENTS
   --------------------------------------------------------- */
@media (max-width: 420px) {
  .tg-card {
    padding: 32px 18px 28px;
    border-radius: 24px;
  }
  
  .avatar-container {
    width: 120px;
    height: 120px;
    margin-bottom: 18px;
  }

  .avatar-wrapper {
    width: 100px;
    height: 100px;
  }

  .progress-ring {
    width: 130px;
    height: 130px;
    top: -5px;
    left: -5px;
  }

  .profile-name {
    font-size: 1.5rem;
  }

  .profile-handle {
    font-size: 0.9rem;
    margin-bottom: 20px;
  }

  .tg-btn-start {
    height: 48px;
    font-size: 0.95rem;
  }
}
