/*
Theme Name: TGPlug
Theme URI: https://tgplug.com
Author: TGPlug Team
Author URI: https://tgplug.com
Description: A Telegram analytics platform theme inspired by tgstat.com
Version: 1.0.0
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tgplug
Domain Path: /languages
Tags: telegram, analytics, channels, groups, statistics
*/

/* ===== CSS Variables ===== */
:root {
  --primary-color: #3498db;
  --primary-dark: #2980b9;
  --secondary-color: #2c3e50;
  --accent-color: #e74c3c;
  --success-color: #27ae60;
  --warning-color: #f39c12;
  --text-color: #333;
  --text-light: #666;
  --text-muted: #999;
  --bg-color: #f5f7fa;
  --bg-white: #fff;
  --border-color: #e1e4e8;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --transition: all 0.3s ease;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

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

img {
  max-width: 100%;
  height: auto;
}

/* ===== Header ===== */
.site-header {
  background: var(--secondary-color);
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 1000;
}

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

.site-branding {
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-logo {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-logo img {
  height: 32px;
  width: auto;
}

/* ===== Navigation ===== */
.main-navigation {
  display: flex;
  align-items: center;
  gap: 30px;
}

.nav-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 25px;
}

.nav-menu a {
  color: rgba(255,255,255,0.85);
  font-weight: 500;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
}

.nav-menu a:hover,
.nav-menu a.active {
  color: #fff;
}

.nav-menu i {
  font-size: 12px;
}

/* Search Box */
.header-search {
  position: relative;
}

.header-search input {
  width: 280px;
  padding: 10px 15px 10px 40px;
  border: none;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-size: 14px;
  transition: var(--transition);
}

.header-search input::placeholder {
  color: rgba(255,255,255,0.6);
}

.header-search input:focus {
  background: rgba(255,255,255,0.15);
  outline: none;
}

.header-search i {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,0.6);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.btn-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.1);
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.btn-icon:hover {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

.btn-login {
  padding: 8px 20px;
  background: var(--primary-color);
  color: #fff;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 14px;
}

.btn-login:hover {
  background: var(--primary-dark);
  color: #fff;
}

/* ===== Main Content ===== */
.site-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 30px 20px;
  min-height: calc(100vh - 60px - 300px);
}

/* ===== Page Header ===== */
.page-header {
  text-align: center;
  margin-bottom: 40px;
}

.page-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--secondary-color);
  margin: 0 0 10px;
}

.page-description {
  font-size: 16px;
  color: var(--text-light);
  max-width: 600px;
  margin: 0 auto;
}

/* ===== Category Cards ===== */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.category-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 25px;
  transition: var(--transition);
  border: 1px solid var(--border-color);
}

.category-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.category-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
}

.category-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.category-icon.betting { background: #e8f5e9; color: #4caf50; }
.category-icon.crypto { background: #fff3e0; color: #ff9800; }
.category-icon.business { background: #e3f2fd; color: #2196f3; }
.category-icon.news { background: #fce4ec; color: #e91e63; }
.category-icon.tech { background: #f3e5f5; color: #9c27b0; }
.category-icon.entertainment { background: #e0f2f1; color: #009688; }
.category-icon.education { background: #e8eaf6; color: #3f51b5; }
.category-icon.lifestyle { background: #fff8e1; color: #ffc107; }

.category-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--secondary-color);
  margin: 0;
}

.category-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-bottom: 20px;
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--secondary-color);
  display: block;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.category-btn {
  display: block;
  width: 100%;
  padding: 12px;
  background: var(--bg-color);
  color: var(--primary-color);
  text-align: center;
  border-radius: var(--radius-md);
  font-weight: 500;
  transition: var(--transition);
}

.category-btn:hover {
  background: var(--primary-color);
  color: #fff;
}

/* ===== Channel Cards ===== */
.channels-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.channel-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  transition: var(--transition);
  border: 1px solid var(--border-color);
}

.channel-card:hover {
  box-shadow: var(--shadow-md);
}

.channel-rank {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 40px;
  text-align: center;
}

.channel-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.channel-info {
  flex: 1;
  min-width: 0;
}

.channel-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--secondary-color);
  margin: 0 0 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.channel-category {
  display: inline-block;
  padding: 3px 10px;
  background: var(--bg-color);
  color: var(--text-light);
  font-size: 12px;
  border-radius: 20px;
}

.channel-stats {
  display: flex;
  gap: 30px;
  align-items: center;
}

.channel-stat {
  text-align: center;
}

.channel-stat-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--secondary-color);
  display: block;
}

.channel-stat-label {
  font-size: 11px;
  color: var(--text-muted);
}

.channel-actions {
  display: flex;
  gap: 10px;
}

.btn-action {
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
}

.btn-primary {
  background: var(--primary-color);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--text-light);
  border: 1px solid var(--border-color);
}

