/* =========================================================
   BEAUTY PLUS GLOBAL STYLE
   Main Layout + Posts + Comments + Profile + Community
   Responsive Desktop + Mobile
========================================================= */


/* =========================================================
   01. CSS VARIABLES
========================================================= */

:root {
    --brand-orange: #ff4500;
    --brand-blue: #0079d3;
    --reddit-blue: #0079d3;
    --brand-dark-blue: #3b5998;
    --success: #3b5998;
    --danger: #d93025;

    --bg-light: #f5f5f5;
    --white: #ffffff;

    --border-color: #dddddd;
    --border-light: #edeff1;
    --border-soft: #e5e7e9;

    --text-dark: #1c1c1c;
    --text-color: #1c1e21;
    --text-muted: #787c7e;
    --text-gray: #606060;
    --filter-text: #576477;

    --hover-gray: #f1f1f1;
    --pill-gray: #f0f2f5;

    --comment-line: #e1e4e6;
    --comment-line-active: #cfd4d7;

    --shadow: 0 4px 12px rgba(0, 0, 0, 0.10);
    --shadow-dark: 0 4px 15px rgba(0, 0, 0, 0.20);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-pill: 9999px;
    --radius-circle: 50%;
}


/* =========================================================
   02. GLOBAL RESET
========================================================= */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    padding-top: 58px;
}

button,
input,
textarea,
select {
    font-family: inherit;
}

button {
    border: 0;
    background: none;
    cursor: pointer;
}

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

img {
    max-width: 100%;
    display: block;
}


/* =========================================================
   03. GLOBAL UTILITY CLASSES
========================================================= */

.u-flex {
    display: flex;
    align-items: center;
}

.u-flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.u-flex-start {
    display: flex;
    align-items: flex-start;
}

.u-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-circle);
    overflow: hidden;
    background: var(--brand-orange);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.u-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.u-pill {
    border-radius: var(--radius-pill);
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 700;
    transition: 0.2s;
}

.u-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-circle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #444;
}

.u-icon-btn:hover {
    background: var(--hover-gray);
}


/* =========================================================
   04. TOPBAR
========================================================= */

.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 58px;
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    z-index: 1100;
}

.topbar-inner {
    max-width: 1600px;
    height: 100%;
    margin: 0 auto;
    padding: 0 20px;
    gap: 20px;
    display: flex;
    align-items: center;
}

.logo {
    font-size: 25px;
    font-weight: 700;
    color: var(--brand-orange);
    white-space: nowrap;
}

.search-box {
    width: 100%;
    height: 38px;
    flex: 0 1 auto;
    padding: 0 15px;
    background: var(--pill-gray);
    border-radius: var(--radius-pill);
    color: #777;
}

.search-box input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    padding-left: 10px;
    font-size: 14px;
}

.top-actions {
    margin-left: auto;
    gap: 5px;
}

.mobile-toggle {
    display: none;
}


/* =========================================================
   05. FILTER SECTION
========================================================= */

.filter-section {
    position: sticky;
    top: 58px;
    z-index: 1000;
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
}

.filter-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 8px 20px;
    gap: 15px;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    color: var(--filter-text);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.filter-item:hover {
    background: var(--hover-gray);
}

.filter-layout-icon {
    margin-left: auto;
    gap: 4px;
    color: var(--filter-text);
    font-size: 18px;
}

.filter-layout-icon .small-chevron {
    font-size: 10px;
}


/* =========================================================
   06. DROPDOWN MENUS
========================================================= */

.dropdown {
    position: relative;  
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 160px;
    margin-top: 5px;
    overflow: hidden;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    z-index: 99999;
}

.dropdown-menu.right {
    left: auto;
    right: 0;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 15px;
    font-size: 14px;
}

.dropdown-menu a:hover {
    background: var(--bg-light);
}

/* =========================================================
   07. MAIN PAGE LAYOUT
========================================================= */

.layout {
    --sidebar-width: clamp(180px, 20vw, 300px);
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr) var(--sidebar-width);
    gap: 10px;
    max-width: 1600px;
    margin: 0 auto;
    padding: 10px;
}

.layout > * {
    min-width: 0;
}

.main-content {
    width: 100%;
    min-width: 0;
}

.sidebar {
    width: 100%;
    min-width: 0;
}

.sidebar-box {
    width: 100%;
    position: sticky;
    top: 60px;
    padding: 16px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-radius: var(--radius-sm);
    color: #444;
    font-size: 14px;
    font-weight: 500;
}

.menu-item:hover {
    background: var(--hover-gray);
}

.menu-item.active {
    background: var(--hover-gray);
    color: var(--text-dark);
    font-weight: 700;
}


