* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --bg-primary: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    --bg-secondary: #232E3C;
    --bg-tertiary: #232E3C;
    --text-primary: #fff;
    --text-secondary: #8e9aaf;
    --accent-color: #00d4aa;
    --border-color: rgba(255, 255, 255, 0.1);
    --card-bg: rgba(255, 255, 255, 0.1);
    --language-count-color: #8e9aaf;
}

[data-theme="light"] {
    --bg-primary: linear-gradient(135deg, #f1f3f4 0%, #e9ecef 100%);
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --text-primary: #2c3e50;
    --text-secondary: #6c757d;
    --accent-color: #007bff;
    --border-color: rgba(0, 0, 0, 0.1);
    --card-bg: rgba(255, 255, 255, 0.6);
    --language-count-color: #007bff;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    min-height: 100vh;
    transition: all 0.3s ease;
}

.container {
    max-width: 500px;
    margin: 0 auto;
    background: var(--bg-primary);
    min-height: 100vh;
    transition: all 0.3s ease;
    position: relative;
}

.sticky-header {
    position: sticky;
    top: 0;
    z-index: 100;
}

.header {
    background: var(--bg-secondary);
    padding: 7px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid var(--bg-tertiary);
    transition: all 0.3s ease;
}

.trophy-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(45deg, var(--accent-color), #00a8e8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s ease;
}
.group-data-icon img {
    width: 50px;
    height: 50px;
    background: linear-gradient(45deg, var(--accent-color), #00a8e8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s ease;
}

.group-icon img{
    width: 50px;
    height: 50px;
    background: linear-gradient(45deg, var(--accent-color), #00a8e8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s ease;
}

.header-text h1 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
    transition: all 0.3s ease;
}

.header-text p {
    font-size: 13px;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.theme-toggle {
    margin-left: auto;
    width: 40px;
    height: 40px;
    color: #8e9aaf;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.2);
}

.theme-icon {
    font-size: 20px;
    transition: transform 0.3s ease;
}

.language-section {
    background: #17212B;
    padding: 10px 11px;
    border-bottom: 1px solid var(--bg-tertiary);
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

[data-theme="light"] .language-section {
    background: var(--bg-secondary);
}

.language-section:hover {
    background: var(--bg-tertiary);
}

.globe-icon {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    color: var(--accent-color);
}

.language-text {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
}

.language-count {
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    color: var(--language-count-color);
    margin-right: 10px;
    transition: all 0.3s ease;
}

.chevron {
    color: var(--text-secondary);
}

.groups-list {
    padding: 10px 0;
    background-color: #17212B;
}

[data-theme="light"] .groups-list {
    background-color: var(--bg-primary);
}

.group-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    cursor: pointer;
    border-bottom: 1px solid var(--bg-tertiary);
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Group item hover removed */

.group-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    font-weight: bold;
}

.group-info {
    flex: 1;
}

.group-name {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
    transition: all 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.group-username {
    font-size: 13px;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.group-avatar-container {
    position: relative;
    margin-right: 0px;
}

.group-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    font-weight: bold;
    overflow: hidden;
}

.group-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    transition: opacity 0.2s ease;
    opacity: 0.7;
}

.group-avatar img.loaded {
    opacity: 1;
}

.position-badge {
    position: absolute;
    top: -5px;
    left: -2px;
    width: 24px;
    height: 24px;
    background: #00d4aa6b;
    border: 2px solid var(--bg-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: white;
    transition: all 0.3s ease;
}

.group-position {
    margin-left: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--card-bg);
    /* padding: 8px 12px; */
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}
.user-position {
    margin-left: auto;

    align-items: center;
    background: var(--card-bg);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}
.position-change {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.position-up {
    color: #00d4aa;
    background: rgba(0, 212, 170, 0.1);
}

.position-down {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

.position-same {
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.05);
}

.chevron-up,
.chevron-down {
    width: 16px;
    height: 16px;
}

.group-item {
    display: flex;
    align-items: center;
    padding-top: 8px;
    padding-bottom: 8px;
    cursor: pointer;
    border-bottom: 1px solid var(--bg-tertiary);
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    transition: all 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    transition: all 0.3s ease;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--bg-tertiary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.language-list {
    padding: 10px 0;
}

.language-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.language-item:hover {
    background: var(--bg-tertiary);
}

.language-item.selected {
    background: #5288C1;
    color: white;
}

.language-item.selected:hover {
    background: #5288C1;
}

.group-detail {
    padding: 20px;
}

.group-detail-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.group-detail-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    font-weight: bold;
    overflow: hidden;
}

.group-detail-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    transition: opacity 0.2s ease;
    opacity: 0.7;
}

.group-detail-avatar img.loaded {
    opacity: 1;
}

.group-detail-info h2 {
    font-size: 20px;
    margin-bottom: 5px;
}

.group-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.stat-item {
    background:#17212B;
    border-radius: 8px;
    flex: 1;
    text-align: center;
}

.stat-label {
    font-size: 12px;
    color: #8e9aaf;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 18px;
    font-weight: 600;
    color: #00d4aa;
}

.open-chat-btn {
    background: #5288C1;
    border: none;
    padding: 15px;
    border-radius: 10px;
    color: white;
    font-size: 16px;
    font-weight: 500;
    width: 100%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #8e9aaf;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #8e9aaf;
    font-size: 14px;
    transition: opacity 0.1s ease;
}

.end-message {
    text-align: center;
    padding: 20px;
    color: #8e9aaf;
    font-size: 14px;
    transition: opacity 0.1s ease;
}

.scroll-up-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: linear-gradient(45deg, #00d4aa, #00a085);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 212, 170, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
}

.scroll-up-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 212, 170, 0.4);
}

.scroll-up-btn.show {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.group-item.new {
    animation: fadeIn 0.1s ease-out;
}

.powered-by-text {
    color: #8e9aaf;
    font-size: 12px;
    margin-top: 5px;
    margin-bottom: 10px;
}

.add-group-btn {
    background: linear-gradient(45deg, #101b19, #1b5267);
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    color: white;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 5px;
}

.add-group-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 212, 170, 0.3);
}


.text-link {
    color: #6ab3f3;
    font-weight: bold;
}