.btn-outline:hover {
  background: var(--bg-color);
  color: var(--text-color);
}

/* ===== Filters & Sorting ===== */
.filters-bar {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 15px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 15px;
  box-shadow: var(--shadow-sm);
}

.filter-tabs {
  display: flex;
  gap: 5px;
}

.filter-tab {
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-light);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.filter-tab:hover {
  background: var(--bg-color);
  color: var(--text-color);
}

.filter-tab.active {
  background: var(--secondary-color);
  color: #fff;
}

.sort-dropdown {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sort-dropdown label {
  font-size: 13px;
  color: var(--text-light);
}

.sort-dropdown select {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 13px;
  background: var(--bg-white);
  cursor: pointer;
}

/* ===== Sidebar ===== */
.sidebar {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.sidebar-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--secondary-color);
  margin: 0 0 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.category-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.category-list li {
  margin-bottom: 5px;
}

.category-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--text-color);
  font-size: 14px;
  transition: var(--transition);
}

.category-list a:hover,
.category-list a.active {
  background: var(--bg-color);
  color: var(--primary-color);
}

.category-list .count {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-color);
  padding: 2px 8px;
  border-radius: 10px;
}

/* ===== Pagination ===== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  margin-top: 40px;
}

.page-link {
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text-color);
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.page-link:hover {
  background: var(--bg-color);
}

.page-link.active {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
}

.page-link.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===== Footer ===== */
.site-footer {
  background: var(--secondary-color);
  color: rgba(255,255,255,0.7);
  padding: 50px 0 20px;
  margin-top: 60px;
}

.footer-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
  margin-bottom: 40px;
}

.footer-section h4 {
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 20px;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

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

.footer-links a {
  color: rgba(255,255,255,0.7);
  font-size: 14px;
}

.footer-links a:hover {
  color: #fff;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.footer-copyright {
  font-size: 13px;
}

.footer-social {
  display: flex;
  gap: 15px;
}

.footer-social a {
  color: rgba(255,255,255,0.7);
  font-size: 18px;
}

.footer-social a:hover {
  color: #fff;
}

/* ===== Responsive ===== */
@media (max-width: 1200px) {
  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 992px) {
  .header-search {
    display: none;
  }
  
  .main-navigation {
    display: none;
  }
  
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .categories-grid {
    grid-template-columns: 1fr;
  }
  
  .channel-card {
    flex-wrap: wrap;
  }
  
  .channel-stats {
    width: 100%;
    justify-content: space-around;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
  }
  
  .filters-bar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
  }
  
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}

/* ===== Utilities ===== */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

.text-center {
  text-align: center;
}

.text-muted {
  color: var(--text-muted);
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }
.mb-4 { margin-bottom: 40px; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mt-4 { margin-top: 40px; }

.d-flex {
  display: flex;
}

.align-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-2 {
  gap: 20px;
}

/* ===== Loading States ===== */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: var(--radius-md);
}

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

/* ===== Badges ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-verified {
  background: #e8f5e9;
  color: #4caf50;
}

.badge-premium {
  background: #fff3e0;
  color: #ff9800;
}

.badge-new {
  background: #e3f2fd;
  color: #2196f3;
}