/*
Theme Name: TGPlug Pro
Theme URI: https://tgplug.com
Author: TGPlug Team
Author URI: https://tgplug.com
Description: Premium Telegram Analytics Platform for Betting, iGaming, Crypto & Business
Version: 2.0
License: GPL v2
Text Domain: tgplug
*/

/* CSS Variables */
:root {
    --primary: #e85d4c;
    --primary-light: #fef2f2;
    --primary-dark: #c2412c;
    --secondary: #0d9488;
    --secondary-light: #f0fdfa;
    --accent: #f59e0b;
    --accent-light: #fffbeb;
    --purple: #8b5cf6;
    --purple-light: #f5f3ff;
    --betting: #c2412c;
    --crypto: #7c3aed;
    --business: #059669;
    --bg-body: #fafaf9;
    --bg-card: #ffffff;
    --bg-warm: #fff7ed;
    --text-primary: #1c1917;
    --text-secondary: #78716c;
    --text-muted: #a8a29e;
    --border-color: #e7e5e4;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
}

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

/* Header */
.tg-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.tg-header-top {
    background: linear-gradient(90deg, var(--betting) 0%, var(--primary) 100%);
    color: white;
    padding: 10px 0;
    font-size: 13px;
}

.tg-header-top-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tg-header-top a {
    color: white;
    text-decoration: none;
    font-weight: 600;
}

.tg-header-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 32px;
}

/* Logo */
.tg-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.tg-logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--betting) 0%, var(--primary) 100%);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.tg-logo-text {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.tg-logo-text span {
    color: var(--betting);
}

/* Search Box - Clean TGStat Style */
.tg-search-box {
    flex: 1;
    max-width: 500px;
    position: relative;
}

.tg-search-box input {
    width: 100%;
    padding: 14px 20px 14px 48px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-xl);
    font-size: 15px;
    transition: all 0.2s;
    background: var(--bg-body);
}

.tg-search-box input:focus {
    outline: none;
    border-color: var(--betting);
    background: var(--bg-card);
}

.tg-search-box i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 18px;
}

/* Search Dropdown - TGStat Style */
.tg-search-dropdown-custom {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    max-height: 320px;
    overflow-y: auto;
    z-index: 9999;
    display: none;
    border: 1px solid #e7e5e4;
}

.tg-search-dropdown-custom.active {
    display: block;
}

/* Navigation */
.tg-nav-menu {
    flex: 1;
}

.tg-nav-list {
    display: flex;
    list-style: none;
    gap: 8px;
    justify-content: center;
}

.tg-nav-list a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.tg-nav-list a:hover,
.tg-nav-list a.current-menu-item {
    background: var(--primary-light);
    color: var(--betting);
}

/* User Menu */
.tg-user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tg-btn-login {
    padding: 10px 20px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 14px;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.tg-btn-login:hover {
    color: var(--betting);
}

.tg-btn-signup {
    padding: 10px 20px;
    background: var(--betting);
    color: white;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
}

.tg-btn-signup:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* Featured Ads */
.tg-featured-ads {
    background: linear-gradient(90deg, var(--accent-light) 0%, var(--primary-light) 100%);
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    overflow: hidden;
}

.tg-featured-ads-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.tg-featured-ads-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    white-space: nowrap;
}

.tg-featured-ads-scroll {
    flex: 1;
    overflow: hidden;
}

.tg-featured-ads-track {
    display: flex;
    gap: 24px;
    animation: scroll 30s linear infinite;
}

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.tg-featured-ad-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
}

.tg-featured-ad-item:hover {
    border-color: var(--betting);
    color: var(--betting);
}

.tg-featured-ad-item img {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
}

.tg-ad-badge {
    padding: 2px 8px;
    background: var(--accent);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 10px;
    font-weight: 700;
}

/* Hero Section */
.tg-hero {
    background: linear-gradient(135deg, #7c2d22 0%, #a03a2a 50%, #c2412c 100%);
    padding: 80px 24px;
    position: relative;
    overflow: hidden;
    color: white;
}

.tg-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.1;
    pointer-events: none;
}

