@import "/UI/Theme.scss";

SaveMenu
{
    width: 100%;
    height: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding: 120px 32px calc( $deadzone-y + 96px + 8px );
}

.save-layout
{
    width: 640px;
    max-width: 100%;
    flex-direction: column;
}

.save-tabs
{
    margin-bottom: 8px;
    padding: 3px;
    gap: 2px;
    align-self: flex-start;
    background-color: rgba( 6, 16, 24, 0.82 );
    backdrop-filter: blur( 8px );
    border: 1px solid rgba( white, 0.06 );
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba( black, 0.25 );
    flex-shrink: 0;
    font-family: $subtitle-font;
    font-size: 14px;
    font-weight: 650;

    .save-tab
    {
        padding: 0.45rem 0.8rem;
        gap: 0.4rem;
        align-items: center;
        color: $menu-text-strong;
        background-color: rgba( $menu-accent, 0.2 );
        border: 1px solid rgba( $menu-accent, 0.5 );
        border-radius: 5px;
        box-shadow: 0 0 10px rgba( $menu-accent, 0.16 );

        .save-tab-icon
        {
            width: 20px;
            height: 20px;
            flex-shrink: 0;
            align-items: center;
            justify-content: center;
            color: $menu-accent;

            .iconpanel
            {
                width: 20px;
                height: 20px;
                align-items: center;
                justify-content: center;
                font-size: 20px;
                line-height: 20px;
                text-align: center;
            }
        }
    }
}

.save-window
{
    width: 100%;
    max-height: 470px;
    flex-direction: column;
    overflow: hidden;
    background-color: rgba( 8, 21, 31, 0.94 );
    backdrop-filter: blur( 12px );
    border: 1px solid rgba( white, 0.06 );
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba( black, 0.5 );

    .save-list
    {
        flex-direction: column;
        flex-grow: 1;
        min-height: 0;
        overflow-y: scroll;
        gap: 7px;
        padding: 12px;
    }

    .empty-state
    {
        min-height: 170px;
        flex-grow: 1;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 10px;
        text-align: center;
        color: rgba( white, 0.42 );
        font-size: 13px;

        .iconpanel
        {
            color: $menu-accent;
            font-size: 34px;
            opacity: 0.55;
        }
    }

    .footer
    {
        flex-direction: row;
        gap: 8px;
        padding: 12px;
        flex-shrink: 0;
        background-color: rgba( black, 0.18 );
        border-top: 1px solid rgba( white, 0.07 );

        TextEntry
        {
            flex-grow: 1;
            min-width: 0;
            padding: 9px 12px;
            background-color: rgba( white, 0.05 );
            border-radius: 7px;
            font-size: 14px;
            border: 1px solid rgba( white, 0.08 );

            &:focus
            {
                border-color: $color-accent;
                background-color: rgba( white, 0.08 );
                box-shadow: 0 0 12px rgba( $menu-accent, 0.14 );
            }
        }

        button
        {
            padding: 9px 16px;
            align-items: center;
            justify-content: center;
            gap: 7px;
            background-color: rgba( $menu-accent, 0.22 );
            border: 1px solid rgba( $menu-accent, 0.75 );
            border-radius: 7px;
            color: white;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            flex-shrink: 0;
            transition: background-color 0.1s ease, box-shadow 0.1s ease, transform 0.1s ease;

            .save-button-icon
            {
                width: 18px;
                height: 18px;
                align-items: center;
                justify-content: center;
                font-size: 18px;
            }

            &:hover
            {
                background-color: rgba( $color-accent, 0.38 );
                box-shadow: 0 0 14px rgba( $menu-accent, 0.2 );
                transform: translateY( -1px );
                sound-in: ui.hover;
            }

            &:active
            {
                background-color: $menu-accent;
                transform: translateY( 0 );
            }
        }
    }
}

.save-card
{
    flex-direction: row;
    align-items: center;
    min-height: 76px;
    background-color: rgba( white, 0.035 );
    border: 1px solid rgba( white, 0.055 );
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.1s ease, border-color 0.1s ease, box-shadow 0.1s ease, transform 0.1s ease;

    &:hover
    {
        background-color: rgba( $menu-accent, 0.1 );
        border-color: rgba( $menu-accent, 0.35 );
        box-shadow: 0 5px 16px rgba( black, 0.24 );
        transform: translateY( -1px );
        sound-in: ui.hover;

        .save-name { color: white; }
    }

    &:active
    {
        background-color: rgba( $menu-accent, 0.16 );
        transform: translateY( 0 );
    }

    &.outdated
    {
        opacity: 0.62;
        cursor: default;

        &:hover
        {
            background-color: rgba( white, 0.035 );
            border-color: rgba( white, 0.055 );
            box-shadow: none;
            transform: none;
            sound-in: none;

            .save-name { color: rgba( white, 0.8 ); }
        }
    }

    .save-outdated-badge
    {
        font-size: 10px;
        font-weight: 700;
        color: #ffbd66;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        padding: 2px 6px;
        border-radius: 4px;
        background-color: rgba( orange, 0.1 );
    }

    .save-preview
    {
        width: 128px;
        height: 72px;
        flex-shrink: 0;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        background-size: cover;
        background-position: center;
        background-color: rgba( white, 0.045 );
        border-right: 1px solid rgba( white, 0.055 );
    }

    .save-thumb
    {
        width: 100%;
        height: 100%;
    }

    .save-preview-placeholder
    {
        font-size: 27px;
        color: rgba( white, 0.16 );
    }

    .save-info
    {
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        flex-grow: 1;
        min-width: 0;
        padding: 10px 14px;
    }

    .save-name
    {
        font-size: 14px;
        color: rgba( white, 0.88 );
        font-weight: 650;
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
    }

    .save-meta
    {
        align-items: center;
        gap: 8px;
    }

    .save-timestamp
    {
        font-size: 11px;
        color: rgba( white, 0.4 );
        font-weight: 400;
    }

    .save-dots
    {
        width: 42px;
        align-self: stretch;
        flex-shrink: 0;
        align-items: center;
        justify-content: center;
        color: rgba( white, 0.28 );
        border-left: 1px solid rgba( white, 0.04 );

        .iconpanel
        {
            width: 22px;
            height: 22px;
            align-items: center;
            justify-content: center;
            font-size: 22px;
            line-height: 22px;
            text-align: center;
            transform: translateY( 2px );
        }
    }

    &:hover .save-dots
    {
        color: rgba( white, 0.6 );
    }
}