/* =========================================================
   08. POST CARD
========================================================= */

.post {
    margin-bottom: 16px;
    overflow: visible;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.post-header {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    gap: 10px;
}

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

.sub-name {
    display: block;
    font-size: 13px;
    font-weight: 700;
}

.post-meta {
    color: var(--text-muted);
    font-size: 11px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.join-btn {
    background: var(--brand-blue);
    color: var(--white);
}

.join-btn:hover {
    opacity: 0.9;
}

.post-body {
    padding: 0 15px 15px;
    min-width: 0;
}

.post-body h1,
.post-body h2,
.post-body h3 {
    margin-bottom: 8px;
    color: var(--text-dark);
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.post-desc {
    color: #444;
    font-size: 16px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.post-desc strong{
font-size: 16px;
font-weight: 600;
}

.post-desc p {
margin-bottom: 10px;
}

.post-desc ul{
list-style-type: square;
padding-left: 25px;
}

.post-desc li{
margin-bottom: 10px;
}

.post-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    padding: 8px 12px;
    gap: 6px;
    border-top: 1px solid #eee;
}

.action-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: var(--pill-gray);
    border-radius: var(--radius-pill);
    color: #444;
    font-size: 12px;
    font-weight: 600;
}

.action-pill:hover {
    background: #e5e5e5;
}

.vote-down {
    margin-left: 5px;
}


/* =========================================================
   09. POST MEDIA
========================================================= */

.post-media {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-height: 600px;
    margin-top: 8px;
    overflow: hidden;
    background: #f5f5f5;
    border: 1px solid #ccd0d5;
    /* border-radius: var(--radius-md); */
}

.post-media img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: 600px;
    object-fit: contain;
    cursor: zoom-in;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.post-media img.loaded {
    opacity: 1;
}

.image-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-loader span {
    width: 25px;
    height: 25px;
    border: 3px solid #ddd;
    border-top-color: #3578e5;
    border-radius: var(--radius-circle);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}


/* =========================================================
   10. DOMAIN / EXTERNAL LINK
========================================================= */

.preview-domain-text {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
    color: #878a8c;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.preview-domain-text:hover {
    color: var(--brand-blue);
}


/* =========================================================
   11. NOTIFICATION / TOAST
========================================================= */

#toast,
#notify {
    position: fixed;
    top: 20px;
    left: 50%;
    z-index: 10000;
    display: none;
    transform: translateX(-50%);
    padding: 10px 25px;
    background: #1a1a1b;
    border: 1px solid #343536;
    border-radius: var(--radius-pill);
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}


/* =========================================================
   12. COMMENT SECTION
========================================================= */

.comment-section-area {
    margin-bottom: 20px;
    padding: 18px 20px 25px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}


/* =========================================================
   13. COMMENT TOOLBAR
========================================================= */

.comment-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 15px;
    margin-bottom: 5px;
    border-bottom: 1px solid #f0f0f0;
}

.comment-sort-btn {
    padding: 8px 15px;
    background: #f1f1f1;
    border-radius: var(--radius-pill);
    color: #333;
    font-size: 13px;
    font-weight: 700;
    transition: 0.2s;
}

.comment-sort-btn:hover {
    background: #e5e5e5;
}

.comment-sort-btn.active {
    background: #111;
    color: #fff;
}


/* =========================================================
   14. MAIN COMMENT COMPOSER
========================================================= */

.comment-composer {
    margin-bottom: 25px;
    padding-bottom: 18px;
    border-bottom: 1px solid #f0f0f0;
}

.comment-input-wrap {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.comment-input-avatar {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: var(--radius-circle);
    background: #eee;
    object-fit: cover;
}

.underline-input {
    width: 100%;
    padding: 8px 0;
    background: transparent;
    border: 0;
    border-bottom: 1px solid #cfcfcf;
    outline: none;
    resize: vertical;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    transition: border-color 0.2s;
}

.underline-input:focus {
    border-bottom-color: var(--brand-blue);
}

.comment-submit-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.btn-blue {
    padding: 8px 18px;
    background: var(--brand-blue);
    border-radius: var(--radius-pill);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    transition: 0.2s;
}

.btn-blue:hover {
    background: #0066b3;
}


/* =========================================================
   15. COMMENT NODE
========================================================= */

.comment-node {
    position: relative;
    margin: 0;
    padding: 0;
}

.comment-main-row,
.comment-node > .u-flex-start {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 9px;
    min-width: 0;
}

.comment-main-row {
    padding: 8px 0;
}

.avatar-box {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: var(--radius-circle);
    background: #eee;
    object-fit: cover;
    margin: 0;
}

.avatar-sm {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border-radius: var(--radius-circle);
    background: #eee;
    object-fit: cover;
    margin: 0;
}

.c-content {
    flex: 1;
    min-width: 0;
    padding-bottom: 4px;
}

.user-tag {
    color: var(--text-dark);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
}

.time-tag {
    margin-left: 5px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 400;
}

.text-content {
    margin-top: 4px;
    color: var(--text-color);
    font-size: 14px;
    line-height: 1.55;
    overflow-wrap: anywhere;
    word-break: break-word;
}


/* =========================================================
   16. COMMENT ACTION BUTTONS
========================================================= */

.act-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 17px;
    margin-top: 8px;
    color: #606060;
}