.tg-hero-content {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 1;
}

.tg-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    padding: 10px 20px;
    border-radius: var(--radius-xl);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 24px;
    border: 1px solid rgba(255,255,255,0.2);
}

.tg-hero h1 {
    font-size: 52px;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 20px;
    color: white;
}

.tg-hero h1 span {
    background: linear-gradient(90deg, #fcd34d 0%, #fbbf24 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tg-hero p {
    font-size: 20px;
    color: rgba(255,255,255,0.85);
    max-width: 700px;
    margin: 0 auto 40px;
}

.tg-hero-stats {
    display: flex;
    justify-content: center;
    gap: 64px;
    margin-top: 48px;
}

.tg-hero-stat {
    text-align: center;
}

.tg-hero-stat-value {
    font-size: 42px;
    font-weight: 800;
    color: #fcd34d;
}

.tg-hero-stat-label {
    font-size: 14px;
    color: rgba(255,255,255,0.75);
    font-weight: 500;
}

/* Categories */
.tg-categories {
    max-width: 1400px;
    margin: -30px auto 0;
    padding: 0 24px;
    position: relative;
    z-index: 2;
}

.tg-category-pills {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.tg-category-pill {
    padding: 16px 32px;
    background: white;
    border-radius: var(--radius-xl);
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 15px;
    box-shadow: var(--shadow-lg);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 2px solid transparent;
}

.tg-category-pill:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.15);
    border-color: var(--cat-color, var(--primary));
}

.tg-category-pill i {
    font-size: 20px;
    color: var(--cat-color, var(--primary));
}

.tg-category-count {
    margin-left: 8px;
    padding: 4px 12px;
    background: var(--cat-color, var(--primary));
    color: white;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* Main Content */
.tg-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 48px 24px;
}

.tg-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.tg-section-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.tg-view-all {
    color: var(--betting);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tg-view-all:hover {
    text-decoration: underline;
}

/* Elementor Content Area */
.tg-elementor-content {
    margin-bottom: 48px;
}

/* Channel Cards */
.tg-channels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 20px;
    margin-bottom: 48px;
}

.tg-channel-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
    transition: all 0.2s;
    border: 1px solid var(--border-color);
    position: relative;
}

.tg-channel-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--betting);
}

.tg-channel-card.featured::before {
    content: 'SPONSORED';
    position: absolute;
    top: -1px;
    right: 20px;
    background: linear-gradient(90deg, var(--accent) 0%, #f97316 100%);
    color: white;
    padding: 4px 12px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.tg-channel-card.igaming {
    border-left: 4px solid var(--purple);
}

.tg-channel-header {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.tg-channel-avatar {
    width: 68px;
    height: 68px;
    border-radius: var(--radius);
    object-fit: cover;
    border: 3px solid white;
    box-shadow: var(--shadow);
}

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

.tg-channel-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.tg-channel-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.tg-channel-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
}

.tg-channel-badge.betting {
    background: #fee2e2;
    color: var(--betting);
}

.tg-channel-badge.crypto {
    background: #ede9fe;
    color: var(--crypto);
}

.tg-channel-badge.business {
    background: #d1fae5;
    color: var(--business);
}

.tg-channel-badge.verified {
    background: #dbeafe;
    color: #2563eb;
}

.tg-channel-badge.vip {
    background: #fef3c7;
    color: #d97706;
}

.tg-channel-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

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

.tg-channel-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.tg-channel-stat-value.up {
    color: var(--secondary);
}

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

.tg-channel-stat-change {
    font-size: 11px;
    font-weight: 600;
}

.tg-channel-stat-change.positive {
    color: var(--secondary);
}

/* Rankings */
.tg-rankings-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 48px;
}

.tg-rankings-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    overflow-x: auto;
    border-bottom: 1px solid var(--border-color);
}

