/* Community components styles */

/* GDFooter (from GD.BlazorUI) must not appear on the community page, mobile only. */
@media (max-width: 959.98px) {
    body:has(.community-mobile-page) .GD-footer {
        display: none !important;
    }
}

/* TodayInCommunity - Section titles with bottom border */
.section-title {
    border-bottom: 0.125rem solid #FF6B35;
    padding-bottom: 0.5rem;
}

/* QuickSurvey - Survey bullet points */
.survey-bullet {
    color: #4C83EE !important;
    font-size: 1.5rem;
    line-height: 1;
    flex-shrink: 0;
}

/* WeeklyPhoto - Photo container and text styles */
.photo-container {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 0.5rem;
    background-color: #f0f0f0;
}

.weekly-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vote-text {
    color: #4C83EE !important;
}

/* ChannelsList - Channel avatar styles */
.channel-image-circular {
    border-radius: 50%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.channel-container {
    max-width: 7.5rem;
}

.channel-avatar-size {
    width: 7.5rem !important;
    height: 7.5rem !important;
    min-width: 7.5rem !important;
    min-height: 7.5rem !important;
}

.channel-avatar-size-mobile {
    width: 3.25rem;
    height: 3.25rem;
    min-width: 3.25rem;
    min-height: 3.25rem;
}

.channels-vertical-divider {
    height: 100px !important; 
    align-self: center; 
    border-width: 2px !important;
}

.channel-member-border {
    border: 3px solid var(--mud-palette-secondary-blue-60O);
    box-sizing: border-box;
}

.channel-image-wrapper {
    position: relative;
    display: inline-block;
}

.channel-in-badge {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translate(-50%, 0);
    background: color-mix(in srgb, var(--mud-palette-secondary-blue) 60%, #fff 40%);
    color: #fff;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: bold;
    z-index: 2;
    transition: transform 0.2s ease;
}

.channel-in-badge .mud-icon-root {
    font-size: 0.8rem !important;
}

.channel-container:hover .channel-image-circular {
    transform: scale(1.08);
}

.channel-container:hover .channel-in-badge {
    transform: translate(-50%, -2px) scale(1.08);
}

/* ChannelsList - Mobile normal horizontal scroll (same behavior as Home apps scroll) */
.channels-mobile-title {
    font-weight: bold;
    font-size: 13px !important;
}

.channels-mobile-scroll {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 1rem 0.75rem;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.channel-mobile-item {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    margin-right: 0.75rem;
}

.channel-mobile-name {
    font-size: 10px !important;
}

.channel-mobile-item:last-child {
    margin-right: 0;
}

.channel-mobile-item .channel-container {
    width: auto;
}

@media (max-width: 959.98px) {
    .channels-mobile-scroll {
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .channels-mobile-scroll::-webkit-scrollbar {
        display: none;
    }

    .channel-mobile-item .channel-in-badge {
        width: 18px;
        height: 18px;
        top: -6px;
        font-size: 0.7rem;
    }
}

/* Quill read-only display: remove editor chrome */
.ql-editor-display {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

.ql-editor-display .ql-editor {
    border: none !important;
    outline: none !important;
    padding: 0 !important;
    overflow: visible !important;
    min-height: unset !important;
    height: auto !important;
}

.ql-editor-display .ql-editor a {
    color: var(--mud-palette-primary) !important;
    text-decoration: underline !important;
}

/* Posts */
.post-component {
    min-height: 10rem;
    height: auto;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    position: relative;
    overflow: visible;
}

/* Post Top Right Area (channel badge + admin actions) */
.post-top-right-area {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

/* Post Admin Actions */
.post-admin-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0.25rem;
    border-radius: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.post-component:hover .post-admin-actions {
    opacity: 1;
}

@media (max-width: 959.98px) {
    .post-admin-actions {
        position: absolute;
        top: 0.2rem;
        right: 3rem;
        z-index: 10;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 0.25rem;
        opacity: 1;
    }

    .post-admin-actions-top-right {
        position: absolute;
        top: 0.2rem;
        right: 0.5rem;
        z-index: 10;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 0.25rem;
        opacity: 1;
    }
}

/* Post Channel Badge - Vertical (like ChannelsList) */
.post-channel-badge-vertical {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    transition: transform 0.2s ease;
}

.post-channel-badge-vertical:hover {
    transform: scale(1.08);
}

.post-channel-badge-avatar {
    width: 2.5rem !important;
    height: 2.5rem !important;
    min-width: 2.5rem !important;
    min-height: 2.5rem !important;
    border-radius: 50% !important;
    object-fit: cover !important;
}

.post-channel-badge-label {
    color: var(--mud-palette-dark-gray) !important;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 5rem;
    text-align: center;
    line-height: 1.2;
}

.post-admin-actions button {
    transition: all 0.2s ease;
}

.post-admin-actions button:hover {
    transform: scale(1.1);
}

.post-admin-actions .edit-btn {
    color: var(--medium-gray) !important;
    background: transparent !important;
    box-shadow: none !important;
    transition: background 0.2s;
}

.post-admin-actions .edit-btn:hover {
    color: var(--medium-gray) !important;
    background: var(--mud-palette-medium-gray-10O) !important;
    box-shadow: none !important;
}

/* Draft tag - shown next to author name for draft posts */
.draft-tag {
    display: inline-block;
    background-color: var(--mud-palette-light-gray);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    margin-left: 8px;
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
}

/* Engagement icons (like/comment/views) shown but disabled for drafts */
.engagement-disabled {
    opacity: 0.6;
    cursor: not-allowed !important;
    pointer-events: none;
}

.engagement-disabled:hover {
    opacity: 0.6;
}

.post-admin-actions .delete-btn {
    color: var(--medium-gray) !important;
    background: transparent !important;
    box-shadow: none !important;
    transition: background 0.2s, color 0.2s;
}

.post-admin-actions .delete-btn:hover {
    color: var(--mud-palette-danger-red) !important;
    background: var(--mud-palette-danger-red-lighter) !important;
    box-shadow: none !important;
}

.post-content-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: visible;
    padding: 0.75rem;
}

.post-main-content {
    flex: 1;
    overflow: visible;
}

.post-content-clamp .ql-editor {
    display: -webkit-box;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

    .post-content-clamp .ql-editor p,
    .post-content-clamp .ql-editor ul,
    .post-content-clamp .ql-editor ol {
        margin: 0;
        padding: 0;
    }

.post-channel-badge-inline {
    flex-shrink: 0;
    white-space: nowrap;
}

    .post-channel-badge-inline .post-channel-badge-avatar {
        width: 1.8rem;
        height: 1.8rem;
        border-radius: 50%;
        object-fit: cover;
    }

    .post-channel-badge-inline .post-channel-badge-label {
        max-width: 6rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.custom-low-tooltip {
    z-index: 500 !important;
}  

.post-content-image {
    width: 80% !important;
    height: auto !important;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.post-content-image img {
    width: 100% !important;
    height: auto !important;
    border-radius: 12px;
    display: block;
}

.post-component .mud-typography.dark-gray.bold,
.post-component .mud-typography.dark-gray.pt-2 {
    display: block;
    overflow: visible;
    text-overflow: initial;
    -webkit-line-clamp: initial;
    -webkit-box-orient: initial;
}

.post-footer {
    position: static;
    margin-top: auto;
    height: fit-content;
    padding: 0.75rem;
    padding-top: 0;
}

.post-stats {
    margin-left: auto;
}

.post-avatar-image {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    object-position: center !important;
    margin-right: 0.375rem !important;
}

.publication-date {
    text-align: end !important;
}

/* Channel selection buttons - center text and remove icon space */
.create-post-container .mud-button-label {
    justify-content: center !important;
}

.create-post-container .create-post-channel-label {
    display: inline-flex;
    align-items: center;
    height: 2rem;
    line-height: 1;
    margin: 0;
}

.create-post-channel-select {
    min-width: 10rem;
    max-width: 100%;
}

.create-post-channel-popover {
    z-index: 10000 !important;
}

.create-post-channel-popover .mud-list {
    max-height: 15rem;
    overflow-y: auto;
}

.create-post-container .mud-button-root {
    align-self: center;
}

/* Attachment button - no background, fully rounded, with hover effect */
.attachment-button {
    border-radius: 50% !important;
    cursor: pointer;
    transition: transform 0.2s ease, color 0.2s ease;
}

.attach-file-trigger:hover .attachment-button {
    transform: scale(1.15);
    color: var(--mud-palette-primary) !important;
}

.attachment-eye-icon {
    cursor: pointer;
    transition: transform 0.2s ease, color 0.2s ease;
}

.attachment-eye-icon:hover {
    transform: scale(1.15);
    color: var(--mud-palette-primary) !important;
}

.create-post-upload-box {
    width: min(calc(100% - 2rem), 30rem);
    aspect-ratio: 16 / 9;
    max-height: 300px;
    border-radius: 12px;
    border: 2px dashed var(--mud-palette-secondary-blue);
    background: color-mix(in srgb, var(--mud-palette-secondary-blue) 20%, #fff 80%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-left: auto;
    margin-right: auto;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.create-post-upload-box:hover {
    transform: scale(1.01);
    background: color-mix(in srgb, var(--mud-palette-secondary-blue) 28%, #fff 72%);
}

.create-post-upload-box-disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: default;
}

.create-post-upload-box-disabled:hover {
    transform: none;
    background: color-mix(in srgb, var(--mud-palette-secondary-blue) 20%, #fff 80%);
}

.create-post-upload-box-text {
    color: var(--mud-palette-secondary-blue) !important;
    font-weight: 500;
    white-space: nowrap !important;
}

.article-upload-fileupload {
    display: flex !important;
    justify-content: center;
    pointer-events: none;
}

.article-upload-fileupload .create-post-upload-box {
    pointer-events: auto;
}

.create-post-upload-inline-text {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    flex-wrap: nowrap;
    white-space: nowrap !important;
}

.create-post-upload-inline-icon {
    font-size: 0.95rem !important;
    margin: 0 0.1rem;
    color: var(--mud-palette-secondary-blue) !important;
}

/* Spacing for the remove file button next to file name */
.create-post-container .file-remove-btn {
    margin-left: 0.25rem;
}


/* Post preview remove button hover */
.post-preview-remove-btn {
    transition: transform 0.2s ease, background-color 0.2s ease !important;
}

.post-preview-remove-btn:hover {
    transform: scale(1.15) !important;
    background: rgba(0, 0, 0, 0.7) !important;
}

.create-post-modal-layout .create-post-channel-selector {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.create-post-modal-layout .create-post-channel-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
}

.create-post-modal-layout .create-post-channel-buttons .mud-button-root {
    border-radius: 0;
}

.create-post-modal-layout .create-post-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.create-post-modal-layout {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
}

/* CreatePost - Loading overlay during submission */
.create-post-container {
    position: relative;
}

.create-post-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: inherit !important;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: inherit;
}

/* CreatePost preview modal - static reel preview */
.create-post-preview-static-wrap {
    width: min(100%, 26rem);
    margin: 0 auto;
}

.create-post-preview-static-wrap .reel-image-wrapper,
.create-post-preview-static-wrap .reel-square-media {
    width: 22rem !important;
    max-width: 100% !important;
    margin-left: auto;
    margin-right: auto;
}

.create-post-preview-static-wrap .publication-component-preview,
.create-post-preview-static-wrap .reel-publication-card,
.create-post-preview-static-wrap .reel-overlay-bar,
.create-post-preview-static-wrap .reel-tag-click-area,
.create-post-preview-static-wrap .reel-share-action,
.create-post-preview-static-wrap .cursor-pointer {
    pointer-events: none !important;
    cursor: default !important;
}

.create-post-preview-static-wrap .reel-publication-card,
.create-post-preview-static-wrap .reel-publication-card:hover {
    transform: none !important;
}

.create-post-preview-static-wrap .toggle-icon-hover:hover,
.create-post-preview-static-wrap .reel-share-icon:hover,
.create-post-preview-static-wrap .tag:hover {
    transform: none !important;
    opacity: 1 !important;
    box-shadow: none !important;
    filter: none !important;
}

.modal-publication-preview.GD-modal.mud-dialog {
    width: min(80vw, 400px) !important;
    max-width: min(80vw, 400px) !important;
    height: unset !important;
    max-height: unset !important;
    min-height: unset !important;
    overflow: visible !important;
}

.modal-publication-preview .mud-dialog-content {
    overflow-y: auto !important;
    height: unset !important;
    max-height: unset !important;
}

.modal-publication-preview .article-modal-reel-preview {
    width: 100% !important;
    aspect-ratio: 4 / 5;
}

.modal-publication-preview .reel-image-wrapper,
.modal-publication-preview .reel-square-media {
    width: 100% !important;
    max-width: 100% !important;
}

@media (max-width: 959px) {
    .modal-publication-preview.GD-modal.mud-dialog {
        width: min(90vw, 360px) !important;
        max-width: min(90vw, 360px) !important;
    }
}


.mud-container-style-bento {
    box-shadow: 0 2px 8px var(--mud-palette-medium-gray-10O) !important;
}

/* MobilePost */
.mobile-post-component {
    background: none;
    width: 100%;
}

.mobile-post-channel-row {
    margin-bottom: 0.5rem;
}

.mobile-post-channel-avatar-wrapper {
    display: inline-block;
    position: relative;
}

.mobile-post-author-avatar {
    position: absolute !important;
    bottom: -0.3rem;
    right: -0.3rem;
    width: 1rem !important;
    height: 1rem !important;
    min-width: 1rem !important;
    min-height: 1rem !important;
    border-radius: 50% !important;
    object-fit: cover;
    font-size: 0.4rem !important;
}

.mobile-post-channel-avatar {
    width: 1.25rem !important;
    height: 1.25rem !important;
    min-width: 1.25rem !important;
    min-height: 1.25rem !important;
    border-radius: 3px !important;
    object-fit: cover;
    font-size: 0.5rem !important;
}

.mobile-post-channel-name {
    font-size: 11px !important;
}

.mobile-post-author-name {
    font-size: 9px !important;
}

.mobile-post-date {
    font-size: 10px !important;
    white-space: nowrap;
}

.mobile-post-title {
    font-size: 10px !important;
}

.mobile-post-preview {
    font-size: 10px !important;
}

.mobile-post-stats {
    margin-top: 0.5rem;
}

.mobile-post-stat-text {
    font-size: 11px !important;
}

.mobile-post-stat-icon.mud-icon-root {
    width: 11px !important;
    height: 11px !important;
    font-size: 11px !important;
}

.mobile-post-divider {
    margin-top: 0.25rem !important;
}

.mobile-post-divider.mud-divider-fullwidth {
    flex-grow: 1;
    width: 110%;
}

a.drafts-link.mud-link {
    color: var(--darkerBlue) !important;
}

.drafts-link:hover {
    font-weight: bold;
    transition: font-weight 0.2s ease;
}

@media (max-width: 959.98px) {
    .drafts-link {
        font-size: 10px !important;
    }

    .tags-row {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
}

.community-mobile-tags .tag .mud-typography {
    font-size: 10px !important;
}

.community-mobile-tags .tag-icon.mud-icon-root {
    width: 0.75rem !important;
    height: 0.75rem !important;
    font-size: 0.75rem !important;
}