.act-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
    transition: color 0.15s ease;
}

.act-item:hover {
    color: var(--brand-blue);
}

.act-item i {
    font-size: 13px;
}


/* =========================================================
   17. REPLY INPUT
========================================================= */

.input-box {
    display: none;
    margin-top: 10px;
    padding: 6px 0 5px;
}

.reply-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
}

.cancel-reply {
    color: #666;
    font-size: 12px;
    cursor: pointer;
}

.cancel-reply:hover {
    color: #111;
}


/* =========================================================
   18. COMMENT TREE / REPLY BRANCH
========================================================= */

.replies-branch {
    position: relative;
    margin: 0 0 0 18px;
    padding: 0 0 0 25px;
}

.replies-branch::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 20px;
    left: 0;
    width: 1.5px;
    background: var(--comment-line);
    border-radius: 2px;
}

.replies-list {
    position: relative;
}

.reply-node {
    position: relative;
    margin: 0;
    padding: 0;
}

.reply-node > .u-flex-start {
    position: relative;
    padding: 7px 0 6px;
}

.reply-node::before {
    content: "";
    position: absolute;
    top: 0;
    left: -25px;
    width: 17px;
    height: 27px;
    border-left: 1.5px solid var(--comment-line);
    border-bottom: 1.5px solid var(--comment-line);
    border-bottom-left-radius: 12px;
    pointer-events: none;
}

.reply-node:first-child::before {
    top: 0;
}

.reply-node:last-child::before {
    border-bottom-left-radius: 12px;
}

.reply-node > .replies-branch {
    margin-left: 14px;
    padding-left: 22px;
}

.reply-node > .replies-branch::before {
    left: 0;
    bottom: 20px;
}


/* =========================================================
   19. REPLY TOGGLE
========================================================= */

.replies-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 24px;
    margin: 0 0 5px -8px;
    padding: 2px 8px;
    background: var(--white);
    color: #6b7073;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
    z-index: 2;
}

.replies-btn:hover {
    color: var(--brand-blue);
}

.replies-btn i {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid currentColor;
    border-radius: 50%;
    font-size: 9px;
}

.replies-list {
    display: none;
}

.replies-list[style*="display: block"] {
    display: block;
}


/* =========================================================
   20. COMMENT LOAD MORE / EMPTY
========================================================= */

.load-more-text {
    display: none;
    margin: 2px 0 5px;
    padding: 4px 0;
    color: #6b7073;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.load-more-text:hover {
    color: var(--brand-blue);
}

.comments-empty {
    padding: 30px 10px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* =========================================================
   21. VOTE STATES
========================================================= */

.vote-btn-active {
    color: var(--brand-orange) !important;
}

.down-btn-active {
    color: #7193ff !important;
}


/* =========================================================
   22. RIGHT SIDEBAR / COMMUNITY LIST
========================================================= */

.sidebar-title {
    margin-bottom: 15px;
    color: var(--filter-text);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.community-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    margin-bottom: 8px;
}

.comm-logo {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: var(--radius-circle);
    background: #ddd;
    object-fit: cover;
}

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

.comm-name {
    display: block;
    overflow: hidden;
    color: var(--text-dark);
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.comm-members {
    color: var(--text-muted);
    font-size: 11px;
}

.explore-btn {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 8px 15px;
    margin-top: 15px;
    background: var(--brand-orange);
    border-radius: var(--radius-pill);
    color: var(--white);
    font-size: 15px;
    font-weight: 700;
    border: none;
    text-align: center;
}

/* =========================================================
   23. COMMUNITY PAGE
========================================================= */

.community-card {
    width: 100%;
    margin-bottom: 15px;
    overflow: hidden;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.community-cover {
    position: relative;
    width: 100%;
    height: clamp(120px, 25vw, 180px);
    overflow: hidden;
    background: #eee;
}

.community-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.community-body {
    position: relative;
    padding: 0 18px 18px;
}

.community-logo-wrap {
    position: relative;
    margin-top: -45px;
    margin-bottom: 12px;
}

.community-logo {
    width: 90px;
    height: 90px;
    border: 4px solid var(--white);
    border-radius: var(--radius-circle);
    background: var(--white);
    object-fit: cover;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.12);
}

.community-title {
    color: var(--text-dark);
    font-size: 20px;
    font-weight: 800;
}

.community-handle {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 12px;
}

.community-description {
    margin: 10px 0;
    color: #444;
    font-size: 14px;
    line-height: 1.5;
}

.community-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.community-stat {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 12px;
    background: var(--pill-gray);
    border-radius: var(--radius-pill);
    color: #555;
    font-size: 12px;
    font-weight: 700;
}


/* =========================================================
   24. COMMUNITY RULES
========================================================= */

.rules-accordion {
    position: relative;
}

.rules-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--reddit-blue);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
}

