/* =========================
   COMMUNITY PAGE
========================= */

.community-page{
    background:#f5f6f8;
    padding:40px 24px 90px;
}

.community-layout{
    max-width:1450px;
    margin:auto;
    display:grid;
    grid-template-columns:230px minmax(0,1fr)290px;
    gap:28px;
    align-items:start;
}

.community-top{
    display:none;
}

/* =========================
SIDEBARS
========================= */

.community-sidebar{
    position:sticky;
    top:105px;
}

.sidebar-card{
    background:#fff;
    border-radius:20px;
    padding:22px;
    margin-bottom:22px;
    border:1px solid #ececec;
    box-shadow:0 12px 32px rgba(0,0,0,.05);
    transition:.25s;
}

.sidebar-card:hover{
    transform:translateY(-2px);
    box-shadow:0 18px 38px rgba(0,0,0,.08);
}

.sidebar-card h1,
.sidebar-card h2,
.sidebar-card h3{

    margin-bottom:18px;
    color:#111;
}

.sidebar-card h1{

    font-size:28px;
}

.sidebar-card h2{

    font-size:22px;
}

.sidebar-card h3{

    font-size:20px;
}

.sidebar-card a{

    display:block;
    padding:11px 0;
    font-weight:600;
    color:#333;
    transition:.2s;
}

.sidebar-card a:hover{

    color:var(--gold);
    padding-left:6px;
}

/* =========================
MAIN
========================= */

.community-main{

    width:100%;
}

/* =========================
CREATE POST
========================= */

.social-create-card{

    display:flex;
    gap:18px;

    padding:24px;

    background:#fff;

    border-radius:22px;

    border-top:5px solid var(--gold);

    box-shadow:0 15px 35px rgba(0,0,0,.06);

    margin-bottom:26px;
}

.social-create-card img{

    width:68px;
    height:68px;
    border-radius:50%;
    object-fit:cover;
    flex-shrink:0;
}

.create-post-content{

    flex:1;
}

#postText{

    width:100%;

    min-height:110px;

    resize:vertical;

    border:1px solid #ddd;

    border-radius:16px;

    padding:18px;

    font-size:15px;

    transition:.2s;
}

#postText:focus{

    outline:none;

    border-color:var(--gold);

    box-shadow:0 0 0 4px rgba(212,175,55,.12);
}

.post-actions{

    display:flex;

    align-items:center;

    justify-content:space-between;

    gap:12px;

    margin-top:18px;

    flex-wrap:wrap;
}

.selected-media-name{

    color:#666;

    font-size:14px;
}

/* =========================
FEED
========================= */

.community-feed{

    width:100%;
}

.feed-card{

    background:#fff;

    border-radius:22px;

    border:1px solid #ececec;

    padding:24px;

    margin-bottom:26px;

    box-shadow:0 12px 32px rgba(0,0,0,.05);

    transition:.25s;
}

.feed-card:hover{

    box-shadow:0 18px 42px rgba(0,0,0,.08);
}

.feed-header{

    display:flex;

    gap:16px;

    align-items:center;

    margin-bottom:18px;
}

.feed-header img{

    width:62px;

    height:62px;

    border-radius:50%;

    object-fit:cover;

    flex-shrink:0;
}

.feed-header h3{

    margin:0;

    font-size:20px;

    font-weight:700;
}

.feed-header h3 a{

    color:#111;

    text-decoration:none;
}

.feed-header h3 a:hover{

    color:var(--gold);
}

.feed-header p{

    margin-top:4px;

    color:#777;

    font-size:14px;
}

.feed-text{

    margin-bottom:18px;

    color:#444;

    line-height:1.7;
}

.feed-image{

    width:100%;

    max-height:560px;

    border-radius:18px;

    object-fit:cover;

    margin-bottom:20px;
}

/* =========================
ACTIONS
========================= */

.feed-actions{

    display:grid;

    grid-template-columns:repeat(4,1fr);

    gap:10px;

    border-top:1px solid #ececec;

    padding-top:18px;
}

