/* Variables CSS */
:root {
    --primary-color: #6a11cb;
    --secondary-color: #2575fc;
    --accent-color: #ff4d94;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --gray-color: #6c757d;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --border-radius: 12px;
    --box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #f5f7fb;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1rem 0;
    box-shadow: var(--box-shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.logo i {
    font-size: 1.8rem;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    white-space: nowrap;
}

.nav-links a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.nav-links a.active {
    background-color: rgba(255, 255, 255, 0.3);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.user-info span {
    font-weight: 500;
    font-size: 0.9rem;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: white;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.mobile-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
    padding: 2rem 0;
}

/* Sidebar */
.sidebar {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
    height: fit-content;
}

.sidebar h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.8rem 1rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    color: var(--dark-color);
    font-size: 0.95rem;
}

.sidebar-menu a:hover {
    background-color: #f0f2f5;
    color: var(--primary-color);
}

.sidebar-menu a.active {
    background-color: #eef2ff;
    color: var(--primary-color);
    font-weight: 500;
}

/* Content Area */
.content-area {
    min-height: 60vh;
}

/* Hero Section */
.hero-tracking {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    color: white;
    box-shadow: var(--box-shadow);
}

.hero-content h1 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hero-content p {
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
    opacity: 0.9;
}

/* Stats Section */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-info h3 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.3rem;
}

.stat-info p {
    color: var(--gray-color);
    font-size: 0.9rem;
}

/* Groups Filter */
.groups-filter {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--box-shadow);
}

.groups-filter h2 {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.groups-buttons {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.group-btn {
    padding: 0.8rem 1.5rem;
    border: 2px solid #ddd;
    background: white;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--dark-color);
}

.group-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.group-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-color: var(--primary-color);
}

.group-btn.inactive {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f5f5f5;
}

.group-btn.inactive:hover {
    transform: none;
    border-color: #ddd;
}

.group-participants {
    font-size: 0.85rem;
    background: rgba(0, 0, 0, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
}

/* No Active Group */
.no-active-group {
    background: white;
    border-radius: var(--border-radius);
    padding: 3rem 2rem;
    text-align: center;
    box-shadow: var(--box-shadow);
    margin-bottom: 2rem;
}

.no-group-content i {
    font-size: 4rem;
    color: var(--gray-color);
    margin-bottom: 1rem;
}

.no-group-content h3 {
    font-size: 1.5rem;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.no-group-content p {
    color: var(--gray-color);
}

/* Ranking Section */
.ranking-section {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--box-shadow);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header h2 {
    font-size: 1.3rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ranking-info {
    display: flex;
    gap: 0.5rem;
}

.info-badge {
    background: rgba(106, 17, 203, 0.1);
    color: var(--primary-color);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ranking-item {
    background: #f8f9fa;
    border-radius: var(--border-radius);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
    cursor: pointer;
    border: 2px solid transparent;
}

.ranking-item:hover {
    transform: translateX(5px);
    border-color: var(--primary-color);
    box-shadow: 0 5px 15px rgba(106, 17, 203, 0.2);
}

.ranking-item.top-1 {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 193, 7, 0.2));
    border-color: gold;
}

.ranking-item.top-2 {
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.2), rgba(169, 169, 169, 0.2));
    border-color: silver;
}

.ranking-item.top-3 {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.2), rgba(184, 115, 51, 0.2));
    border-color: #cd7f32;
}

.rank-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    min-width: 40px;
    text-align: center;
}

.ranking-item.top-1 .rank-number {
    color: gold;
}

.ranking-item.top-2 .rank-number {
    color: silver;
}

.ranking-item.top-3 .rank-number {
    color: #cd7f32;
}

.rank-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.rank-info {
    flex: 1;
}

.rank-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rank-badge {
    background: var(--primary-color);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 700;
}

.rank-details {
    display: flex;
    gap: 1rem;
    color: var(--gray-color);
    font-size: 0.85rem;
}

.rank-stat {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.rank-score {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
    text-align: center;
}

.rank-score-label {
    font-size: 0.75rem;
    color: var(--gray-color);
    text-transform: uppercase;
}

/* Participant Details */
.participant-details {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
    margin-bottom: 2rem;
}

.btn-close-details {
    background: transparent;
    border: none;
    color: var(--gray-color);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 1.2rem;
}

.btn-close-details:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--dark-color);
}

.participant-info-card {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: var(--border-radius);
    flex-wrap: wrap;
}

.participant-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 2.5rem;
}

.participant-stats {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--gray-color);
    font-weight: 500;
}

.stat-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark-color);
}

.posts-stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.summary-card {
    background: #f8f9fa;
    border-radius: var(--border-radius);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.summary-card i {
    font-size: 2rem;
    color: var(--primary-color);
}

.summary-card h4 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 0.2rem;
}

.summary-card p {
    font-size: 0.85rem;
    color: var(--gray-color);
}

.posts-title {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.post-item {
    background: #f8f9fa;
    border-radius: var(--border-radius);
    padding: 1rem;
    border: 2px solid transparent;
    transition: var(--transition);
}

.post-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 5px 15px rgba(106, 17, 203, 0.2);
}

