/* Telegram Official Website - Global Styles */
:root {
  --brand-blue: #37AEE2;
  --brand-dark-blue: #0088CC;
  --bg-primary: #FFFFFF;
  --bg-secondary: #F4F4F5;
  --text-primary: #1A1A1A;
  --text-secondary: #555555;
  --text-muted: #888888;
  --border-color: #E8E8E8;
  --card-bg: #FFFFFF;
  --card-shadow: 0 2px 12px rgba(0,0,0,0.08);
  --nav-bg: #FFFFFF;
  --footer-bg: #1A1A1A;
  --footer-text: #CCCCCC;
  --warm-beige: #A19679;
}

[data-theme="dark"] {
  --bg-primary: #17212B;
  --bg-secondary: #0E1621;
  --text-primary: #FFFFFF;
  --text-secondary: #AAAAAA;
  --text-muted: #777777;
  --border-color: #2B3A48;
  --card-bg: #232E3C;
  --card-shadow: 0 2px 12px rgba(0,0,0,0.3);
  --nav-bg: #17212B;
  --footer-bg: #0E1621;
  --footer-text: #888888;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

a {
  color: var(--brand-blue);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--brand-dark-blue);
}

/* ===== Top Navigation ===== */
.top-nav {
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: background-color 0.3s ease;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.nav-logo svg {
  width: 36px;
  height: 36px;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 8px;
}

.nav-menu li a {
  display: block;
  padding: 8px 16px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.nav-menu li a:hover,
.nav-menu li a.active {
  color: var(--brand-blue);
  background: rgba(55, 174, 226, 0.08);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-right a {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  transition: all 0.2s ease;
}

.nav-right a:hover {
  color: var(--brand-blue);
  border-color: var(--brand-blue);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-toggle:hover {
  border-color: var(--brand-blue);
  color: var(--brand-blue);
}

/* ===== Hero Section ===== */
.hero {
  text-align: center;
  padding: 80px 20px 60px;
  background: var(--bg-primary);
}

.hero-logo {
  width: 140px;
  height: 140px;
  margin: 0 auto 30px;
}

.hero h1 {
  font-size: 48px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  letter-spacing: -1px;
}

.hero p {
  font-size: 20px;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  background: var(--brand-blue);
  color: #FFFFFF;
  font-size: 16px;
  font-weight: 600;
  border-radius: 12px;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background: var(--brand-dark-blue);
  color: #FFFFFF;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(55, 174, 226, 0.3);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  background: transparent;
  color: var(--brand-blue);
  font-size: 16px;
  font-weight: 600;
  border: 2px solid var(--brand-blue);
  border-radius: 12px;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(55, 174, 226, 0.08);
  color: var(--brand-blue);
  transform: translateY(-1px);
}

/* ===== Section Common ===== */
.section {
  padding: 80px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.section-title {
  text-align: center;
  font-size: 36px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.section-subtitle {
  text-align: center;
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 48px;
}

/* ===== Feature Cards ===== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 32px 24px;
  text-align: center;
  transition: all 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow);
  border-color: var(--brand-blue);
}

.card-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  background: rgba(55, 174, 226, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}

.feature-card h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.feature-card p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ===== News Section ===== */
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.news-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.news-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow);
}

.news-thumb {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-dark-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-size: 40px;
}

.news-body {
  padding: 20px;
}

.news-date {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.news-card h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.4;
}

.news-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.news-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 36px;
}

.news-header h2 {
  font-size: 36px;
  font-weight: 700;
  color: var(--text-primary);
}

.news-header a {
  font-size: 15px;
  font-weight: 600;
  color: var(--brand-blue);
}

/* ===== FAQ Section ===== */
.faq-category {
  margin-bottom: 48px;
}

.faq-category h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--brand-blue);
  display: inline-block;
}

.faq-item {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 16px;
}

.faq-item h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.faq-steps {
  list-style: none;
  counter-reset: step-counter;
}

.faq-steps li {
  counter-increment: step-counter;
  padding: 10px 0 10px 40px;
  position: relative;
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
  border-bottom: 1px solid var(--border-color);
}

.faq-steps li:last-child {
  border-bottom: none;
}

.faq-steps li::before {
  content: counter(step-counter);
  position: absolute;
  left: 0;
  top: 10px;
  width: 28px;
  height: 28px;
  background: rgba(55, 174, 226, 0.1);
  color: var(--brand-blue);
  font-weight: 700;
  font-size: 13px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== Apps / Download Page ===== */
.apps-hero {
  text-align: center;
  padding: 60px 20px 40px;
}

.apps-hero h1 {
  font-size: 40px;
  font-weight: 700;
  margin-bottom: 16px;
}

.apps-hero p {
  font-size: 18px;
  color: var(--text-secondary);
}

.platforms-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
}

.platform-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 32px 24px;
  text-align: center;
  transition: all 0.3s ease;
}

