/* Suggestions System - Premium Social Media UI */
/* Scoped to suggestions only so we don't break main site */
.suggestions-container,
.home-suggestions-section {
    --primary-color: #F47216;
    /* Orange */
    --secondary-color: #00A550;
    /* Green */
    --text-dark: #1a1a1a;
    --text-light: #666;
    --bg-gradient: var(--primary-color);

    --card-bg: #ffffff;
    --admin-bg: #fff0f0;
    --glass-bg: rgba(255, 255, 255, 0.95);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 16px rgba(0, 0, 0, 0.1);
    --radius-lg: 16px;
    --radius-md: 12px;
}

/* Main Container */
.suggestions-container {
    max-width: 680px;
    margin: 40px auto;
    padding: 0 15px;
    font-family: 'Manrope', 'Segoe UI', sans-serif;
    color: var(--text-dark);
}

.ward-title {
    text-align: center;
    margin-bottom: 25px;
    font-weight: 800;
    color: #1a1a1a;
    font-size: 2.2rem;
    letter-spacing: -0.5px;
    position: relative;
    padding-bottom: 15px;
}

.ward-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* Post Input Form */
.post-creation-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    margin-bottom: 30px;
    border: 1px solid #eaeaea;
}

.form-header {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: #444;
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-group {
    margin-bottom: 12px;
}

.custom-input,
.custom-textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #e0e0e0;
    border-radius: var(--radius-md);
    font-family: 'Manrope', sans-serif;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background: #f8f9fa;
    color: #333;
}

.custom-textarea {
    resize: vertical;
    min-height: 100px;
}

.custom-input:focus,
.custom-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(244, 153, 51, 0.1);
}

.file-upload-wrapper {
    margin-bottom: 15px;
    position: relative;
}

.preview-image-container {
    margin-top: 10px;
    max-height: 300px;
    overflow: hidden;
    border-radius: var(--radius-md);
    display: none;
    background: #f0f0f0;
}

.preview-image {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.post-actions {
    display: flex;
    justify-content: flex-end;
}

.btn-post {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    box-shadow: 0 4px 12px rgba(0, 165, 80, 0.25);
}

.btn-post:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(244, 114, 22, 0.35);
    background: var(--primary-color);
}

/* Feed & Posts */
.feed-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.post-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    border: 1px solid #f0f0f0;
    overflow: hidden;
    animation: fadeIn 0.4s ease-out;
    position: relative;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-card-inner {
    padding: 20px 20px 10px;
}

.post-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.user-avatar {
    width: 42px;
    height: 42px;
    background: #f0f2f5;
    border-radius: 50%;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #555;
    font-size: 1.1rem;
}

.post-meta {
    flex: 1;
}

.user-name {
    font-weight: 700;
    color: #111;
    display: block;
    font-size: 1rem;
    line-height: 1.2;
}

.post-time {
    font-size: 0.8rem;
    color: #888;
    font-weight: 500;
}

.post-content {
    color: #2c2c2c;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 15px;
    white-space: pre-wrap;
}

.post-image-container {
    background: #ffffff;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.post-image {
    width: 100%;
    display: block;
    max-height: 600px;
    object-fit: contain;
    /* Show full image, contain inside */
    background: #f8f8f8;
}

/* Action Bar (Like Comment) */
.post-actions-bar {
    padding: 10px 20px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 20px;
    align-items: center;
}

.action-btn {
    background: transparent;
    border: none;
    color: #65676b;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background 0.2s;
}

.action-btn:hover {
    background: #f0f2f5;
}

.action-btn.liked {
    color: #e0245e;
}

.action-btn.liked i {
    animation: pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes pop {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.4);
    }

    100% {
        transform: scale(1);
    }
}

/* Comment Section */
.comment-section-wrapper {
    background: #f9fafb;
    border-top: 1px solid #f0f0f0;
    display: none;
    /* Toggled */
    padding: 15px 20px;
}

.comment-input-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    align-items: flex-start;
}

.comment-input-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e4e6eb;
    flex-shrink: 0;
}

