
/* 
   FOKUS PRO // COMMUNITY MODULE v2.0
   - Enhanced Feed
   - Tactical Player Card Profile
   - Friend System Integration
*/

/* --- Z-INDEX LAYERS --- */
.high-z { z-index: 3000 !important; }
.high-z-max { z-index: 3500 !important; }

/* --- HEADER & DASHBOARD --- */
.com-header-row {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px;
}
.com-icon-btn {
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
    color: white; width: 40px; height: 40px; border-radius: 50%;
    cursor: pointer; transition: 0.2s; display: flex; align-items: center; justify-content: center;
}
.com-icon-btn:hover { background: var(--c-primary); color: #000; box-shadow: 0 0 15px var(--c-primary-glow); }
.com-icon-btn.active { border-color: var(--c-primary); color: var(--c-primary); background: rgba(16, 185, 129, 0.1); }

.position-relative { position: relative; }

/* BADGE SYSTEM UPDATE */
.badge-dot {
    position: absolute; top: 0; right: 0; width: 10px; height: 10px;
    border-radius: 50%; border: 1px solid #000;
    z-index: 10;
}

/* Green: Friend Request */
.badge-dot.green {
    background: var(--c-primary); /* Green */
    box-shadow: 0 0 5px var(--c-primary);
}

/* Orange: New Challenge Request */
.badge-dot.orange {
    background: #f97316; /* Orange from VS Theme */
    box-shadow: 0 0 5px #f97316;
}

/* Orange Pulse: Active Match */
.badge-dot.orange-pulse {
    background: #f97316;
    box-shadow: 0 0 8px #f97316;
    animation: badge-pulse 1.2s infinite;
}

@keyframes badge-pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

.com-dashboard {
    display: flex; align-items: center; justify-content: space-between;
    padding: 25px; margin-bottom: 25px; overflow: hidden;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(13, 22, 40, 0.8) 100%);
    border: 1px solid rgba(59, 130, 246, 0.2);
}
.com-stat-box { display: flex; align-items: center; gap: 15px; z-index: 2; position: relative; }
.com-stat-icon { font-size: 2.5rem; color: var(--c-accent); text-shadow: 0 0 20px rgba(59, 130, 246, 0.4); }
.com-stat-info { display: flex; flex-direction: column; }
.com-val { font-family: var(--font-tech); font-size: 2rem; font-weight: 800; color: white; line-height: 1; transition: transform 0.2s; display:inline-block; }
.com-lbl { font-size: 0.7rem; letter-spacing: 1px; color: var(--c-text-sec); font-weight: 700; margin-top: 5px; }
.com-stat-decor {
    position: absolute; right: -20px; bottom: -20px; font-size: 6rem; color: var(--c-accent);
    opacity: 0.05; transform: rotate(-15deg); pointer-events: none;
}

/* --- SEARCH & FRIENDS VIEW --- */
@keyframes slideFadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

.com-search-container { margin-bottom: 25px; animation: slideFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
.com-tabs-row { display: flex; gap: 10px; margin-bottom: 15px; overflow-x: auto; padding-bottom: 5px; }
.com-tab-btn {
    flex: 1; background: transparent; border: 1px solid rgba(255,255,255,0.1);
    color: var(--c-text-sec); padding: 8px; border-radius: 6px; font-size: 0.75rem;
    font-weight: 700; cursor: pointer; transition: 0.2s; white-space: nowrap;
}
.com-tab-btn.active {
    background: rgba(255,255,255,0.05); border-color: var(--c-primary); color: white;
}

.com-results-list {
    margin-top: 10px; display: flex; flex-direction: column; gap: 8px;
    max-height: 300px; overflow-y: auto;
    -webkit-overflow-scrolling: touch; 
}
.com-user-result {
    display: flex; align-items: center; gap: 12px;
    background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.05);
    padding: 10px; border-radius: 8px; cursor: pointer; transition: 0.2s;
}
.com-user-result:hover { background: rgba(255,255,255,0.05); border-color: var(--c-primary); }
.com-res-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; border: 1px solid rgba(255,255,255,0.2); }
.com-res-info { flex: 1; display: flex; flex-direction: column; }
.com-res-name { font-size: 0.85rem; font-weight: 700; color: white; }
.com-res-lvl { font-size: 0.65rem; color: var(--c-primary); font-family: var(--font-tech); }