.rules-content {
    display: none;
    position: absolute;
    right: 0;
    bottom: 35px;
    width: 260px;
    padding: 12px;
    background: var(--white);
    border: 1px solid #ccc;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-dark);
    z-index: 100;
}

.rule-line {
    padding: 6px 0;
    border-bottom: 1px solid #eee;
    color: #333;
    font-size: 12px;
}

.rule-line:last-child {
    border-bottom: 0;
}


/* =========================================================
   25. PROFILE PAGE
========================================================= */

.profile-card {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.cover-photo-container {
    position: relative;
    width: 100%;
    height: clamp(120px, 25vw, 150px);
    overflow: hidden;
    background: #eee;
}

.cover-photo-container img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-body {
    position: relative;
    padding: 0 16px 16px;
}

.profile-avatar-container,
.avatar-wrap {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-top: -50px;
    margin-bottom: 12px;
}

.avatar-holder {
    position: relative;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border: 4px solid var(--white);
    border-radius: var(--radius-circle);
    background: var(--white);
    object-fit: cover;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

    .profile-details {
        display:flex;
        flex-wrap:wrap;
        gap:7px;
        margin:10px 0 8px;
    }
    .profile-detail {
        display:inline-flex;
        align-items:center;
        gap:6px;
        padding:5px 10px;
        border:1px solid var(--border-color,#e5e7eb);
        border-radius:20px;
        background:var(--bg-secondary,#f8fafc);
        color:var(--text-secondary,#64748b);
        font-size:13px;
        line-height:1;
        white-space:nowrap;
    }
    .profile-detail i {
        color:var(--primary-color,#0079d3);
        font-size:12px;
    }
    .profile-detail:hover {
        background:var(--bg-hover,#f1f5f9);
    }
    
/* =========================================================
   26. PROFILE ACTION BUTTONS
========================================================= */

.action-buttons,
.profile-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.icon-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    border: 1px solid var(--reddit-blue);
    border-radius: var(--radius-circle);
    color: var(--reddit-blue);
    font-size: 16px;
    cursor: pointer;
    transition: 0.2s;
}

.icon-btn:hover {
    background: #f5f9ff;
}

.profile-copy-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-circle);
    color: #555;
    cursor: pointer;
}

.profile-copy-btn:hover {
    background: var(--hover-gray);
}

.follow-btn {
    height: 36px;
    padding: 0 20px;
    background: var(--brand-blue);
    border-radius: var(--radius-pill);
    color: var(--white);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}

.follow-btn:hover {
    opacity: 0.9;
}

.token-pill {
    height: 36px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 16px;
    background: var(--pill-gray);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-pill);
    color: var(--text-dark);
    font-size: 13px;
    font-weight: 700;
}

.token-pill i {
    color: #ffb100;
}


/* =========================================================
   27. PROFILE TEXT
========================================================= */

.user-info h1,
.user-name-title,
.community-name {
    margin: 0;
    color: var(--text-dark);
    font-size: 20px;
    font-weight: 800;
}

.user-name-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bio,
.bio-text {
    margin: 10px 0;
    color: var(--text-dark);
    font-size: 14px;
    line-height: 1.4;
}

.user-handle {
    color: #777;
    font-size: 12px;
}


/* =========================================================
   28. PROFILE EDIT MODE
========================================================= */

.admin-cam-btn,
.edit-cam-btn {
    position: absolute;
    z-index: 5;
    display: none;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid #fff;
    border-radius: var(--radius-circle);
    color: #fff;
    cursor: pointer;
}

.edit-active .admin-cam-btn,
.edit-active .edit-cam-btn {
    display: flex;
}

.cov-pos {
    top: 15px;
    right: 15px;
}

.logo-pos,
.av-pos {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.admin-input,
.edit-field {
    display: none;
    width: 100%;
    padding: 10px;
    margin-top: 5px;
    background: var(--white);
    border: 1px solid var(--reddit-blue);
    border-radius: var(--radius-sm);
    outline: none;
    font-family: inherit;
    font-size: 14px;
}

.edit-field {
    resize: vertical;
}

.edit-active .view-text,
.edit-active .view-content {
    display: none;
}

.edit-active .admin-input,
.edit-active .edit-field {
    display: block;
}

.admin-save-bar,
.save-controls {
    display: none;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
}

.edit-active .admin-save-bar,
.edit-active .save-controls {
    display: flex;
}

.profile-mode-btn,
.profile-edit-trigger {
    padding: 6px 15px;
    background: var(--success);
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.profile-mode-btn:hover,
.profile-edit-trigger:hover {
    opacity: 0.9;
}

.profile-mode-btn.cancel {
    background: #888;
}


/* =========================================================
   29. PROFILE STATS / FOOTER
========================================================= */

.card-footer-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid #f2f4f5;
}

.follow-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
}

.stat-count {
    color: var(--text-dark);
    font-weight: 700;
}

.stat-label {
    color: #7c7c7c;
}

/* =========================================================
   30. PROFILE TABS
========================================================= */

.tab-bar-container {
    display: flex;
    align-items: center;
    width: 100%;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.profile-tabs {
    display: flex;
    align-items: center;
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
}

.profile-tabs::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 12px 16px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: #787c7e;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: color .2s ease, background-color .2s ease, border-color .2s ease;
}

.tab-btn i {
    font-size: 14px;
}

.tab-btn:hover {
    background: #f6f7f8;
    color: #1c1c1c;
}

.tab-btn.active {
    border-bottom-color: var(--reddit-blue);
    color: var(--reddit-blue);
    background: #f6f7f8;
}

.tab-btn:focus-visible {
    outline: 2px solid var(--reddit-blue);
    outline-offset: -2px;
}

/* =========================================================
   31. PROFILE FEED STATES
========================================================= */

.profile-empty {
    padding: 40px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-muted);
    text-align: center;
}

.profile-scroll-loader {
    display: none;
    padding: 20px;
    text-align: center;
}

.profile-scroll-loader .spin {
    display: inline-block;
    width: 24px;
    height: 24px;
    border-top-color: var(--success);
}

.profile-scroll-loader p {
    margin-top: 8px;
    color: #888;
    font-size: 11px;
    font-weight: 700;
}

.profile-no-more {
    display: none;
    padding: 20px;
    color: #888;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}

.profile-post-media {
    position: relative;
    aspect-ratio: var(--media-ratio);
    background: #f5f5f5;
}

.profile-post-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.profile-community-link {
    font-weight: 700;
}

.profile-delete-link {
    color: var(--danger) !important;
}


/* =========================================================
   32. MINI LOADER
========================================================= */

.spin-mini {
    display: none;
    width: 14px;
    height: 14px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--reddit-blue);
    border-radius: var(--radius-circle);
    animation: rotate 0.6s linear infinite;
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}


/* =========================================================
   33. OVERLAY
========================================================= */

.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1500;
}

.overlay.active {
    display: block;
}


/* =========================================================
   34. MOBILE DRAWER
========================================================= */

.drawer {
    position: fixed;
    top: 0;
    left: -280px;
    z-index: 2000;
    width: 280px;
    height: 100vh;
    padding: 20px;
    background: var(--white);
    transition: 0.3s;
}

.drawer.active {
    left: 0;
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
}

.drawer-title {
    color: var(--brand-orange);
    font-size: 18px;
    font-weight: 700;
}

.close-icon {
    font-size: 20px;
}


/* =========================================================
   35. MOBILE SEARCH
========================================================= */

.search-toggle {
    display: none;
}

.mobile-search-bar {
    display: none;
    height: 58px;
    align-items: center;
    gap: 4px;
    padding: 0 10px;
    background: var(--white);
}

.mobile-search-input {
    flex: 1;
    height: 40px;
    display: flex;
    align-items: center;
    padding: 0 14px;
    background: var(--pill-gray);
    border-radius: var(--radius-pill);
    color: #777;
}

.mobile-search-input i {
    flex-shrink: 0;
}

.mobile-search-input input {
    width: 100%;
    padding-left: 10px;
    background: transparent;
    border: 0;
    outline: 0;
    font-size: 14px;
}

.topbar.search-active #normalHeader {
    display: none;
}