.feed-action-btn{

    border:none;

    background:#f5f5f5;

    border-radius:12px;

    padding:12px;

    font-weight:700;

    cursor:pointer;

    transition:.2s;
}

.feed-action-btn:hover{

    background:var(--gold);

    color:#fff;
}

.feed-action-btn.liked{

    background:rgba(212,175,55,.16);

    color:#8a6900;
}
/* =========================
   COMMENTS
========================= */

.comments-section {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid #eeeeee;
}

.comments-list {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
}

.comment-item {
    padding: 13px 15px;
    border-radius: 14px;
    background: #f4f5f7;
}

.comment-item strong {
    display: block;
    margin-bottom: 5px;
    color: #111111;
    font-size: 14px;
}

.comment-item p {
    margin: 0;
    color: #4e4e4e;
    font-size: 14px;
    line-height: 1.55;
}

.no-comments {
    margin: 0 0 14px;
    color: #777777;
    font-size: 14px;
}

.comment-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.comment-form input {
    flex: 1;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid #dddddd;
    border-radius: 12px;
    font-size: 14px;
    background: #ffffff;
}

.comment-form input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.12);
}

.comment-form button {
    min-height: 44px;
    padding: 11px 18px;
    border: none;
    border-radius: 12px;
    background: var(--gold);
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s ease;
}

.comment-form button:hover {
    transform: translateY(-1px);
    filter: brightness(0.95);
}

/* =========================
   CONNECTION CARDS
========================= */

#suggestedConnections {
    display: grid;
    gap: 14px;
}

.connection-card {
    padding: 15px;
    border: 1px solid #ececec;
    border-radius: 16px;
    background: #fafafa;
    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.connection-card:hover {
    transform: translateY(-2px);
    border-color: rgba(212, 175, 55, 0.5);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.06);
}

.connection-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.connection-user img {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    border-radius: 50%;
    object-fit: cover;
    background: #eeeeee;
}

.connection-user h3,
.connection-user h4 {
    margin: 0 0 4px;
    color: #111111;
    font-size: 15px;
    line-height: 1.3;
}

.connection-user p {
    margin: 0;
    color: #777777;
    font-size: 13px;
    line-height: 1.4;
}

.connect-btn {
    width: 100%;
    min-height: 42px;
    margin-top: 13px;
    padding: 10px 16px;
    border: 1px solid var(--gold);
    border-radius: 11px;
    background: #ffffff;
    color: #8a6900;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s ease;
}

.connect-btn:hover {
    background: var(--gold);
    color: #ffffff;
}

/* =========================
   COMMUNITY OPPORTUNITIES
========================= */

#communityOpportunities {
    display: grid;
    gap: 11px;
}

.community-opportunity-item {
    display: grid;
    gap: 6px;
    padding: 14px;
    border: 1px solid #e8e8e8;
    border-left: 4px solid var(--gold);
    border-radius: 12px;
    background: #f8f8f8;
    color: #222222;
    text-decoration: none;
    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.community-opportunity-item:hover {
    transform: translateY(-2px);
    border-color: var(--gold);
    background: #ffffff;
    box-shadow: 0 9px 22px rgba(0, 0, 0, 0.07);
}

.community-opportunity-category {
    color: #8a6900;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.community-opportunity-item strong {
    color: #111111;
    font-size: 14px;
    line-height: 1.4;
}

.community-opportunity-date {
    color: #777777;
    font-size: 12px;
}

.community-opportunities-link {
    display: block;
    margin-top: 15px;
    padding-top: 14px;
    border-top: 1px solid #eeeeee;
    color: #8a6900;
    font-size: 14px;
    font-weight: 800;
    text-align: center;
}

.community-opportunities-link:hover {
    color: var(--gold);
}

.community-opportunities-loading,
.community-opportunities-empty {
    margin: 0;
    padding: 14px;
    border: 1px dashed #d8d8d8;
    border-radius: 12px;
    background: #fafafa;
    color: #666666;
    font-size: 13px;
    line-height: 1.55;
    text-align: center;
}

/* =========================
   EMPTY AND STATUS MESSAGES
========================= */

.community-feed > p,
#suggestedConnections > p,
#suggestedConnections:not(:has(.connection-card)) {
    color: #666666;
}

