/* CSS Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* CSS Variables */
:root {
  --accent-btn-color: #0088cc;
  --tme-logo-color: #707579;
  --tme-background: #ffffff;
  --tme-text-color: #222222;
  --tme-secondary-color: #707579;
  --tme-border-color: #e8e8e8;
  --tme-hover-color: #f4f4f5;
}

.theme_dark {
  --accent-btn-color: #5288c1;
  --tme-logo-color: #8e9195;
  --tme-background: #17212b;
  --tme-text-color: #ffffff;
  --tme-secondary-color: #8e9195;
  --tme-border-color: #242f3d;
  --tme-hover-color: #242f3d;
}

/* Base Body Styles */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--tme-text-color);
  background-color: var(--tme-background);
  min-height: 100vh;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.no_transition * {
  transition: none !important;
}

/* Background Styles */
.tgme_background_wrap {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
}

.tgme_background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.1;
}

.tgme_background_pattern {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%23000000' fill-opacity='0.03'%3E%3Cpath d='M0 38.59l2.83-2.83 1.41 1.41L1.41 40H0v-1.41zM0 1.4l2.83 2.83 1.41-1.41L1.41 0H0v1.41zM38.59 40l-2.83-2.83 1.41-1.41L40 38.59V40h-1.41zM40 1.41l-2.83 2.83-1.41-1.41L38.59 0H40v1.41zM20 18.6l2.83-2.83 1.41 1.41L21.41 20l2.83 2.83-1.41 1.41L20 21.41l-2.83 2.83-1.41-1.41L18.59 20l-2.83-2.83 1.41-1.41L20 18.59z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.6;
}

.theme_dark .tgme_background_pattern {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M0 38.59l2.83-2.83 1.41 1.41L1.41 40H0v-1.41zM0 1.4l2.83 2.83 1.41-1.41L1.41 0H0v1.41zM38.59 40l-2.83-2.83 1.41-1.41L40 38.59V40h-1.41zM40 1.41l-2.83 2.83-1.41-1.41L38.59 0H40v1.41zM20 18.6l2.83-2.83 1.41 1.41L21.41 20l2.83 2.83-1.41 1.41L20 21.41l-2.83 2.83-1.41-1.41L18.59 20l-2.83-2.83 1.41-1.41L20 18.59z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* Page Wrapper */
.tgme_page_wrap {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header Styles */
.tgme_head_wrap {
  width: 100%;
  background-color: var(--tme-background);
  border-bottom: 1px solid var(--tme-border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background-color 0.2s ease;
}

.tgme_head {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tgme_head_brand {
  text-decoration: none;
  display: flex;
  align-items: center;
}

.tgme_logo {
  display: block;
  height: 34px;
  width: 133px;
}

.tgme_wordmark {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--tme-text-color);
}

.tgme_head_right_btn {
  padding: 8px 16px;
  background-color: transparent;
  color: var(--accent-btn-color);
  text-decoration: none;
  border-radius: 6px;
  font-weight: 500;
  font-size: 14px;
  transition: background-color 0.15s ease;
}

.tgme_head_right_btn:hover {
  background-color: var(--tme-hover-color);
}

/* Body Content */
.tgme_body_wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.tgme_page {
  max-width: 480px;
  width: 100%;
  background-color: var(--tme-background);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 40px;
  text-align: center;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.theme_dark .tgme_page {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Page Photo */
.tgme_page_photo {
  margin-bottom: 24px;
}

.tgme_page_photo a {
  display: inline-block;
  border-radius: 50%;
  overflow: hidden;
  width: 120px;
  height: 120px;
  border: 3px solid var(--accent-btn-color);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tgme_page_photo a:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(0, 136, 204, 0.3);
}

.tgme_page_photo_image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Page Title */
.tgme_page_title {
  font-size: 28px;
  font-weight: 600;
  color: var(--tme-text-color);
  margin-bottom: 8px;
  line-height: 1.3;
}

/* Page Extra (subscriber count) */
.tgme_page_extra {
  font-size: 14px;
  color: var(--tme-secondary-color);
  margin-bottom: 20px;
  font-weight: 400;
}

/* Page Description */
.tgme_page_description {
  font-size: 15px;
  color: var(--tme-text-color);
  line-height: 1.6;
  margin-bottom: 28px;
  white-space: pre-line;
}

/* Action Button */
.tgme_page_action {
  margin-bottom: 20px;
}

.tgme_action_button_new {
  display: inline-block;
  padding: 14px 32px;
  background: linear-gradient(180deg, var(--accent-btn-color) 0%, var(--accent-btn-color) 100%);
  color: #ffffff;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 16px;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 136, 204, 0.3);
}

.tgme_action_button_new:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 136, 204, 0.4);
  background: linear-gradient(180deg, #0099dd 0%, #0077bb 100%);
}

.tgme_action_button_new:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 136, 204, 0.3);
}

/* Shine Effect for Button */
.tgme_action_button_new.shine::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shine 3s infinite;
}

@keyframes shine {
  0% {
    left: -100%;
  }
  20% {
    left: 100%;
  }
  100% {
    left: 100%;
  }
}

/* Page Additional Info */
.tgme_page_additional {
  font-size: 13px;
  color: var(--tme-secondary-color);
  line-height: 1.5;
  padding-top: 20px;
  border-top: 1px solid var(--tme-border-color);
}

.tgme_page_additional strong {
  color: var(--tme-text-color);
  font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
  .tgme_head {
    padding: 12px 16px;
  }

  .tgme_body_wrap {
    padding: 20px 16px;
  }

  .tgme_page {
    padding: 32px 24px;
  }

  .tgme_page_photo a {
    width: 100px;
    height: 100px;
  }

  .tgme_page_title {
    font-size: 24px;
  }

  .tgme_page_description {
    font-size: 14px;
  }

  .tgme_action_button_new {
    padding: 12px 28px;
    font-size: 15px;
  }
}

@media (max-width: 480px) {
  .tgme_head {
    padding: 10px 12px;
  }

  .tgme_logo {
    height: 28px;
    width: auto;
  }

  .tgme_head_right_btn {
    padding: 6px 12px;
    font-size: 13px;
  }

  .tgme_page {
    padding: 24px 20px;
    border-radius: 8px;
  }

  .tgme_page_photo a {
    width: 90px;
    height: 90px;
  }

  .tgme_page_title {
    font-size: 22px;
  }
}

/* Dark Theme Transitions */
body,
.tgme_head_wrap,
.tgme_page,
.tgme_page_title,
.tgme_page_description,
.tgme_page_additional strong {
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