.topbar.search-active .mobile-search-bar {
    display: flex;
}


/* =========================================================
   36. MOBILE BOTTOM NAVIGATION
========================================================= */

.bottom-nav {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1100;
    height: 60px;
    align-items: center;
    justify-content: space-around;
    background: var(--white);
    border-top: 1px solid var(--border-color);
}

.bottom-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    color: #555;
    font-size: 10px;
}

.bottom-item i {
    font-size: 18px;
}

.bottom-create {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin-top: -25px;
    background: var(--brand-orange);
    border: 4px solid var(--white);
    border-radius: var(--radius-circle);
    color: var(--white);
    font-size: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/*
|--------------------------------------------------------------------------
| SIDEBAR & MOBILE DISCOVER COMPONENTS
|--------------------------------------------------------------------------
| Shared styles for:
| - Trending Sidebar
| - Popular Communities Sidebar
| - Mobile Discover Drawer
| - Mobile Bottom Navigation
|--------------------------------------------------------------------------
*/


/*
|--------------------------------------------------------------------------
| TRENDING SIDEBAR
|--------------------------------------------------------------------------
*/

.trending-sidebar {
    overflow: hidden;
}


/*
|--------------------------------------------------------------------------
| Trending Header
|--------------------------------------------------------------------------
*/

.trending-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding-bottom: 10px;
    margin-bottom: 2px;

    border-bottom: 1px solid #eee;
}