.tg-rankings-tab {
    padding: 10px 20px;
    border: none;
    background: var(--bg-body);
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.tg-rankings-tab:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.tg-rankings-tab.active {
    background: var(--primary);
    color: white;
}

.tg-rankings-table {
    width: 100%;
}

.tg-rankings-row {
    display: grid;
    grid-template-columns: 50px 60px 1fr 120px 120px 100px;
    align-items: center;
    padding: 14px 16px;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.tg-rankings-row:hover {
    background: var(--bg-body);
}

.tg-rankings-row.header {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
}

.tg-rank-number {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-muted);
}

.tg-rank-number.top {
    color: var(--accent);
}

.tg-rank-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.tg-rank-channel-info {
    padding-left: 8px;
}

.tg-rank-channel-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.tg-rank-channel-username {
    font-size: 12px;
    color: var(--text-muted);
}

.tg-rank-value {
    font-weight: 700;
    color: var(--text-primary);
}

.tg-rank-value.highlight {
    color: var(--betting);
}

.tg-rank-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
}

.tg-rank-change.up {
    background: #d1fae5;
    color: #059669;
}

.tg-rank-action {
    padding: 8px 14px;
    background: var(--betting);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.tg-rank-action:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

/* Analytics Section - Homepage */
.tg-analytics-section {
    background: linear-gradient(135deg, var(--purple-light) 0%, var(--primary-light) 100%);
    border-radius: 24px;
    padding: 48px;
    margin-bottom: 48px;
    border: 1px solid var(--border-color);
    clear: both;
    display: block;
    width: 100%;
}

.tg-analytics-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
}

.tg-analytics-text h2 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
}

.tg-analytics-text p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.6;
}

.tg-feature-list {
    list-style: none;
    margin-bottom: 32px;
}

.tg-feature-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--text-primary);
}

.tg-feature-list li i {
    color: var(--secondary);
    font-size: 16px;
}

/* CSS Chart Styling */
.tg-analytics-chart {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.tg-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-weight: 600;
    font-size: 14px;
}

.tg-chart-legend {
    display: flex;
    gap: 16px;
}

.tg-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.tg-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.tg-chart-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 180px;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 8px;
}

.tg-chart-bar {
    flex: 1;
    border-radius: 6px 6px 0 0;
    min-height: 20px;
    transition: all 0.3s;
    position: relative;
}

.tg-chart-bar:hover {
    opacity: 0.8;
}

.tg-chart-bar::after {
    content: attr(data-value);
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    opacity: 0;
    transition: opacity 0.2s;
}

.tg-chart-bar:hover::after {
    opacity: 1;
}

.tg-chart-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-secondary);
}

/* Compare CTA */
.tg-compare-cta {
    background: white;
    border-radius: 24px;
    padding: 48px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 2px dashed var(--border-color);
    margin-bottom: 48px;
    clear: both;
    display: block;
    width: 100%;
}

.tg-compare-cta h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-primary);
}

.tg-compare-cta h3 i {
    color: var(--secondary);
}

.tg-compare-cta p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* Buttons */
.tg-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.tg-btn-primary {
    background: var(--betting);
    color: white;
}

.tg-btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(220, 38, 38, 0.4);
}

.tg-btn-secondary {
    background: var(--secondary);
    color: white;
}

.tg-btn-secondary:hover {
    background: #0d9488;
}

/* Footer */
.tg-footer {
    background: #0c0a09;
    color: white;
    padding: 64px 24px 32px;
    margin-top: 64px;
}

.tg-footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: 48px;
}

.tg-footer-brand {
    max-width: 320px;
}

.tg-footer-brand h3 {
    font-size: 24px;
    margin-bottom: 16px;
}

.tg-footer-brand p {
    color: rgba(255,255,255,0.7);
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.7;
}

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

.tg-footer-social a {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.2s;
}

.tg-footer-social a:hover {
    background: var(--betting);
    transform: translateY(-2px);
}

.tg-footer-column h4 {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
    color: #d6d3d1;
}

.tg-footer-column ul {
    list-style: none;
}

.tg-footer-column li {
    margin-bottom: 12px;
}

.tg-footer-column a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.tg-footer-column a:hover {
    color: var(--betting);
}

