/* CSS Variables - Default (Light) */
:root {
  --accent-btn-color: #54a9eb;
  --tme-logo-color: #000;
  --bg-color: radial-gradient(ellipse at 20% 50%, #b2c472 0%, transparent 70%),
    radial-gradient(ellipse at 90% 90%, #d9e0b2 0%, transparent 70%), #87b369;
  --text-color: #000000;
  --text-muted: #707579;
  --btn-primary-bg: #54a9eb;
  --header-bg: rgba(255, 255, 255, 0.95);
  --header-border: rgba(0, 0, 0, 0.1);
}

/* Dark Theme - Auto detection */
@media (prefers-color-scheme: dark) {
  :root {
    --accent-btn-color: #54a9eb;
    --tme-logo-color: #fff;
    --bg-color: #000;
    --text-color: #ffffff;
    --text-muted: #7c8a99;
    --btn-primary-bg: #54a9eb;
    --header-bg: rgba(14, 20, 25, 0.95);
    --header-border: rgba(255, 255, 255, 0.05);
  }
}

/* Manual Dark Theme */
html.theme_dark {
  --accent-btn-color: #54a9eb;
  --tme-logo-color: #fff;
  --bg-color: #000;
  --text-color: #ffffff;
  --text-muted: #7c8a99;
  --btn-primary-bg: #54a9eb;
  --header-bg: rgba(14, 20, 25, 0.95);
  --header-border: rgba(255, 255, 255, 0.05);
}

/* Manual Light Theme */
html.theme_light {
  --accent-btn-color: #54a9eb;
  --tme-logo-color: #000;
  --bg-color: radial-gradient(ellipse at 20% 50%, #a2bea9 0%, transparent 70%),
    radial-gradient(ellipse at 90% 90%, #d9e0b2 0%, transparent 70%), #c5d8b7;
  --text-color: #000000;
  --text-muted: #707579;
  --btn-primary-bg: #54a9eb;
  --header-bg: rgba(255, 255, 255, 0.95);
  --header-border: rgba(0, 0, 0, 0.1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.5;
  overflow-x: hidden;
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Background */
.tgme_background_wrap {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  background: var(--bg-color);
}

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

/* Main Layout */
.tgme_page_wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

/* Header */
.tgme_head_wrap {
  background-color: var(--header-bg);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--header-border);
  position: relative;
  z-index: 100;
}

.tgme_head {
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tgme_head_brand {
  display: block;
}

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

/* Body */
.tgme_body_wrap {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 60px 20px;
  position: relative;
}

.tgme_page {
  text-align: center;
  max-width: 420px;
  height: max-content;
  width: 100%;
  background: var(--header-bg);
  border-radius: 12px;
  padding: 40px 30px;
  backdrop-filter: blur(20px);
  border: 1px solid var(--header-border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

/* Bot Photo */
.tgme_page_photo {
  margin-bottom: 24px;
  display: flex;
  justify-content: center;
}

.tgme_page_photo_image {
  width: 124px;
  height: 124px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(45deg, #ff6b9d, #ffa726);
}

.tgme_page_photo_image:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

/* Bot Info */
.tgme_page_title {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-color);
}

.tgme_page_extra {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-weight: 400;
}

.tgme_page_description {
  font-size: 16px;
  color: var(--text-color);
  margin-bottom: 32px;
  line-height: 1.4;
  opacity: 0.9;
}

.tgme_action_button_new {
  display: inline-block;
  background-color: var(--btn-primary-bg);
  color: white;
  padding: 8px 16px;
  border-radius: 64px;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  border: none;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: inherit;
}

.tgme_action_button_new:hover {
  background-color: #429ce3;
}

.tgme_action_button_new.shine {
  background: linear-gradient(45deg, #54a9eb, #429ce3);
}

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

  .tgme_body_wrap {
    padding: 40px 15px;
  }

  .tgme_page {
    padding: 30px 20px;
    margin: 0 10px;
  }

  .tgme_page_title {
    font-size: 24px;
  }

  .tgme_page_photo_image {
    width: 100px;
    height: 100px;
  }

  .tgme_action_button_new {
    padding: 12px 28px;
    font-size: 14px;
    min-width: 180px;
  }
}

@media (max-width: 480px) {
  .tgme_page {
    padding: 25px 15px;
    margin: 0 5px;
  }

  .tgme_page_title {
    font-size: 22px;
  }

  .tgme_page_description {
    font-size: 14px;
  }

  .tgme_action_button_new {
    padding: 10px 24px;
    min-width: 160px;
    font-size: 13px;
  }
}

/* Focus states */
.tgme_action_button_new:focus {
  outline: 2px solid rgba(84, 169, 235, 0.5);
  outline-offset: 2px;
}

/* Selection styles */
::selection {
  background-color: rgba(84, 169, 235, 0.3);
  color: white;
}

.svg-background {
  background-image: url("./pattern.svg");
  background-size: 420px auto;
  background-repeat: repeat;
  opacity: 0.4;
  z-index: -1;
}

/* Dark Theme - Auto detection */
@media (prefers-color-scheme: dark) {
  .svg-background {
    opacity: 0.3;
    filter: invert(48%) sepia(200%) saturate(170%) hue-rotate(80deg)
      brightness(94%) contrast(96%);
  }
}

/* Manual Dark Theme */
html.theme_dark .svg-background {
  opacity: 0.3;
  filter: invert(48%) sepia(200%) saturate(170%) hue-rotate(80deg)
    brightness(94%) contrast(96%);
}

/* Manual Light Theme */
html.theme_light .svg-background {
  opacity: 0.4;
  filter: none;
}