/* FRIEND REQUEST ITEM */
.friend-req-item {
    display: flex; align-items: center; justify-content: space-between;
    background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.1);
    padding: 10px; border-radius: 8px;
}
.friend-req-left { display: flex; align-items: center; gap: 10px; }
.friend-req-actions { display: flex; gap: 5px; }
.btn-req-action {
    width: 30px; height: 30px; border-radius: 6px; display: flex; align-items: center; justify-content: center;
    border: none; cursor: pointer; transition: 0.2s; color: white;
}
.btn-req-accept { background: rgba(16, 185, 129, 0.2); color: var(--c-primary); border: 1px solid rgba(16, 185, 129, 0.3); }
.btn-req-accept:hover { background: var(--c-primary); color: black; }
.btn-req-decline { background: rgba(239, 68, 68, 0.2); color: var(--c-danger); border: 1px solid rgba(239, 68, 68, 0.3); }
.btn-req-decline:hover { background: var(--c-danger); color: white; }

/* --- MEMBER LIST (ALL MEMBERS MODAL) --- */
#modal-all-members { z-index: 2000; }

.member-list-item {
    display: flex; align-items: center; gap: 12px;
    background: rgba(255,255,255,0.03); 
    border: 1px solid rgba(255,255,255,0.05);
    padding: 12px; border-radius: 8px; cursor: pointer; transition: 0.2s;
}

/* ONLINE STATE */
.member-list-item.is-online {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.1);
}
.member-list-item.is-online .com-res-name { color: #fff; text-shadow: 0 0 5px rgba(16, 185, 129, 0.5); }
.member-list-item.is-online .com-res-avatar { border-color: var(--c-primary); }

/* OFFLINE STATE */
.member-list-item.is-offline {
    opacity: 0.6;
    background: rgba(0,0,0,0.2);
}
.member-list-item.is-offline:hover { opacity: 1; background: rgba(255,255,255,0.05); }

.online-dot {
    width: 8px; height: 8px; border-radius: 50%; background: var(--c-text-dim); margin-left: auto;
}
.member-list-item.is-online .online-dot {
    background: var(--c-primary);
    box-shadow: 0 0 8px var(--c-primary);
}


/* --- FEED ENHANCED --- */
.com-feed-list { display: flex; flex-direction: column; gap: 15px; padding-bottom: 40px; min-height: 200px; }

.com-feed-item {
    background: rgba(13, 22, 40, 0.6);
    border: 1px solid rgba(255,255,255,0.05);
    padding: 15px; border-radius: 12px;
    position: relative; transition: 0.2s;
    display: flex; gap: 15px; align-items: flex-start;
}
.com-feed-item:hover { background: rgba(255,255,255,0.04); transform: translateX(2px); border-color: rgba(255,255,255,0.1); }

/* Feed Types & Icon Badge */
.com-feed-icon-badge {
    width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
    font-size: 1rem; flex-shrink: 0; background: rgba(255,255,255,0.05); color: var(--c-text-sec);
}

.type-exercise .com-feed-icon-badge { background: rgba(16, 185, 129, 0.1); color: var(--c-primary); border: 1px solid rgba(16, 185, 129, 0.2); }
.type-training .com-feed-icon-badge { background: rgba(59, 130, 246, 0.1); color: var(--c-accent); border: 1px solid rgba(59, 130, 246, 0.2); }
.type-levelup .com-feed-icon-badge { background: rgba(245, 158, 11, 0.1); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.2); box-shadow: 0 0 10px rgba(245, 158, 11, 0.2); }

.com-feed-content { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.com-feed-header { display: flex; justify-content: space-between; align-items: center; }
.com-feed-user { font-weight: 800; color: white; font-size: 0.9rem; transition: 0.2s; }
.com-feed-user:hover { color: var(--c-primary); text-decoration: underline; }
.com-feed-time { font-family: var(--font-tech); font-size: 0.65rem; color: var(--c-text-dim); }

.com-feed-msg { font-size: 0.85rem; color: var(--c-text-sec); line-height: 1.4; }
.com-highlight { color: var(--c-primary); font-weight: 700; }
.com-training-hl { color: var(--c-accent); font-weight: 700; }

.com-loader { display: flex; justify-content: center; padding: 20px; }
.spinner-construct.small { width: 30px; height: 30px; margin: 0; }


/* --- PUBLIC PROFILE MODAL (FIXED SCROLL & LAYOUT) --- */
#modal-public-profile { z-index: 2050 !important; }

/* Flex container for the window to handle scrolling properly */
.pp-window-flex {
    display: flex; flex-direction: column; 
    overflow: hidden; /* Prevent window itself from scrolling */
    background: #020617;
    position: relative;
    max-height: 85dvh; /* Mobile Friendly */
}

/* Close Button Fixed Top Right */
.detail-close-fab {
    position: absolute; top: 15px; right: 15px; 
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.2);
    color: white; z-index: 100;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 1.2rem;
    transition: 0.2s;
}
.detail-close-fab:hover { background: var(--c-danger); border-color: var(--c-danger); transform: rotate(90deg); }

