/* Ek Pahal - Forum Page */
.forum-page {
    padding-bottom: 60px;
}

/* Small blue header */
.forum-page-header {
    background: linear-gradient(135deg, #1a237e 0%, #1565c0 100%);
    color: #fff;
    padding: 20px 0;
    margin-bottom: 32px;
}

.forum-page-header h1 {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 4px;
}

.forum-page-header p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.85;
}

.forum-container-wide {
    max-width: 1140px;
}

.forum-guest-banner {
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

.forum-guest-banner p {
    margin: 0;
    color: #5d4037;
    font-weight: 500;
    font-size: 0.9rem;
}

/* Forum auth — Login + Register dropdowns */
.forum-auth-prompt.forum-guest-banner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border-color: #e2e8f0;
    padding: 16px 20px;
}

.forum-auth-dropdowns {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    flex-shrink: 0;
}

.forum-auth-prompt.compact {
    padding: 16px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.forum-auth-title { margin: 0; }

.forum-auth-login-btn {
    min-width: 110px;
}

.forum-compose {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 28px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid #e8edf2;
}

.forum-compose-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.forum-compose-header h3 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    color: #1a237e;
}

.forum-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.forum-user-avatar.sm {
    width: 34px;
    height: 34px;
    font-size: 0.8rem;
}