.post-item h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.post-badge {
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.post-badge.free {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
}

.post-badge.paid {
    background: rgba(255, 193, 7, 0.1);
    color: var(--warning-color);
}

.post-stats {
    display: flex;
    justify-content: space-between;
    color: var(--gray-color);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.post-stats span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* Loading */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--gray-color);
}

.loading i {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 0.8rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Notification */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    z-index: 3000;
    transform: translateX(150%);
    transition: transform 0.3s ease;
    max-width: 350px;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: var(--success-color);
    color: white;
}

.notification.error {
    background: var(--danger-color);
    color: white;
}

.notification.info {
    background: var(--primary-color);
    color: white;
}

/* Footer */
footer {
    background-color: var(--dark-color);
    color: white;
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.footer-section {
    flex: 1;
    min-width: 200px;
}

.footer-section h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.footer-section ul {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-section a {
    color: #ddd;
    transition: var(--transition);
    font-size: 0.9rem;
}

.footer-section a:hover {
    color: white;
}

.copyright {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #444;
    color: #aaa;
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 992px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        display: none;
    }
    
    .mobile-toggle {
        display: block;
    }
    
    .nav-links {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        background-color: white;
        flex-direction: column;
        padding: 1rem;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
        transform: translateY(-150%);
        opacity: 0;
        transition: var(--transition);
        z-index: 99;
    }
    
    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
    }
    
    .nav-links a {
        color: var(--dark-color);
        padding: 0.9rem;
    }
}

@media (max-width: 768px) {
    .stats-section {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .participant-info-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .participant-stats {
        width: 100%;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .logo {
        font-size: 1.3rem;
    }
    
    .logo i {
        font-size: 1.5rem;
    }
    
    .stats-section {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }
    
    .stat-info h3 {
        font-size: 1.5rem;
    }
    
    .stat-info p {
        font-size: 0.85rem;
    }
    
    .hero-tracking {
        padding: 1.5rem;
    }
    
    .hero-content h1 {
        font-size: 1.3rem;
    }
    
    .hero-content p {
        font-size: 0.85rem;
    }
    
    .groups-filter {
        padding: 1rem;
    }
    
    .groups-filter h2 {
        font-size: 1.1rem;
    }
    
    .groups-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .group-btn {
        width: 100%;
        justify-content: center;
        padding: 0.7rem 1rem;
    }
    
    .ranking-section {
        padding: 1rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .section-header h2 {
        font-size: 1.1rem;
    }
    
    .ranking-item {
        flex-wrap: wrap;
        padding: 0.8rem;
        gap: 0.5rem;
    }
    
    .rank-number {
        font-size: 1.2rem;
        min-width: 30px;
    }
    
    .rank-avatar {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }
    
    .rank-info {
        width: 100%;
    }
    
    .rank-name {
        font-size: 1rem;
    }
    
    .rank-details {
        flex-direction: column;
        gap: 0.3rem;
    }
    
    .rank-score {
        width: 100%;
        text-align: left;
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        border-top: 1px solid #ddd;
    }
    
    .participant-details {
        padding: 1rem;
    }
    
    .participant-info-card {
        padding: 1rem;
        gap: 1rem;
    }
    
    .avatar-circle {
        width: 80px;
        height: 80px;
        font-size: 2rem;
    }
    
    .participant-stats {
        grid-template-columns: 1fr;
    }
    
    .posts-stats-summary {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    
    .summary-card {
        padding: 0.8rem;
    }
    
    .summary-card i {
        font-size: 1.5rem;
    }
    
    .summary-card h4 {
        font-size: 1.3rem;
    }
    
    .posts-title {
        font-size: 1.1rem;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    
    .post-item {
        padding: 0.8rem;
    }
    
    .post-item h4 {
        font-size: 0.95rem;
    }
    
    .post-stats {
        flex-direction: column;
        gap: 0.3rem;
        align-items: flex-start;
    }
    
    .no-active-group {
        padding: 2rem 1rem;
    }
    
    .no-group-content i {
        font-size: 3rem;
    }
    
    .no-group-content h3 {
        font-size: 1.2rem;
    }
    
    .no-group-content p {
        font-size: 0.9rem;
    }
    
    .user-info span {
        display: none;
    }
    
    .avatar {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    .info-badge {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }
    
    .notification {
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: calc(100% - 20px);
        padding: 0.9rem 1.2rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 360px) {
    .container {
        padding: 0 8px;
    }
    
    .logo span {
        font-size: 1.1rem;
    }
    
    .hero-tracking {
        padding: 1rem;
    }
    
    .stat-card {
        padding: 0.8rem;
        gap: 0.8rem;
    }
    
    .stat-icon {
        width: 45px;
        height: 45px;
        font-size: 1.2rem; 
    }
    
    .rank-badge {
        font-size: 0.65rem;
        padding: 0.15rem 0.4rem;
    }
    
    .post-badge {
        font-size: 0.7rem;
        padding: 0.15rem 0.4rem;
    }
}