.trending-header > div {
    display: flex;
    align-items: center;
    gap: 8px;
}


/*
|--------------------------------------------------------------------------
| Trending Icon
|--------------------------------------------------------------------------
*/

.trending-icon {
    width: 28px;
    height: 28px;

    border-radius: 8px;

    background: #fff1ed;
    color: #f4511e;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 13px;
}


/*
|--------------------------------------------------------------------------
| Trending HOT Label
|--------------------------------------------------------------------------
*/

.trending-label {
    color: #f4511e;
    background: #fff1ed;

    font-size: 9px;
    font-weight: 800;

    padding: 4px 7px;

    border-radius: 5px;

    letter-spacing: .5px;
}


/*
|--------------------------------------------------------------------------
| Trending List
|--------------------------------------------------------------------------
*/

.trending-list {
    display: flex;
    flex-direction: column;
}


/*
|--------------------------------------------------------------------------
| Trending Post
|--------------------------------------------------------------------------
*/

.trending-post {
    display: block;

    padding: 12px 2px;

    text-decoration: none;
    color: inherit;

    border-bottom: 1px solid #f0f0f0;

    transition: background-color .15s ease;
}

.trending-post:hover {
    background: #fafafa;
}

.trending-post:last-child {
    border-bottom: 0;
}


/*
|--------------------------------------------------------------------------
| Trending Post Title
|--------------------------------------------------------------------------
*/

.trending-post-title {
    display: -webkit-box;

    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;

    overflow: hidden;

    color: #202124;

    font-size: 13px;
    font-weight: 650;
    line-height: 1.4;
}


/*
|--------------------------------------------------------------------------
| Trending Post Meta
|--------------------------------------------------------------------------
*/

.trending-post-meta {
    display: flex;
    align-items: center;

    gap: 5px;
    margin-top: 5px;

    color: #8a8a8a;

    font-size: 10px;
    line-height: 1.3;
}


/*
|--------------------------------------------------------------------------
| Trending Community
|--------------------------------------------------------------------------
*/

.trending-community {
    color: #6875f5;
    font-weight: 600;

    max-width: 110px;

    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}


/*
|--------------------------------------------------------------------------
| Trending Separator
|--------------------------------------------------------------------------
*/

.site-ui-dot {
    display: inline-block;
    width: 3px;
    height: 3px;
    margin: 0 5px;
    border-radius: 50%;
    background: #bbb;
    vertical-align: middle;
    flex-shrink: 0;
}


/*
|--------------------------------------------------------------------------
| Trending Empty State
|--------------------------------------------------------------------------
*/

.trending-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 7px;

    padding: 25px 10px;

    color: #999;

    font-size: 11px;
}

.trending-empty i {
    font-size: 20px;
    color: #ccc;
}


/*
|--------------------------------------------------------------------------
| Trending More Link
|--------------------------------------------------------------------------
*/

.trending-more {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-top: 4px;
    padding: 10px 2px 2px;

    border-top: 1px solid #eee;

    color: #6875f5;

    text-decoration: none;

    font-size: 11px;
    font-weight: 700;
}

.trending-more:hover {
    color: #4f5bd5;
}

.trending-more i {
    font-size: 10px;
}


/*
|--------------------------------------------------------------------------
| MOBILE DISCOVER DRAWER
|--------------------------------------------------------------------------
*/


/*
|--------------------------------------------------------------------------
| Mobile Drawer Navigation
|--------------------------------------------------------------------------
*/

.mobile-drawer-nav {
    border-bottom: 1px solid #eee;

    padding-bottom: 10px;
    margin-bottom: 15px;
}

.mobile-drawer-nav .menu-item {
    display: flex;
    align-items: center;

    gap: 12px;
}