.platform-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow);
  border-color: var(--brand-blue);
}

.platform-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.platform-card h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.platform-card p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.platform-card .btn-primary {
  width: 100%;
  justify-content: center;
  padding: 12px 24px;
  font-size: 15px;
}

/* ===== API Page ===== */
.api-content {
  max-width: 800px;
  margin: 0 auto;
}

.api-content h2 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 40px 0 16px;
}

.api-content h2:first-child {
  margin-top: 0;
}

.api-content p {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 16px;
}

.api-content ul {
  padding-left: 24px;
  margin-bottom: 16px;
}

.api-content li {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 8px;
}

.api-links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 24px 0;
}

.api-link-card {
  display: block;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  transition: all 0.3s ease;
}

.api-link-card:hover {
  border-color: var(--brand-blue);
  box-shadow: var(--card-shadow);
  transform: translateY(-2px);
}

.api-link-card h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.api-link-card p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 0;
}

/* ===== Safety Page ===== */
.safety-hero {
  text-align: center;
  padding: 60px 20px 40px;
}

.safety-hero h1 {
  font-size: 40px;
  font-weight: 700;
  margin-bottom: 16px;
}

.safety-hero p {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto;
}

.safety-features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
}

.safety-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 28px;
  transition: all 0.3s ease;
}

.safety-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow);
}

.safety-card .card-icon {
  width: 56px;
  height: 56px;
  margin: 0 0 16px;
  font-size: 28px;
}

.safety-card h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.safety-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ===== Blog Page ===== */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.blog-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow);
}

.blog-thumb {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-dark-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-size: 48px;
}

.blog-body {
  padding: 24px;
}

.blog-date {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.blog-card h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
  line-height: 1.4;
}

.blog-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ===== Footer ===== */
.site-footer {
  background: var(--footer-bg);
  padding: 60px 20px 30px;
  margin-top: 60px;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand p {
  font-size: 14px;
  color: var(--footer-text);
  line-height: 1.6;
  margin-top: 12px;
}

.footer-brand .footer-logo {
  font-size: 22px;
  font-weight: 700;
  color: #FFFFFF;
}

.footer-col h4 {
  font-size: 15px;
  font-weight: 600;
  color: #FFFFFF;
  margin-bottom: 16px;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 10px;
}

.footer-col a {
  font-size: 14px;
  color: var(--footer-text);
  transition: color 0.2s ease;
}

.footer-col a:hover {
  color: var(--brand-blue);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--footer-text);
}

/* ===== Responsive ===== */
@media (max-width: 992px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .news-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .safety-features {
    grid-template-columns: 1fr;
  }
  .api-links {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nav-menu {
    display: none;
  }
  .hero h1 {
    font-size: 32px;
  }
  .hero p {
    font-size: 16px;
  }
  .section-title {
    font-size: 28px;
  }
  .cards-grid,
  .news-grid,
  .platforms-grid {
    grid-template-columns: 1fr;
  }
  .blog-grid {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .hero-actions {
    flex-direction: column;
    align-items: center;
  }
  .hidden-xs {
    display: none;
  }
}

@media (max-width: 480px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .nav-right a span {
    display: none;
  }
}
