/* Effects/Core handles Flashcord Chat Effects' Code */

[class^="messageListItem_"]:nth-last-child(-n + 9 ):has([href^="http://flashcord/"], [class="replugged-greentext"]) { container-name: var(--Flashcord-Module_Effects, FCM-Effects_Animated); container-type: inline-size; }
[class^="messageListItem_"]:nth-last-child(-n + 9 ):has([href^="http://flashcord/"]):has([class*="isSending_"]) { container-name: var(--Flashcord-Module_Effects, unset) !important; }
@container FCM-Effects_Animated (min-width: 0) {
    [href="http://flashcord/small"],
    [href="http://flashcord/wide"],
    [href="http://flashcord/shake"],
    [href="http://flashcord/dramatic"],
    [href="http://flashcord/fade-bottom"],
    [href="http://flashcord/system/level-up"],
    [href="http://flashcord/4chan"] { display: none; }

    [class^="message_"]:has([href="http://flashcord/shake"]) { animation: SNDL-Shake 100ms linear infinite; --Amplitude-X: 12; --Amplitude-Y: 8; --Amplitude-R: 0.1;}
    [class^="message_"]:has([href="http://flashcord/fade-bottom"]) { animation: SNDL-Translate_Custom 2s; --Initial: 0 10vh; }
    [class^="message_"]:has([href="http://flashcord/wide"]) {
        width: 50%; scale: 1.5 1;
        transform-origin: left center;
        animation: FCME-Wide 1s;
    }
    [class^="message_"]:has([href="http://flashcord/small"]) {
        animation: FCME-Small 1s;
        scale: 0.8; transform-origin: left center;
    }
    [class^="message_"]:has([href="http://flashcord/dramatic"]) {
        animation: FCME-Dramatic 8s ease-out;
        transform-origin: left center;
    }
    
    [class^="message_"]:has([href="http://flashcord/system/level-up"]) {
        position: absolute; top: 2rem; right: 2rem;
        width: 100%; opacity: 0; margin: 0; padding: 0;
        background: none !important; justify-content: flex-end;
        animation: FCME-LevelUp 8s ease-in-out;
        container-name: FCM-Effects_Level; container-type: inline-size;
    } [class^="message_"]:has([href="http://flashcord/system/level-up"])::before { display: none;}
    @container FCM-Effects_Level (min-width: 0) {
        [id^="message-content-"] {
            position: absolute; right: 0;
            font-size: 90%; width: fit-content; padding: 0; 
        } h3, [class^="avatar_"] { display: none !important;}
    }

    /* Green Text */
    [class^="message_"]:has([href="http://flashcord/4chan"], [class="replugged-greentext"]) {
        display: flex !important;
        background: var(--Flashcord-4Chan-Background) !important;
        container-name: FCM-Effects_4Chan !important;
        container-type: inline-size !important;
    }
    @container FCM-Effects_4Chan (min-width: 0) { /* This is entirely fucked with replies, needs fixing */
        [class^="contents_"] { margin-left: 16px !important; order: 1; }

        [class^="contents_"] [id^="message-content-"] { margin-top: 1.2rem; }
        [class^="username_"] { color: #117743 !important; }
        span { color: #d00; }
        [class^="timestamp_"] { color: #800 !important; }
        .replugged-greentext > span { color: #789922 !important; }

        [class^="avatar_"], /* WTF Does this do? // Brother can't read - Sirius 03/12/23 */
        [class^="replyAvatar_"],
        [class^="avatarDecoration_"],
        span[role="button"]:has(svg) {  display: none; }
        [id^="message-reply-context-"]::before { display: none !important; }
        [class^="contents_"] [class^="header-"] { margin-bottom: 1rem; }
        [class^="mediaAttachmentsContainer"] { width: 100% !important;}

        [id^="message-reply-context-"] {
            display: -webkit-box !important; top: 1.3rem; font-size: 1rem;
            container-name: FCM-Effects_4Chan-L1 !important; container-type: inline-size !important;
        }
        @container FCM-Effects_4Chan-L1 (min-width: 0) {
            img, svg, span:has(.stafftag) { display: none; }
            [class^="username_"]::before { content: ">>"; color: #d00 !important; margin-left: 1rem; }
            [class^="username_"] { color: #d00 !important; margin-top: 10px; }
            [class^="repliedTextPreview_"] { margin-top: 0px; opacity: 0.5; }
        }
    }
}

@container FCM-Effects_Text (min-width: 0) {
    [href="http://flashcord/small"],
    [href="http://flashcord/wide"],
    [href="http://flashcord/shake"],
    [href="http://flashcord/dramatic"],
    [href="http://flashcord/fade-bottom"], 
    [href="http://flashcord/4chan"]{ display: none; }
    [id^="message-content-"]:has([href^="http://flashcord/"])::after {
        white-space: pre;
        color: var(--Flashcord-Text);
        font-size: small;
    }
    [id^="message-content-"]:has([href="http://flashcord/small"])::after { content: var(--FCL-Effect_Small); }
    [id^="message-content-"]:has([href="http://flashcord/wide"])::after { content: var(--FCL-Effect_Wide); }
    [id^="message-content-"]:has([href="http://flashcord/shake"])::after { content: var(--FCL-Effect_Shaking); }
    [id^="message-content-"]:has([href="http://flashcord/dramatic"])::after { content: var(--FCL-Effect_Dramatic); }
    [id^="message-content-"]:has([href="http://flashcord/fade-bottom"])::after { content: var(--FCL-Effect_Fade-Bottom); }
    [id^="message-content-"]:has([href="http://flashcord/4chan"])::after { content: var(--FCL-Effect_4Chan); }
}