/* =========================================================
   A1LAB USER PROFILE - FULLY RESPONSIVE MOBILE-FIRST CSS
   ========================================================= */

:root { 
    --accent: #76b900;
    --bg: #0a0c10;
    --card: #12151c;
    --border: #2d333b;
    --text: #adbac7;
    --white: #f0f6fc;
    --blue: #539bf5;
    --bg-hover: #1c2128;
}

*, *::before, *::after {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    margin: 0;
    padding: 0;
}

body { 
    background: var(--bg); 
    color: var(--text); 
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; 
    background-image: radial-gradient(circle at top right, #161b22, transparent);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ===== CONTAINER & NAVIGATION ===== */
.container { 
    width: 100%;
    max-width: 1100px; 
    margin: 30px auto; 
    padding: 0 16px; 
}

.nav-header { 
    margin-bottom: 24px; 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
}

.back-btn {
    text-decoration: none; 
    color: var(--white); 
    font-size: 13px; 
    font-weight: 600;
    display: inline-flex; 
    align-items: center; 
    gap: 8px; 
    padding: 8px 16px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.back-btn:hover { 
    color: var(--accent); 
    border-color: var(--accent);
    background: var(--bg-hover);
}

/* ===== MAIN PROFILE GRID ===== */
.profile-grid { 
    display: grid; 
    grid-template-columns: 300px minmax(0, 1fr); 
    gap: 24px; 
    align-items: start;
}

/* ===== SIDEBAR ===== */
.sidebar { 
    background: var(--card); 
    border: 1px solid var(--border); 
    border-radius: 20px; 
    padding: 30px 20px; 
    text-align: center;
    position: sticky; 
    top: 20px;
    min-width: 0;
}

.avatar-wrapper {
    position: relative; 
    width: 130px; 
    height: 130px; 
    margin: 0 auto 16px;
}

.avatar-main { 
    width: 100%; 
    height: 100%; 
    background: linear-gradient(135deg, #1c2128, #0d1117); 
    border-radius: 40px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 50px; 
    font-weight: 800; 
    color: var(--accent); 
    border: 2px solid var(--border); 
    overflow: hidden; 
    box-shadow: 0 15px 30px rgba(0,0,0,0.4);
}

#profileImg { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    display: none; 
}

.upload-btn {
    position: absolute; 
    bottom: 2px; 
    right: 2px; 
    background: var(--accent);
    width: 38px; 
    height: 38px; 
    border-radius: 12px; 
    display: none;
    align-items: center; 
    justify-content: center; 
    cursor: pointer; 
    border: 3px solid var(--card);
}

.user-name { 
    font-size: 24px; 
    font-weight: 800; 
    color: var(--white); 
    margin: 12px 0 6px; 
    letter-spacing: -0.5px; 
    word-break: break-word; 
}

.rank-tag { 
    font-size: 10px; 
    font-weight: 800; 
    color: var(--accent); 
    background: rgba(118,185,0,0.12);
    padding: 4px 12px; 
    border-radius: 20px; 
    text-transform: uppercase; 
    letter-spacing: 1.5px; 
    display: inline-block;
}

/* ===== TABS NAVIGATION ===== */
.tabs-list { 
    margin-top: 30px; 
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tab-item {
    padding: 12px 16px; 
    border-radius: 12px; 
    cursor: pointer;
    display: flex; 
    align-items: center; 
    gap: 12px; 
    font-weight: 600; 
    font-size: 14px;
    transition: all 0.2s ease;
    color: var(--text); 
    border: 1px solid transparent; 
    user-select: none;
}

.tab-item:hover { 
    background: rgba(255,255,255,0.03); 
    color: var(--white);
}

.tab-item.active { 
    background: #1c2128; 
    color: var(--accent); 
    border-color: var(--border); 
}

/* ===== MAIN CONTENT PANEL ===== */
.main-panel { 
    background: var(--card); 
    border: 1px solid var(--border); 
    border-radius: 20px; 
    padding: 32px 28px; 
    min-height: 480px;
    min-width: 0;
}

.panel-section { 
    display: none; 
    animation: slideUp 0.3s ease; 
}

.panel-section.active { 
    display: block; 
}

@keyframes slideUp { 
    from { opacity: 0; transform: translateY(12px); } 
    to { opacity: 1; transform: translateY(0); } 
}

.h-label { 
    font-size: 11px; 
    font-weight: 800; 
    color: var(--accent); 
    text-transform: uppercase; 
    letter-spacing: 2px; 
    margin-bottom: 16px; 
    display: block; 
}

.bio-display {
    background: rgba(0,0,0,0.3); 
    padding: 20px; 
    border-radius: 14px; 
    border-left: 4px solid var(--accent);
    color: var(--white); 
    line-height: 1.7; 
    font-size: 14px; 
    margin-bottom: 30px; 
    word-break: break-word;
}

/* ===== STATS ROW ===== */
.stats-row { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 16px; 
    margin-bottom: 30px; 
}

.stat-box {
    background: #1c2128; 
    padding: 20px 14px; 
    border-radius: 16px; 
    border: 1px solid var(--border); 
    text-align: center;
    min-width: 0;
}

.stat-box b { 
    font-size: 24px; 
    color: var(--white); 
    display: block; 
    word-break: break-word;
}

.stat-box span { 
    font-size: 10px; 
    text-transform: uppercase; 
    font-weight: 700; 
    color: var(--text); 
    letter-spacing: 0.5px; 
}

/* ===== FORM INPUTS ===== */
.input-wrap { 
    margin-bottom: 20px; 
}

.input-wrap label { 
    font-size: 12px; 
    font-weight: 700; 
    margin-bottom: 8px; 
    display: block; 
    color: var(--text); 
}

.f-input {
    width: 100%; 
    background: #0d1117; 
    border: 1px solid var(--border); 
    border-radius: 10px;
    padding: 12px 14px; 
    color: var(--white); 
    font-family: inherit; 
    font-size: 14px;
    transition: all 0.2s ease; 
    box-sizing: border-box;
}

textarea.f-input {
    min-height: 110px;
    resize: vertical;
}

.f-input:focus { 
    border-color: var(--accent); 
    outline: none; 
    box-shadow: 0 0 10px rgba(118,185,0,0.15); 
}

.save-btn {
    background: var(--accent); 
    color: #000; 
    border: none; 
    padding: 12px 28px; 
    border-radius: 10px; 
    font-weight: 800; 
    font-size: 14px;
    cursor: pointer; 
    transition: all 0.2s ease;
}

.save-btn:hover { 
    filter: brightness(1.1); 
}

/* ===== POST CARDS ===== */
.post-card {
    background: rgba(255,255,255,0.02); 
    padding: 16px 18px; 
    border-radius: 14px; 
    border: 1px solid var(--border); 
    margin-bottom: 12px; 
    transition: all 0.2s ease; 
    cursor: pointer;
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    gap: 12px;
}

.post-card:hover { 
    border-color: var(--accent); 
    background: rgba(118,185,0,0.03); 
}

.post-card h4 { 
    margin: 0; 
    color: var(--blue); 
    font-size: 15px;
    word-break: break-word; 
}

/* =========================================================
   📱 MOBILE & TABLET RESPONSIVE FIXES
   ========================================================= */

/* Tablet & Mobile Breakpoint (<= 850px) */
@media (max-width: 850px) {
    .container { 
        margin: 15px auto; 
        padding: 0 12px; 
    }

    .profile-grid { 
        grid-template-columns: 1fr; 
        gap: 16px; 
    }

    .sidebar { 
        position: relative; 
        top: 0; 
        padding: 24px 16px; 
        border-radius: 16px; 
    }

    .avatar-wrapper { 
        width: 100px; 
        height: 100px; 
        margin-bottom: 12px;
    }

    .avatar-main { 
        font-size: 36px; 
        border-radius: 30px;
    }

    /* Horizontal Scrollable Tabs on Mobile */
    .tabs-list { 
        flex-direction: row;
        overflow-x: auto; 
        gap: 8px; 
        padding-bottom: 6px; 
        margin-top: 20px; 
        scrollbar-width: none; 
        -webkit-overflow-scrolling: touch;
    }

    .tabs-list::-webkit-scrollbar { 
        display: none; 
    }

    .tab-item { 
        white-space: nowrap; 
        padding: 8px 14px; 
        font-size: 13px; 
        border-radius: 8px;
        flex-shrink: 0;
    }

    .main-panel { 
        padding: 20px 16px; 
        border-radius: 16px; 
        min-height: auto; 
    }

    .stats-row { 
        grid-template-columns: repeat(3, 1fr); 
        gap: 10px; 
    }

    .stat-box {
        padding: 14px 8px;
        border-radius: 12px;
    }

    .stat-box b {
        font-size: 18px;
    }

    .stat-box span {
        font-size: 9px;
    }

    .bio-display { 
        font-size: 13px; 
        padding: 14px; 
    }

    .save-btn { 
        width: 100%; 
        text-align: center; 
        padding: 14px;
    }
}

/* Small Mobile Phones (<= 480px) */
@media (max-width: 480px) {
    .user-name { 
        font-size: 20px; 
    }

    .stats-row { 
        grid-template-columns: 1fr; /* Stacks stats vertically on small screens */
        gap: 10px; 
    }

    .post-card {
        flex-direction: column;
        align-items: flex-start;
    }
}