.pp-scroll-container {
    flex: 1; 
    overflow-y: auto; 
    -webkit-overflow-scrolling: touch;
    position: relative;
    padding-bottom: 20px;
}

.pp-header-bg {
    height: 140px; 
    background: radial-gradient(circle at center, #1e293b 0%, #020617 100%);
    position: relative; display: flex; align-items: flex-end; justify-content: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background-image: 
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 20px 20px;
    flex-shrink: 0; /* Keep header size */
}
.pp-avatar {
    width: 90px; height: 90px; border-radius: 12px; border: 2px solid var(--c-primary);
    transform: translateY(45px); background: #000; object-fit: cover;
    box-shadow: 0 0 20px rgba(0,0,0,0.8);
    z-index: 10;
}
.pp-body { padding: 50px 25px 30px; text-align: center; }

.pp-username { font-size: 1.6rem; font-weight: 900; color: white; margin-bottom: 5px; letter-spacing: -0.5px; }
.pp-status-text { font-size: 0.7rem; color: var(--c-primary); margin-bottom: 10px; font-family: var(--font-tech); opacity: 0.8; }

.pp-meta { 
    display: flex; justify-content: center; gap: 15px; margin-bottom: 20px; 
    font-family: var(--font-tech); font-size: 0.75rem; color: var(--c-text-sec); 
    background: rgba(255,255,255,0.03); display: inline-flex; padding: 6px 12px; border-radius: 20px;
}
.pp-meta span i { margin-right: 5px; }
.pp-meta span i.fa-fire { color: #f59e0b; }

/* Friend Actions Area */
.pp-actions-row { margin-bottom: 25px; display: flex; justify-content: center; gap: 10px; }

/* ORANGE VS BUTTON */
.btn-neon.vs-challenge-btn {
    background: #f97316; /* Orange */
    color: black;
    border-color: #f97316;
    box-shadow: 0 0 20px rgba(249, 115, 22, 0.3);
}
.btn-neon.vs-challenge-btn:hover {
    background: #fff;
    box-shadow: 0 0 30px #f97316;
}

.pp-stats-grid { 
    display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 30px; 
}
.pp-stat-box { 
    background: linear-gradient(180deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0) 100%);
    border: 1px solid rgba(255,255,255,0.08); padding: 15px; border-radius: 12px; 
    transition: 0.2s; display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.pp-stat-box:hover { border-color: var(--c-primary); }
.pp-stat-val { font-family: var(--font-tech); font-size: 1.4rem; font-weight: 800; color: white; display: block; margin-bottom: 4px; }
.pp-stat-lbl { font-size: 0.65rem; color: #64748b; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }

/* History List in Profile */
.pp-history-section { text-align: left; margin-top: 10px; border-top: 1px solid rgba(255,255,255,0.05); padding-top: 20px; }
.pp-sec-title { font-size: 0.7rem; font-weight: 800; color: var(--c-text-sec); margin-bottom: 15px; letter-spacing: 1px; }

.pp-hist-list { display: flex; flex-direction: column; gap: 0; }
.pp-hist-item { 
    display: flex; gap: 12px; padding-bottom: 15px; position: relative; 
}
.pp-hist-item:last-child { padding-bottom: 0; }
.pp-hist-item::before {
    content: ''; position: absolute; left: 5px; top: 18px; bottom: 0; width: 1px; background: rgba(255,255,255,0.1);
}
.pp-hist-item:last-child::before { display: none; }

.pp-hist-dot { 
    width: 10px; height: 10px; border-radius: 50%; background: var(--c-primary); 
    box-shadow: 0 0 8px var(--c-primary-dim); margin-top: 5px; flex-shrink: 0; position: relative; z-index: 2;
}
.pp-hist-content { flex: 1; }
.pp-hist-msg { font-size: 0.8rem; color: #e2e8f0; line-height: 1.3; }
.pp-hist-time { font-size: 0.65rem; color: #64748b; margin-top: 2px; }

.pp-join-date { font-size: 0.6rem; color: #475569; text-align: center; margin-top: 30px; font-family: var(--font-tech); opacity: 0.5; }

.pp-private-msg { 
    padding: 40px; color: var(--c-text-dim); font-size: 0.85rem; 
    border: 1px dashed rgba(255,255,255,0.1); border-radius: 12px; margin-top: 20px;
    background: rgba(0,0,0,0.2);
}