.comment-input {
    flex: 1;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 10px 15px;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.comment-input:focus {
    outline: none;
    border-color: #ccc;
    background: #fff;
}

.btn-send-comment {
    background: transparent;
    border: none;
    color: var(--secondary-color);
    font-size: 1.2rem;
    padding: 5px;
    cursor: pointer;
    margin-top: 2px;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.comment-item {
    display: flex;
    gap: 10px;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e4e6eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: #666;
    flex-shrink: 0;
}

.comment-bubble-container {
    max-width: 90%;
}

.comment-bubble {
    background: #f0f2f5;
    padding: 8px 12px;
    border-radius: 18px;
    border-top-left-radius: 4px;
    display: inline-block;
}

.comment-author-name {
    font-weight: 700;
    font-size: 0.85rem;
    color: #050505;
    margin-bottom: 2px;
    display: block;
}

.comment-text-content {
    color: #050505;
    font-size: 0.95rem;
    line-height: 1.4;
}

.comment-timestamp {
    display: block;
    margin-top: 4px;
    font-size: 0.75rem;
    color: #65676b;
    margin-left: 5px;
}

/* Admin Features */
body.admin-mode-active .admin-controls {
    display: flex;
}

.admin-controls {
    position: absolute;
    top: 15px;
    right: 15px;
    display: none;
    gap: 8px;
    background: rgba(255, 255, 255, 0.9);
    padding: 4px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-icon-admin {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: all 0.2s;
}

.btn-icon-admin:hover {
    background: #eee;
    color: #333;
}

.btn-icon-admin.delete:hover {
    background: #ffebee;
    color: #d32f2f;
}

/* Admin Reply Legacy Styling but improved */
.admin-reply-block {
    background: #f0fdf4;
    padding: 15px;
    border-radius: 12px;
    margin: 15px 20px 20px;
    border: 1px solid #dcfce7;
}

/* Responsive */
@media (max-width: 600px) {
    .suggestions-container {
        padding: 0 15px;
        margin-top: 20px;
    }

    .ward-title {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }

    .post-creation-card {
        padding: 15px;
        border-radius: var(--radius-md);
        margin-bottom: 20px;
    }

    .post-card {
        border-radius: var(--radius-lg);
        margin: 0 0 20px 0;
        box-shadow: var(--shadow-md);
        border: 1px solid #f0f0f0;
    }

    .post-image-container {
        max-height: 350px;
    }

    .post-image {
        max-height: 350px;
    }

    .post-card-inner {
        padding: 15px 15px 10px;
    }

    .post-actions-bar {
        padding: 10px 15px;
        gap: 10px;
    }

    .action-btn {
        padding: 6px 10px;
        font-size: 0.9rem;
    }

    .comment-section-wrapper {
        padding: 15px;
    }

    .comment-input-container {
        flex-direction: column;
        gap: 8px;
    }

    .comment-input {
        width: 100%;
        border-radius: 12px;
    }

    .btn-send-comment {
        align-self: flex-end;
    }
}

/* --- Homepage Suggestions Section --- */

.home-suggestions-section {
    padding: 80px 0;
    background: #ffffff;
    /* Match template white/clean look */
    position: relative;
    z-index: 1;
}

.suggestion-tabs-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 50px;
}

.suggestion-tabs {
    display: inline-flex;
    background: #f4f7f6;
    /* Subtle background for tabs */
    padding: 6px;
    border-radius: 50px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.03);
}

.suggestion-tab {
    padding: 12px 30px;
    border: none;
    background: transparent;
    border-radius: 40px;
    font-weight: 700;
    color: #555;
    cursor: pointer;
    transition: all 0.4s ease;
    font-family: 'Manrope', sans-serif;
    letter-spacing: 0.5px;
    font-size: 0.95rem;
}

.suggestion-tab.active {
    background: var(--secondary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 165, 80, 0.4);
    transform: translateY(-1px);
}

.suggestion-tab:hover:not(.active) {
    color: var(--secondary-color);
}

/* Home Feed Grid */
#home-suggestions-feed {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin: 30px auto;
}

/* Home Suggestion Card */
.home-suggestion-card {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    border: 1px solid #eee;
}

.home-suggestion-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}

.card-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 4/5;
    background: #f8f8f8;
    overflow: hidden;
}

.card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.home-suggestion-card:hover .card-image-wrapper img {
    transform: scale(1.05);
}

.image-overlay-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.9);
    width: 30px;
    height: 30px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.card-content-wrapper {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-text-body p {
    font-size: 0.9rem;
    color: #444;
    line-height: 1.5;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 4.5em;
}

.card-author-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    padding-top: 10px;
}

.home-user-avatar {
    width: 32px;
    height: 32px;
    background: #f0f0f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.home-user-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.home-user-name {
    font-weight: 700;
    font-size: 0.85rem;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.home-post-time {
    font-size: 0.7rem;
    color: #999;
}

.card-metrics {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
    font-size: 0.8rem;
    color: #777;
}

.card-metrics span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.card-share-btn {
    margin-left: auto;
    color: #bbb;
    cursor: pointer;
}

.card-share-btn:hover {
    color: var(--primary-color);
}

/* Modal Styling */
.suggestion-modal {
    --primary-color: #F47216;
    --secondary-color: #00A550;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.suggestion-modal.active {
    display: flex;
    opacity: 1;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
}

.modal-container {
    position: relative;
    width: 95%;
    max-width: 1200px;
    height: 90vh;
    background: #fff;
    border-radius: 4px;
    overflow: visible;
    z-index: 10;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 100px rgba(0, 0, 0, 0.5);
}

.modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    z-index: 20;
}