.tg-footer-bottom {
    max-width: 1400px;
    margin: 48px auto 0;
    padding-top: 32px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #78716c;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 1200px) {
    .tg-footer-content {
        grid-template-columns: 1fr 1fr;
    }
    
    .tg-analytics-content {
        grid-template-columns: 1fr;
    }
    
    .tg-analytics-chart {
        order: -1;
    }
}

@media (max-width: 1024px) {
    .tg-hero h1 {
        font-size: 42px;
    }
    
    .tg-rankings-row {
        grid-template-columns: 40px 50px 1fr 100px 80px;
    }
    
    .tg-rankings-row.header {
        display: none;
    }
    
    .tg-channels-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .tg-header-main {
        flex-wrap: wrap;
        gap: 16px;
    }
    
    .tg-search-box {
        order: 3;
        max-width: 100%;
        flex-basis: 100%;
    }
    
    .tg-nav-menu {
        display: none;
    }
    
    .tg-hero {
        padding: 48px 24px;
    }
    
    .tg-hero h1 {
        font-size: 32px;
    }
    
    .tg-hero-stats {
        flex-direction: column;
        gap: 24px;
    }
    
    .tg-category-pills {
        flex-direction: column;
        align-items: center;
    }
    
    .tg-analytics-section {
        padding: 24px;
    }
    
    .tg-rankings-tabs {
        flex-wrap: nowrap;
        overflow-x: scroll;
    }
    
    .tg-footer-content {
        grid-template-columns: 1fr;
    }
    
    .tg-footer-bottom {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
}

/* Font Awesome Fix */
.fas, .fab, .far {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    display: inline-block;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    line-height: 1;
}

.fab {
    font-family: "Font Awesome 6 Brands";
    font-weight: 400;
}

/* Admin Bar Fix */
body.admin-bar .tg-header {
    top: 32px;
}

@media (max-width: 782px) {
    body.admin-bar .tg-header {
        top: 46px;
    }
}

/* Rankings Page Specific Styles */
.page-template-page-rankings .tg-rankings-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.page-template-page-rankings .tg-rankings-row.header {
    background: var(--bg-body);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.page-template-page-rankings .tg-rankings-row:hover {
    background: var(--bg-body);
}

/* Filter tabs as links */
.tg-rankings-tabs a {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.tg-rankings-tabs a.active {
    background: var(--primary);
    color: white;
}

/* ============================================
   RANKINGS PAGE - CLEAN & RESPONSIVE
   ============================================ */

.rankings-page {
    padding: 40px 24px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Header */
.rankings-header {
    margin-bottom: 32px;
}

.rankings-header h1 {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.rankings-header h1 i {
    color: var(--primary);
}

.rankings-header p {
    color: var(--text-secondary);
    font-size: 16px;
}

/* Filter Tabs */
.rankings-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.rankings-tabs a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 100px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s;
}

.rankings-tabs a:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.rankings-tabs a.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Desktop Table */
.rankings-table-wrap {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
    margin-bottom: 32px;
}

.rankings-table {
    width: 100%;
    border-collapse: collapse;
}

.rankings-table thead {
    background: var(--bg-body);
}

.rankings-table th {
    padding: 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.rankings-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.rankings-table tbody tr:hover {
    background: var(--bg-body);
}

.rankings-table tbody tr:last-child td {
    border-bottom: none;
}

/* Column widths */
.col-rank { width: 80px; text-align: center; }
.col-channel { min-width: 250px; }
.col-category { width: 140px; }
.col-subscribers { width: 140px; text-align: center; }
.col-growth { width: 120px; text-align: center; }
.col-winrate { width: 100px; text-align: center; }
.col-action { width: 120px; text-align: center; }

/* Rank number */
.rank-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 16px;
    color: var(--text-secondary);
    background: var(--bg-body);
}

.rank-number.top {
    background: var(--primary);
    color: white;
}

/* Channel cell */
.channel-cell {
    display: flex;
    align-items: center;
    gap: 16px;
}

.channel-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: cover;
}

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

.channel-name {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

/* Category badge */
.category-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

/* Stats */
.stat-value {
    font-weight: 700;
    font-size: 16px;
    color: var(--text-primary);
}

.growth-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: #d1fae5;
    color: #059669;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
}

.winrate-value {
    font-weight: 700;
    font-size: 16px;
    color: var(--accent);
}

/* View button */
.view-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.view-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

/* Mobile cards (hidden on desktop) */
.mobile-only {
    display: none;
}

.rankings-mobile {
    display: none;
}

.ranking-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.ranking-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.ranking-card-header .rank-number {
    flex-shrink: 0;
}

.ranking-card-header .channel-avatar {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
}

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

.ranking-card-header .category-badge {
    margin-top: 6px;
    background: var(--primary-light);
    color: var(--primary);
}

.ranking-card-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 16px;
    background: var(--bg-body);
    border-radius: 12px;
    margin-bottom: 16px;
}

.ranking-card-stats .stat {
    text-align: center;
}

.ranking-card-stats .stat-label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.ranking-card-stats .stat-value {
    display: block;
    font-size: 18px;
    font-weight: 700;
}

.view-btn-full {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.view-btn-full:hover {
    background: var(--primary-dark);
}

/* Load more */
.load-more-wrap {
    text-align: center;
    margin-bottom: 48px;
}

.load-more-btn {
    padding: 14px 32px;
    font-size: 15px;
}

/* Stats summary */
.stats-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 32px 24px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-4px);
}

.stat-card i {
    font-size: 32px;
    margin-bottom: 16px;
    color: var(--primary);
}

.stat-card:nth-child(2) i { color: var(--secondary); }
.stat-card:nth-child(3) i { color: #e85d4c; }
.stat-card:nth-child(4) i { color: var(--purple); }

.stat-card .stat-number {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.stat-card .stat-label {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

@media (max-width: 1024px) {
    .rankings-tabs a span {
        display: none;
    }
    
    .rankings-tabs a {
        padding: 12px 16px;
    }
    
    .stats-summary {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .rankings-page {
        padding: 24px 16px;
    }
    
    .rankings-header h1 {
        font-size: 24px;
    }
    
    .rankings-tabs {
        gap: 8px;
    }
    
    .rankings-tabs a {
        padding: 10px 14px;
        font-size: 13px;
    }
    
    /* Hide desktop table */
    .desktop-only {
        display: none !important;
    }
    
    /* Show mobile cards */
    .mobile-only {
        display: block !important;
    }
    
    .rankings-mobile {
        display: block;
    }
    
    .stats-summary {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .stat-card {
        padding: 24px 16px;
    }
    
    .stat-card i {
        font-size: 24px;
    }
    
    .stat-card .stat-number {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .rankings-tabs a {
        padding: 8px 12px;
    }
    
    .rankings-tabs a i {
        font-size: 16px;
    }
    
    .ranking-card-stats {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .ranking-card-stats .stat {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: left;
    }
    
    .stats-summary {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   COMPARE PAGE STYLES
   ============================================ */

.compare-page {
    padding: 40px 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.compare-header {
    text-align: center;
    margin-bottom: 40px;
}

.compare-header h1 {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
}

.compare-header h1 i {
    color: var(--primary);
}

.compare-header p {
    color: var(--text-secondary);
    font-size: 16px;
}

/* Comparison Form */
.compare-form-container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-bottom: 40px;
}

.compare-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.compare-inputs {
    display: flex;
    align-items: flex-end;
    gap: 20px;
}

.compare-input-group {
    flex: 1;
    position: relative;
}

.compare-input-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    font-size: 14px;
}

.compare-input-group label i {
    color: var(--primary);
}

.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-prefix {
    position: absolute;
    left: 16px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 16px;
    z-index: 2;
}

.input-wrap input {
    width: 100%;
    padding: 16px 16px 16px 36px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.2s;
    background: var(--bg-body);
}

.input-wrap input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
}

.vs-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    font-weight: 800;
    font-size: 18px;
    flex-shrink: 0;
    margin-bottom: 8px;
}

.compare-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 18px 32px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.compare-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(232, 93, 76, 0.3);
}

.compare-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Search Suggestions */
.suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 12px 12px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    margin-top: -2px;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.suggestion-item:hover {
    background: var(--bg-body);
}

.suggestion-item img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

/* Comparison Results */
.comparison-results {
    margin-bottom: 40px;
}

.winner-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 32px;
    text-align: center;
}

.winner-crown {
    font-size: 48px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.winner-text {
    display: flex;
    flex-direction: column;
}

.winner-label {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
}

.winner-name {
    font-size: 24px;
    font-weight: 800;
    margin: 4px 0;
}

.winner-reason {
    font-size: 14px;
    opacity: 0.9;
}

/* Channel Cards */
.compare-channels {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 24px;
    margin-bottom: 40px;
}

.compare-channel-card {
    background: white;
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 2px solid transparent;
    transition: all 0.2s;
}

.compare-channel-card.winner {
    border-color: var(--secondary);
    box-shadow: 0 8px 40px rgba(13, 148, 136, 0.15);
}

.channel-card-header {
    text-align: center;
    margin-bottom: 24px;
}

.channel-avatar-large {
    width: 100px;
    height: 100px;
    border-radius: 24px;
    margin-bottom: 16px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

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

.channel-card-info .username {
    color: var(--text-muted);
    font-size: 14px;
    display: block;
    margin-bottom: 12px;
}

.winner-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--secondary);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
}

.channel-metrics {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: var(--bg-body);
    border-radius: 10px;
}

.metric-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.metric-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.metric-value.better {
    color: var(--secondary);
}

.metric-value i {
    color: var(--secondary);
    font-size: 14px;
}

.view-channel-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    background: var(--bg-body);
    color: var(--text-primary);
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
}

.view-channel-btn:hover {
    background: var(--primary);
    color: white;
}

.vs-divider {
    display: flex;
    align-items: center;
    justify-content: center;
}

.vs-divider span {
    width: 50px;
    height: 50px;
    background: var(--bg-body);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Comparison Chart */
.comparison-chart {
    background: white;
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.comparison-chart h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.comparison-chart h3 i {
    color: var(--primary);
}

.chart-row {
    margin-bottom: 20px;
}

.chart-label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
}

.chart-bar-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chart-bar-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chart-bar {
    height: 32px;
    border-radius: 8px;
    transition: width 0.5s ease;
    min-width: 4px;
}

.chart-bar.c1 {
    background: var(--primary);
}

.chart-bar.c2 {
    background: var(--purple);
}

.chart-bar-wrap span {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    min-width: 80px;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 64px 24px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-bottom: 40px;
}

.no-results i {
    font-size: 64px;
    color: var(--border-color);
    margin-bottom: 24px;
}

.no-results h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.no-results p {
    color: var(--text-secondary);
}

/* Popular Comparisons */
.popular-comparisons h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.popular-comparisons h3 i {
    color: #e85d4c;
}

.comparison-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.comparison-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: all 0.2s;
}

.comparison-link:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.comparison-link .vs {
    background: var(--bg-body);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-secondary);
}

/* ============================================
   COMPARE PAGE RESPONSIVE
   ============================================ */

@media (max-width: 968px) {
    .compare-inputs {
        flex-direction: column;
        align-items: stretch;
    }
    
    .vs-badge {
        align-self: center;
        margin: 8px 0;
    }
    
    .compare-channels {
        grid-template-columns: 1fr;
    }
    
    .vs-divider {
        display: none;
    }
    
    .winner-banner {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 640px) {
    .compare-page {
        padding: 24px 16px;
    }
    
    .compare-header h1 {
        font-size: 24px;
    }
    
    .compare-form-container {
        padding: 24px;
    }
    
    .compare-channel-card {
        padding: 24px;
    }
    
    .channel-avatar-large {
        width: 80px;
        height: 80px;
    }
    
    .metric {
        padding: 12px;
    }
    
    .comparison-link {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .chart-bar-wrap span {
        min-width: 60px;
        font-size: 12px;
    }
}