/* Removed @import rules. Ensure authentication.css and file-browser.css are linked in the HTML where needed. */

@keyframes dialog-open-anim {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes dialog-close-anim {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

dialog {
    display: none;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-start;
    position: absolute;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    border: none;
    outline: none;
    background: none;
    margin: 0;
    padding: 0;
    color: #ffffff;
    transition: display .2s allow-discrete, overlay .2s allow-discrete;
    animation: dialog-close-anim .2s forwards;
    overflow: hidden;
    pointer-events: none;
}

dialog[open] {
    animation: dialog-open-anim .2s forwards;
    pointer-events: all;
    display: flex;
}

@starting-style {
    dialog[open] {
        opacity: 0;
        transform: scaleY(0);
    }
}

dialog::backdrop {
    background: rgba(0, 0, 0, .5);
    backdrop-filter: blur(1rem);
    transition: opacity .2s;
    opacity: 0;
}

dialog[open]::backdrop {
    opacity: 1;
}

dialog.require-auth-dialog span {
    color: var(--primary-color);
    font-size: 1.5rem;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-shadow: 0 .5rem 1.5rem rgba(var(--primary-rgb), calc(var(--glow-intensity) / 2));
}

dialog form.community-post-create, dialog form.community-create {
    width: calc(100% - 2rem);
    max-width: 40rem;
}

dialog form.community-post-create textarea, dialog form.community-create textarea {
    flex: 0 0 6rem;
}

dialog form {
    overflow: hidden;
    margin: auto;
    /* max-width: calc(100% - 2rem); */
    max-height: calc(100% - 2rem);
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-start;
    padding: 1rem;
    gap: 1rem;
    max-width: 30rem;
    border: 1px solid rgba(var(--primary-rgb), .5);
    background: rgba(0, 0, 0, .75);
    border-radius: .25rem;
    backdrop-filter: blur(1rem);
    box-shadow: 0px .25rem 1rem 0 rgb(0 0 0 / 50%), inset 0 0 2rem 0 rgba(var(--primary-rgb), calc(var(--glow-intensity) / 3));
}

dialog form label {
    margin-bottom: .5rem;
}

dialog form span a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
}

dialog form.full-size {
    width: 60rem;
    height: 100%;
    max-width: calc(100% - 2rem); 
}

dialog form div.divider {
    flex: 0 0 1px;
    background-color: rgba(var(--primary-rgb), .25);
}

dialog form .media-add, dialog form .added-media {
    flex: 0 0 8rem;
    /* width: 100%; */
    width: 8rem;
    height: 8rem;
    align-self: center;
    background: rgba(0, 0, 0, 0);
    cursor: pointer;
    border: 1px solid rgba(var(--primary-rgb), .5);
    border-radius: .25rem;
    overflow: hidden;
}

/* dialog form.full-size .media-add, dialog form.full-size .added-media {
    width: 8rem;
} */

dialog form .media-add *, dialog form .added-media * {
    pointer-events: none;
}

dialog form .showcase-media {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: .5rem;
    padding: .5rem;
}
dialog form .post-media {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: .5rem;
    padding: .5rem;
}

dialog form .group-add svg, dialog form .media-add svg {
    width: 100%;
    height: 100%;
    padding: 1rem;
    fill: rgba(var(--primary-rgb), .5);
}
dialog form .added-media img, dialog form .added-media video {
    width: 100%;
    height: 100%;
    outline: none;
    object-fit: contain;
    padding: 0;
    margin: 0;
}

dialog form > span {
    flex: 0 0 auto;
    color: var(--primary-color);
}

dialog form fieldset.auto-scroll {
    overflow: auto;
    flex: 1 1 auto;
}

/* --- Base Dialog Button Style --- */
.dialog-button-primary {
    background: rgba(0, 0, 0, 0);
    outline: none;
    cursor: pointer;
    font-weight: 800;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: .25rem;
    text-shadow: 0 .5rem 1.5rem rgba(var(--primary-rgb), calc(var(--glow-intensity) / 5));
    box-shadow: 0 .5rem 1.5rem rgba(var(--primary-rgb), calc(var(--glow-intensity) / 5));
    padding: .25rem .75rem;
    text-transform: uppercase;
    font-size: 1rem;
}
/* --- End Base Dialog Button Style --- */


dialog form fieldset button {
    /* Apply base style */
    composes: dialog-button-primary; /* Note: 'composes' is illustrative; actual implementation uses shared class or duplication */
    background: rgba(0, 0, 0, 0);
    outline: none;
    cursor: pointer;
    font-weight: 800;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: .25rem;
    text-shadow: 0 .5rem 1.5rem rgba(var(--primary-rgb), calc(var(--glow-intensity) / 5));
    box-shadow: 0 .5rem 1.5rem rgba(var(--primary-rgb), calc(var(--glow-intensity) / 5));
    padding: .25rem .75rem;
    text-transform: uppercase;
    font-size: 1rem;
    /* Specific style */
    align-self: center;
}

dialog form fieldset input {
    width: 100%;
}

dialog form .buttons {
    flex: 0 0 auto;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    align-self: stretch;
    gap: 1rem;
}

dialog form .buttons button.cancel {
    border: none;
    background: rgba(0, 0, 0, 0);
    outline: none;
    cursor: pointer;
    font-weight: 400;
    color: var(--secondary-color);
    text-transform: uppercase;
    text-shadow: 0 .5rem 1.5rem rgba(var(--secondary-rgb), calc(var(--glow-intensity) / 5));
}
dialog form .buttons button.ok {
     /* Apply base style */
    composes: dialog-button-primary; /* Note: 'composes' is illustrative; actual implementation uses shared class or duplication */
    background: rgba(0, 0, 0, 0);
    outline: none;
    cursor: pointer;
    font-weight: 800;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: .25rem;
    text-shadow: 0 .5rem 1.5rem rgba(var(--primary-rgb), calc(var(--glow-intensity) / 5));
    box-shadow: 0 .5rem 1.5rem rgba(var(--primary-rgb), calc(var(--glow-intensity) / 5));
    padding: .25rem .75rem;
    text-transform: uppercase;
    font-size: 1rem;
    /* No specific overrides needed */
}

a-toaster, a-toaster:popover-open {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    gap: .5rem;
    background: none;
    pointer-events: none;
}

a-toaster::backdrop {
    display: none;
}

a-toaster a-toast {
    flex: 0 0 auto;
    border: 1px solid rgba(var(--primary-rgb), .5);
    background: rgba(0, 0, 0, .75);
    border-radius: .25rem;
    backdrop-filter: blur(1rem);
    box-shadow: inset 0 0 2rem 0 rgba(var(--primary-rgb), calc(var(--glow-intensity) / 3)), 0 2rem 2rem rgba(0, 0, 0, .75), 0 1rem 1rem rgba(0, 0, 0, .5);
    color: var(--input-color);
    padding: .75rem;
    transition: all .2s;
    transform-origin: center;
    transform: scale(0);
    /* height: 0; */
    opacity: 0;
    cursor: pointer;
    pointer-events: all;
}

a-toaster a-toast.visible {
    transform: scale(1);
    opacity: 1;
    /* height: calc(2.5rem + 2px); */
}

a-toaster a-toast * {
    pointer-events: none;
}

form.remix-strength {
    width: 20rem;
}

/*********** MEDIA QUERIES START HERE ***********/
@media only screen and (max-width: 720px) {
    dialog form {
        max-width: calc(100% - 1rem);
        max-height: calc(100% - 1rem);
        padding: .5rem;
        gap: .5rem;
    }
    dialog form.full-size {
        max-width: calc(100% - 1rem);
    }
    dialog form span {
        /* padding-bottom: .5rem; */
    }
    dialog form fieldset:first-of-type {
        padding-top: .5rem;
    }
    /* dialog form label {
        margin-bottom: .25rem;
    }
    dialog form input, dialog form textarea {
        margin-bottom: .5rem;
    } */

    dialog form .buttons {
        padding-top: .5rem;
    }
}
/*********** MEDIA QUERIES END HERE ***********/