.modal-content {
    display: flex;
    flex-direction: row;
    height: 100%;
    width: 100%;
    background: #fff;
}

.modal-image-side {
    flex: 1;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    min-width: 300px;
}

.modal-image-side img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.modal-details-side {
    flex: 0 0 400px;
    width: 400px;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-left: 1px solid #efefef;
    padding: 0;
    min-width: 400px;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #efefef;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.modal-avatar {
    width: 42px;
    height: 42px;
    background: #f0f0f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-user-info h4 {
    font-weight: 700;
    font-size: 1rem;
    margin: 0;
}

.modal-user-info p {
    font-size: 0.8rem;
    color: #8e8e8e;
    margin: 0;
}

.modal-actions {
    display: flex;
    gap: 10px;
}

.btn-facebook {
    background: #0095f6;
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
}

.btn-share {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #262626;
    cursor: pointer;
}

.modal-body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

#modal-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #262626;
    margin-bottom: 20px;
}

.modal-actions-inline {
    display: flex;
    gap: 15px;
    margin-top: auto;
    padding-top: 15px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #efefef;
}

.modal-stats {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.modal-stats span {
    font-weight: 700;
    font-size: 0.95rem;
    color: #262626;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-stats span i {
    color: var(--primary-color);
    font-size: 1.1rem;
}

.btn-view-details {
    display: block;
    width: 100%;
    background: var(--primary-color);
    color: #fff !important;
    text-align: center;
    padding: 14px;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.3s, transform 0.2s;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-view-details:hover {
    background: #e0852a;
    transform: translateY(-2px);
}

.btn-show-more {
    background: #00A550;
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: opacity 0.3s;
}

.btn-show-more:hover {
    opacity: 0.9;
}

/* Modal Nav (optional arrows) */
.modal-nav {
    position: absolute;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
    pointer-events: none;
}

.modal-nav button {
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    pointer-events: auto;
}

@media (max-width: 900px) {
    .modal-content {
        flex-direction: column;
        overflow-y: visible;
        /* Let the container handle overflow if needed, or specific areas */
        height: auto;
    }

    .modal-container {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
        overflow-y: auto;
    }

    .modal-image-side {
        flex: 0 0 auto;
        min-height: auto;
        max-height: none;
        width: 100%;
    }

    .modal-image-side img {
        height: auto;
        max-height: 50vh;
    }

    .modal-details-side {
        flex: 1 0 auto;
        width: 100%;
        min-width: 100%;
        border-left: none;
        border-top: 1px solid #efefef;
        min-height: auto;
    }

    .modal-close {
        top: 20px;
        right: 20px;
        background: rgba(0, 0, 0, 0.6);
        color: #fff;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        z-index: 100;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    }

    .modal-body {
        overflow-y: visible;
        padding: 20px;
    }

    .modal-stats {
        margin-bottom: 20px;
    }

    .modal-actions-inline {
        margin-top: 20px;
        flex-wrap: wrap;
    }
}

/* Highlight for deep links */
.highlight-suggestion {
    animation: highlightPulse 2s ease-out;
}

@keyframes highlightPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(244, 114, 22, 0.4);
        border-color: var(--primary-color);
    }

    50% {
        box-shadow: 0 0 0 10px rgba(244, 114, 22, 0);
        border-color: var(--primary-color);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(244, 114, 22, 0);
    }
}

/* Empty State & View All */
.no-suggestions-home {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: 16px;
    border: 2px dashed #eee;
}

.no-suggestions-home i {
    font-size: 3rem;
    color: #e0e0e0;
    margin-bottom: 15px;
    display: inline-block;
}

.no-suggestions-home p {
    color: #888;
    margin-bottom: 25px;
    font-size: 1.1rem;
}

.view-all-container {
    grid-column: 1 / -1;
    text-align: center;
    margin-top: 50px;
}

/* Responsive Logic */
@media (max-width: 1200px) {
    #home-suggestions-feed {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    #home-suggestions-feed {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .home-suggestions-section {
        padding: 50px 0;
    }

    #home-suggestions-feed {
        grid-template-columns: 1fr;
    }

    .suggestion-tab {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .view-all-container {
        margin-top: 30px;
    }
}

@media (max-width: 480px) {
    #home-suggestions-feed {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .suggestion-tabs {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    .modal-user-info h4 {
        font-size: 0.9rem;
    }

    .btn-view-details {
        font-size: 0.9rem;
        padding: 12px;
    }
}