.community-feed > p {
    padding: 28px;
    border: 1px dashed #d8d8d8;
    border-radius: 18px;
    background: #ffffff;
    text-align: center;
    line-height: 1.6;
}

/* =========================
   BUTTON AND MEDIA POLISH
========================= */

.social-create-card .btn-primary,
.social-create-card .btn-secondary {
    min-height: 44px;
    padding: 11px 18px;
    border-radius: 12px;
    font-weight: 700;
}

.social-create-card .btn-secondary {
    border: 1px solid #dddddd;
    background: #f6f6f6;
    color: #333333;
}

.social-create-card .btn-secondary:hover {
    border-color: var(--gold);
    background: rgba(212, 175, 55, 0.1);
    color: #72580f;
}

.feed-card video.feed-image {
    background: #111111;
}

/* =========================
   TABLET
========================= */

@media (max-width: 1200px) {
    .community-layout {
        grid-template-columns: 220px minmax(0, 1fr);
        gap: 24px;
    }

    .right-sidebar {
        display: none;
    }
}

/* =========================
   MOBILE AND SMALL TABLET
========================= */

@media (max-width: 850px) {
    .community-page {
        padding: 24px 16px 70px;
    }

    .community-layout {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .community-sidebar {
        position: static;
    }

    .left-sidebar {
        order: 2;
    }

    .community-main {
        order: 1;
    }

    .community-top {
        display: block;
        margin-bottom: 18px;
        padding: 22px;
        border-radius: 18px;
        background: #ffffff;
        box-shadow: 0 10px 28px rgba(0, 0, 0, 0.05);
    }

    .community-top h2 {
        margin: 0 0 8px;
        color: #111111;
        font-size: 26px;
    }

    .community-top p {
        margin: 0;
        color: #666666;
        line-height: 1.65;
    }

    .social-create-card {
        padding: 20px;
    }

    .feed-actions {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* =========================
   SMALL MOBILE
========================= */

@media (max-width: 600px) {
    .community-page {
        padding: 18px 12px 60px;
    }

    .social-create-card {
        display: block;
        padding: 18px;
        border-radius: 18px;
    }

    .social-create-card img {
        width: 54px;
        height: 54px;
        margin-bottom: 14px;
    }

    #postText {
        min-height: 100px;
        padding: 15px;
    }

    .post-actions {
        display: grid;
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .post-actions button {
        width: 100%;
    }

    .selected-media-name {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .feed-card {
        padding: 18px;
        border-radius: 18px;
        margin-bottom: 20px;
    }

    .feed-header {
        align-items: flex-start;
        gap: 12px;
    }

    .feed-header img {
        width: 52px;
        height: 52px;
    }

    .feed-header h3 {
        font-size: 17px;
    }

    .feed-image {
        max-height: 420px;
        border-radius: 14px;
    }

    .feed-actions {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .feed-action-btn {
        padding: 11px 8px;
        font-size: 13px;
    }

    .comment-form {
        display: grid;
        grid-template-columns: 1fr;
    }

    .comment-form button {
        width: 100%;
    }

    .sidebar-card {
        padding: 18px;
        border-radius: 18px;
    }
}

/* =========================
   VERY SMALL MOBILE
========================= */

@media (max-width: 380px) {
    .feed-actions {
        grid-template-columns: 1fr;
    }

    .community-top h2 {
        font-size: 23px;
    }
}
.community-media-preview {
  position: relative;
  margin-top: 12px;
  width: 100%;
}

.community-preview-media {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  border-radius: 12px;
  background: #000;
}

.remove-community-media {
  margin-top: 8px;
  padding: 7px 14px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}