/**
 * Demo banner styles.
 * @author Kaido Mägi
 * @copyright 2026
 */

body.mekry-app .mekry-demo-banner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 0.75rem;
    flex-wrap: nowrap;
    height: 40px;
    padding-inline: 1rem;
}

body.mekry-app .mekry-demo-banner .mekry-trial-banner-text {
    grid-column: 1;
    min-width: 0;
    text-align: left;
    font-size: 0.8125rem;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.mekry-app .mekry-demo-banner-actions {
    grid-column: 2;
    display: inline-flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.5rem;
    width: auto;
    max-width: none;
}

body.mekry-app .mekry-demo-banner-actions .mekry-demo-create-btn,
body.mekry-app .mekry-demo-banner-actions .mekry-demo-delete-form {
    display: inline-flex;
    flex: 0 0 auto;
    width: auto;
    margin: 0;
}

body.mekry-app .mekry-demo-banner-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-height: 1.75rem;
    padding: 0.2rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: var(--radius-xs, 6px);
    background: transparent;
    color: #fff;
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

body.mekry-app .mekry-demo-banner-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: #fff;
    color: #fff;
}

body.mekry-app .mekry-demo-delete-btn {
    border-color: rgba(254, 202, 202, 0.85);
    color: #fff7ed;
}

body.mekry-app .mekry-demo-delete-btn:hover {
    background: rgba(248, 113, 113, 0.22);
    border-color: #fecaca;
    color: #fff;
}

@media (max-width: 768px) {
    body.mekry-app .mekry-demo-banner {
        height: 40px;
        min-height: 40px;
        max-height: 40px;
        grid-template-columns: minmax(0, 1fr) auto;
        column-gap: 0.5rem;
        padding-block: 0;
        padding-inline: max(0.75rem, env(safe-area-inset-left, 0px)) max(0.75rem, env(safe-area-inset-right, 0px));
        overflow: hidden;
    }

    body.mekry-app .mekry-demo-banner .mekry-trial-banner-text {
        grid-column: 1;
        white-space: nowrap;
        text-align: left;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    body.mekry-app .mekry-demo-banner-actions {
        grid-column: 2;
        justify-content: flex-end;
        gap: 0.35rem;
    }

    body.mekry-app .mekry-demo-banner-actions .mekry-demo-create-btn,
    body.mekry-app .mekry-demo-banner-actions .mekry-demo-delete-form {
        display: none;
    }

    /* Project site (mobile): hide tour; show create account or delete demo only */
    body.mekry-app.page-project-site .mekry-demo-start-tour-btn {
        display: none !important;
    }

    body.mekry-app.page-project-site .mekry-demo-banner-actions .mekry-demo-create-btn,
    body.mekry-app.page-project-site .mekry-demo-banner-actions .mekry-demo-delete-form {
        display: inline-flex !important;
    }

    body.mekry-app.page-project-site .mekry-demo-banner-actions:has(.mekry-demo-create-btn) .mekry-demo-delete-form {
        display: none !important;
    }

    body.mekry-app .mekry-demo-banner-btn {
        min-height: 1.6rem;
        padding: 0.15rem 0.55rem;
        font-size: 0.75rem;
    }
}

body.mekry-auth-page .login-hero-demo-form {
    margin: 0;
}

body.mekry-auth-page .login-hero-demo-btn.mekry-demo-start-btn--loading {
    opacity: 0.85;
    cursor: wait;
    pointer-events: none;
}

body.home-page .home-demo-start-form {
    display: inline-block;
    margin: 0;
}

body.home-page .home-demo-start-btn {
    border: none;
    cursor: pointer;
    font: inherit;
}

body.home-page .mekry-demo-start-btn--loading,
body.mekry-auth-page .mekry-demo-start-btn--loading {
    opacity: 0.85;
    cursor: wait;
    pointer-events: none;
}