/*
|--------------------------------------------------------------------------
| Mobile Discover Section
|--------------------------------------------------------------------------
*/

.mobile-discover-section {
    padding: 0 15px 18px;
}


/*
|--------------------------------------------------------------------------
| Mobile Section Header
|--------------------------------------------------------------------------
*/

.mobile-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 10px;
}

.mobile-section-header span {
    font-size: 13px;
    font-weight: 700;

    color: #555;

    text-transform: uppercase;

    letter-spacing: .4px;
}

.mobile-section-header a {
    font-size: 12px;
    font-weight: 600;

    color: #3b5998;

    text-decoration: none;
}


/*
|--------------------------------------------------------------------------
| Mobile Community List
|--------------------------------------------------------------------------
*/

.mobile-community-list {
    display: flex;
    flex-direction: column;

    gap: 3px;
}


/*
|--------------------------------------------------------------------------
| Mobile Community Item
|--------------------------------------------------------------------------
*/

.mobile-community-item {
    display: flex;
    align-items: center;

    gap: 10px;

    padding: 10px 0;

    text-decoration: none;
    color: inherit;

    border-radius: 8px;
}

.mobile-community-item:active {
    background: #f3f4f6;
}


/*
|--------------------------------------------------------------------------
| Mobile Community Logo
|--------------------------------------------------------------------------
*/

.mobile-community-item img {
    width: 38px;
    height: 38px;

    border-radius: 50%;

    object-fit: cover;

    background: #f1f1f1;

    flex-shrink: 0;
}


/*
|--------------------------------------------------------------------------
| Mobile Community Information
|--------------------------------------------------------------------------
*/

.mobile-community-item div {
    min-width: 0;

    display: flex;
    flex-direction: column;
}