.forum-user-avatar.admin { background: linear-gradient(135deg, #c62828, #ef5350); }
.forum-user-avatar.ngo { background: linear-gradient(135deg, #1565c0, #42a5f5); }
.forum-user-avatar.permanent { background: linear-gradient(135deg, #e65100, #ff9800); }
.forum-user-avatar.employee { background: linear-gradient(135deg, #6a1b9a, #ab47bc); }
.forum-user-avatar.public { background: linear-gradient(135deg, #2e7d32, #66bb6a); }

.forum-compose textarea {
    border-radius: 10px;
    border: 2px solid #e8edf2;
    padding: 12px;
    font-size: 0.9rem;
}

.forum-compose textarea:focus {
    border-color: #1565c0;
    box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.15);
}

.forum-btn-primary {
    background: linear-gradient(135deg, #1565c0, #1a237e);
    color: #fff;
    border: none;
    padding: 10px 22px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.forum-btn-primary:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(21, 101, 192, 0.35);
}

/* Topic sections */
.forum-topic-section {
    margin-bottom: 36px;
}

.forum-topic-header {
    background: #e3f2fd;
    color: #1565c0;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-left: 4px solid #1565c0;
}

.forum-topic-count {
    font-size: 0.8rem;
    font-weight: 600;
    opacity: 0.8;
}

/* Horizontal scrollable topic cards */
.forum-cards-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 4px 14px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #1565c0 #e3f2fd;
}

.forum-cards-scroll::-webkit-scrollbar {
    height: 8px;
}

.forum-cards-scroll::-webkit-scrollbar-track {
    background: #e3f2fd;
    border-radius: 4px;
}

.forum-cards-scroll::-webkit-scrollbar-thumb {
    background: #1565c0;
    border-radius: 4px;
}

.forum-topic-card-wrap {
    flex: 0 0 300px;
    max-width: 300px;
    scroll-snap-align: start;
}

/* Topic cards */
.forum-topic-card {
    background: #fff;
    border-radius: 12px;
    padding: 18px;
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid #e8edf2;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s, box-shadow 0.2s;
}

.forum-topic-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(21, 101, 192, 0.12);
}

.forum-topic-card-head {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
}

.forum-topic-author {
    font-weight: 700;
    font-size: 0.9rem;
    color: #1e293b;
    line-height: 1.2;
}

.forum-topic-date {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 2px;
}

.forum-topic-excerpt {
    font-size: 0.88rem;
    color: #475569;
    line-height: 1.55;
    flex: 1;
    margin-bottom: 14px;
}

.forum-topic-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.forum-topic-replies {
    font-size: 0.8rem;
    color: #94a3b8;
    font-weight: 600;
}

.forum-topic-btn {
    width: 100%;
    background: #f0f7ff;
    color: #1565c0;
    border: 1px solid #bbdefb;
    padding: 8px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.forum-topic-btn:hover {
    background: #1565c0;
    color: #fff;
    border-color: #1565c0;
}

.forum-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 50px;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: capitalize;
}

.forum-badge.admin { background: #fee2e2; color: #b91c1c; }
.forum-badge.ngo { background: #dbeafe; color: #1d4ed8; }
.forum-badge.permanent { background: #ffedd5; color: #c2410c; }
.forum-badge.employee { background: #f3e8ff; color: #7e22ce; }
.forum-badge.public { background: #dcfce7; color: #15803d; }

/* Chat Modal - WhatsApp style */
.forum-chat-modal-wrap .modal-dialog {
    max-width: 520px;
}

.forum-modal {
    border: none;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 85vh;
}

.forum-modal-header {
    background: linear-gradient(135deg, #1a237e, #1565c0);
    color: #fff;
    border: none;
    flex-shrink: 0;
    padding: 14px 18px;
}

.forum-modal-header .modal-title {
    font-weight: 700;
    font-size: 1rem;
}

.forum-modal-header small {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.8rem;
}

.forum-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #e5ddd5;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23d4cdc4' fill-opacity='0.4'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    min-height: 320px;
    max-height: 55vh;
}

.chat-row {
    display: flex;
    margin-bottom: 10px;
    clear: both;
}

.chat-row.left {
    justify-content: flex-start;
}

.chat-row.right {
    justify-content: flex-end;
}

.chat-bubble {
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    word-wrap: break-word;
}

.chat-bubble.received {
    background: #fff;
    border-top-left-radius: 0;
}

.chat-bubble.sent {
    background: #dcf8c6;
    border-top-right-radius: 0;
}

.bubble-sender {
    font-size: 0.75rem;
    font-weight: 700;
    color: #1565c0;
    margin-bottom: 4px;
}

.chat-bubble.sent .bubble-sender {
    color: #2e7d32;
}

.bubble-text {
    font-size: 0.9rem;
    color: #1e293b;
    line-height: 1.5;
}

.bubble-time {
    font-size: 0.65rem;
    color: #94a3b8;
    text-align: right;
    margin-top: 4px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

.chat-bubble.sent .bubble-ticks {
    color: #53bdeb;
    font-size: 0.7rem;
    line-height: 1;
}

.forum-chat-footer {
    flex-shrink: 0;
    background: #f0f2f5;
    padding: 10px 14px;
    border-top: 1px solid #e0e0e0;
}

.forum-chat-form {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.forum-chat-form textarea {
    flex: 1;
    border-radius: 24px;
    border: none;
    padding: 10px 16px;
    font-size: 0.9rem;
    resize: none;
    max-height: 100px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.forum-chat-form textarea:focus {
    outline: none;
    box-shadow: 0 0 0 2px #dcf8c6;
}

.forum-chat-send {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: #25d366;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.forum-chat-send:hover {
    background: #1da851;
}

.forum-login-prompt {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    padding: 16px;
    text-align: center;
}

.forum-empty {
    text-align: center;
    padding: 50px 20px;
    background: #fff;
    border-radius: 12px;
    border: 2px dashed #e2e8f0;
}

.forum-empty i {
    font-size: 2.5rem;
    color: #cbd5e1;
    margin-bottom: 12px;
}

.forum-empty h4 {
    color: #475569;
    font-weight: 700;
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    .forum-guest-banner,
    .forum-auth-prompt.forum-guest-banner {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }

    .forum-auth-dropdowns {
        justify-content: center;
        width: 100%;
    }

    .forum-page-header h1 {
        font-size: 1.15rem;
    }

    .forum-cards-scroll {
        flex-direction: column;
        overflow-x: visible;
        gap: 10px;
        padding: 0;
    }

    .forum-topic-card-wrap {
        flex: none;
        max-width: 100%;
        width: 100%;
    }
}