.mobile-community-item strong {
    font-size: 14px;
    font-weight: 650;

    white-space: nowrap;

    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-community-item span {
    margin-top: 2px;

    font-size: 11px;

    color: #888;
}


/*
|--------------------------------------------------------------------------
| Mobile Popular Posts
|--------------------------------------------------------------------------
*/

.mobile-popular-post-list {
    display: flex;
    flex-direction: column;

    gap: 3px;
}


/*
|--------------------------------------------------------------------------
| Mobile Popular Post
|--------------------------------------------------------------------------
*/

.mobile-popular-post {
    display: flex;
    flex-direction: column;

    padding: 9px 5px;

    text-decoration: none;
    color: inherit;

    border-radius: 8px;
}

.mobile-popular-post:active {
    background: #f3f4f6;
}


/*
|--------------------------------------------------------------------------
| Mobile Popular Post Title
|--------------------------------------------------------------------------
*/

.mobile-popular-post strong {
    display: -webkit-box;

    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;

    overflow: hidden;

    font-size: 13px;
    line-height: 1.35;
    font-weight: 650;
}


/*
|--------------------------------------------------------------------------
| Mobile Popular Post Meta
|--------------------------------------------------------------------------
*/

.mobile-popular-post span {
    margin-top: 4px;

    font-size: 11px;

    color: #888;
}


/*
|--------------------------------------------------------------------------
| Mobile Empty State
|--------------------------------------------------------------------------
*/

.mobile-discover-empty {
    padding: 8px 5px;

    font-size: 13px;

    color: #999;
}


/*
|--------------------------------------------------------------------------
| Mobile Bottom Avatar
|--------------------------------------------------------------------------
*/

.mobile-bottom-avatar {
    width: 22px;
    height: 22px;

    border-radius: 50%;

    object-fit: cover;
}



/* =========================================================
   37. MOBILE RESPONSIVE
========================================================= */

@media (max-width: 768px) {
    body {
        padding-bottom: 60px;
    }

    .mobile-toggle {
        display: flex;
    }

    .layout {
        display: block;
        width: 100%;
        padding: 0;
    }

    .sidebar {
        display: none;
    }

    .main-content {
        width: 100%;
        max-width: 600px;
        margin: 0 auto;
        
    }

    .search-box {
        display: none;
    }

    .search-toggle {
        display: flex;
        margin-left: auto;
    }

    .mobile-search-bar.active {
        display: flex;
    }

    .bottom-nav {
        display: flex !important;
    }

    /* Mobile post border adjustment */

    .post {
        margin-bottom: 10px;
        border-right: 0;
        border-left: 0;
        border-radius: 0;
    }

    .post-media {
        max-height: none;
        border-right: 0;
        border-left: 0;
        border-radius: 0;
    }

    .post-media img {
        width: 100%;
        height: auto;
        max-height: none;
        object-fit: contain;
    }

    /* Mobile comment border adjustment */

    .comment-section-area {
        padding: 15px 12px 20px;
        border-right: 0;
        border-left: 0;
        border-radius: 0;
    }

    .comment-input-wrap {
        gap: 8px;
    }

    .comment-input-avatar {
        width: 32px;
        height: 32px;
    }

    .avatar-box {
        width: 34px;
        height: 34px;
        flex: 0 0 34px;
    }

    .avatar-sm {
        width: 27px;
        height: 27px;
        flex: 0 0 27px;
    }

    .comment-sort-btn {
        padding: 7px 13px;
    }

    .act-group {
        gap: 14px;
    }

    .act-item {
        font-size: 11px;
    }

    /* Mobile comment tree */

    .replies-branch {
        margin-left: 12px;
        padding-left: 20px;
    }

    .replies-branch::before {
        left: 0;
        width: 1.5px;
        bottom: 20px;
    }

    .reply-node {
        margin: 0;
        padding: 0;
    }

    .reply-node > .u-flex-start {
        padding: 7px 0 6px;
    }

    .reply-node::before {
        top: 0;
        left: -20px;
        width: 14px;
        height: 25px;
        border-left-width: 1.5px;
        border-bottom-width: 1.5px;
        border-bottom-left-radius: 12px;
    }

    .reply-node > .replies-branch {
        margin-left: 10px;
        padding-left: 18px;
    }

    .reply-node > .replies-branch::before {
        left: 0;
        width: 1.5px;
    }

    .replies-btn {
        margin-left: -7px;
        padding: 2px 7px;
        font-size: 11px;
    }

    .replies-btn i {
        width: 17px;
        height: 17px;
        font-size: 8px;
    }

    .load-more-text {
        font-size: 11px;
    }

    /* Mobile profile */

    .profile-card,
    .community-card,
    .tab-bar-container {
        border-right: 0;
        border-left: 0;
        border-radius: 0;
    }

    .profile-body,
    .community-body {
        padding-right: 12px;
        padding-left: 12px;
    }

    .tab-btn {
        padding: 14px 16px;
    }

    .profile-edit-trigger {
        padding: 6px 12px;
    }

    .community-cover {
        height: 140px;
    }

    .community-logo {
        width: 80px;
        height: 80px;
    }

    .rules-content {
        right: 0;
        width: 240px;
    }
}


/* =========================================================
   38. SMALL MOBILE DEVICES
========================================================= */

@media (max-width: 480px) {
    .topbar-inner {
        padding: 0 10px;
        gap: 10px;
    }

    .logo {
        font-size: 22px;
    }

    .filter-container {
        padding-right: 10px;
        padding-left: 10px;
    }

    .comment-section-area {
        padding-right: 10px;
        padding-left: 10px;
    }

    .comment-toolbar {
        overflow-x: auto;
        padding-bottom: 12px;
    }

    .comment-sort-btn {
        flex-shrink: 0;
    }

    .post-header {
        padding-right: 12px;
        padding-left: 12px;
    }

    .post-body {
        padding-right: 12px;
        padding-left: 12px;
    }

    .post-actions {
        padding-right: 10px;
        padding-left: 10px;
    }

    /* Small mobile comment tree */

    .replies-branch {
        margin-left: 10px;
        padding-left: 18px;
    }

    .replies-branch::before {
        left: 0;
        width: 1.5px;
    }

    .reply-node::before {
        left: -18px;
        width: 12px;
        height: 24px;
    }

    .reply-node > .replies-branch {
        margin-left: 8px;
        padding-left: 16px;
    }

    .reply-node > .replies-branch::before {
        left: 0;
    }

    .replies-btn {
        margin-left: -6px;
    }

    .profile-avatar {
        width: 88px;
        height: 88px;
    }

    .profile-avatar-container,
    .avatar-wrap {
        margin-top: -44px;
    }

    .user-info h1,
    .user-name-title,
    .community-title {
        font-size: 18px;
    }

    .profile-actions,
    .action-buttons,
    .community-actions {
        flex-wrap: wrap;
    }
}


/* =========================================================
   39. FINAL BORDER CONSISTENCY
========================================================= */

.sidebar-box,
.post,
.comment-section-area,
.profile-card,
.community-card,
.tab-bar-container,
.profile-empty {
    border-color: var(--border-color);
}

.sidebar-box,
.post,
.comment-section-area,
.profile-card,
.community-card,
.tab-bar-container,
.profile-empty {
    border-width: 1px;
    border-style: solid;
}


/* =========================================================
   40. FINAL MOBILE BORDER CONSISTENCY
========================================================= */

@media (max-width: 768px) {
    .post,
    .comment-section-area,
    .profile-card,
    .community-card,
    .tab-bar-container {
        border-radius: 0;
    }
}
