﻿:root {
    color-scheme: light;
    --ink: #172033;
    --muted: #667085;
    --line: #d7dde8;
    --surface: #fbf8ff;
    --accent-a: #7c3aed;
    --accent-b: #a855f7;
    --accent-c: #d946ef;
    --purple: #7c3aed;
    --purple-soft: #f1e8ff;
    --purple-deep: #5b21b6;
    --panel: #ffffff;
}

/*
:root {
    color-scheme: light;
    --ink: #172033;
    --muted: #6b7280;
    --line: #d7dde8;
    --surface: #f7f9fc;
    --accent-a: #2563eb;
    --accent-b: #0f9f8f;
    --accent-c: #7c3aed;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at 25% 20%, rgba(37, 99, 235, 0.13), transparent 28%), radial-gradient(circle at 76% 72%, rgba(15, 159, 143, 0.11), transparent 30%), var(--surface);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}*/

.demo {
    display: grid;
    gap: 18px;
    justify-items: start;
    padding: 32px;
}

.caption {
    max-width: 320px;
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

.ai-button {
    font-size: 12px;
    font-weight: 500;
    position: relative;
    isolation: isolate;
    display: inline-grid;
    grid-template-columns: 22px auto;
    align-items: center;
    gap: 2px;
    /* min-height: 35px;
    padding: 0 8px 0 6px;*/
    /* border: 3px solid rgba(124, 58, 237, 0.24);*/
    border: 3px solid rgba(124, 58, 237, 0.24);
    border-radius: 6px;
    overflow: hidden;
    background: linear-gradient(#ffffff, #ffffff) padding-box, linear-gradient(115deg, var(--accent-a), var(--accent-b), var(--accent-c)) border-box;
    color: #101827;
    /* box-shadow: 0 10px 24px rgba(23, 32, 51, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.85);*/
    cursor: pointer;
    letter-spacing: 0;
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.ai-action {
    padding: 0;
    max-height: 26px;
    box-shadow: 2px 4px 4px #d946ef;
    border-radius:5px;
}

.ai-translate > .ai-button > .spark-icon {
    fill: purple;
}

.ai-button > select {
    border: none;
    color: #101827;
    background: linear-gradient(#ffffff, #ffffff) padding-box, linear-gradient(115deg, var(--accent-a), var(--accent-b), var(--accent-c)) border-box;
    font: 700 14px / 1 Inter, ui-sans-serif, system-ui, sans-serif;
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.ai-button > select,
::picker(select) {
    appearance: base-select;
}

    .ai-button > select :hover {
        background: #f4ecff;
    }

        .ai-button > select :hover::before {
            transform: translateX(24%);
        }

    .ai-button > select option:hover,
    option:focus {
        background: #f4ecff;
    }

    .ai-button > select:focus {
        outline: none;
    }

.ai-button::before {
    content: "";
    position: absolute;
    inset: -40% -35%;
    z-index: -1;
    background: linear-gradient( 105deg, transparent 35%, rgba(124, 58, 237, 0.13) 44%, rgba(217, 70, 239, 0.17) 50%, transparent 62% );
    transform: translateX(-38%);
    transition: transform 420ms ease;
}

.ai-button:hover {
    /* transform: translateY(-1px);*/
    border-color: rgba(124, 58, 237, 0.4);
    /*box-shadow: 0 14px 30px rgba(88, 28, 135, 0.17), inset 0 1px 0 rgba(255, 255, 255, 0.94);*/
}

    .ai-button:hover::before {
        transform: translateX(24%);
    }

.ai-button:active {
    transform: translateY(0);
    box-shadow: 0 6px 16px rgba(23, 32, 51, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.ai-button:focus-visible {
    outline: 3px solid rgba(124, 58, 237, 0.22);
    outline-offset: 3px;
}

.spark-icon,
.arrow-icon {
    width: 100%;
    height: 100%;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.spark-icon {
    /* fill: purple;*/
    color: purple; /*var(--accent-a);*/
    filter: drop-shadow(0 2px 8px rgba(37, 99, 235, 0.25));
}

.button-text {
    white-space: nowrap;
}

.arrow-icon {
    color: #516078;
    transition: transform 160ms ease;
}

.ai-button:hover .arrow-icon {
    transform: translateX(2px);
}

.ai-button[data-state="loading"] {
    grid-template-columns: 18px auto;
    pointer-events: none;
    color: #344054;
}

    .ai-button[data-state="loading"] .spark-icon {
        animation: spin 900ms linear infinite;
    }

    .ai-button[data-state="loading"] .arrow-icon {
        display: none;
    }

@keyframes spin {
    to {
        rotate: 360deg;
    }
}

.page-loader {
    position: fixed;
    inset: 0;
    z-index: 1400;
    display: grid;
    place-items: center;
    background: rgb(251 248 255 / 0%);
    backdrop-filter: blur(8px);
}

}

.page-loader[hidden] {
    display: none;
}

.page-loader-card {
    display: grid;
    justify-items: center;
    gap: 14px;
    min-width: 240px;
    padding: 24px;
    border: 1px solid rgba(124, 58, 237, 0.18);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 22px 60px rgba(88, 28, 135, 0.2);
}

.page-loader-sparkle {
    position: relative;
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    color: var(--accent-a);
    filter: drop-shadow(0 12px 24px rgba(124, 58, 237, 0.28));
    animation: sparkle-pulse 980ms ease-in-out infinite;
}

    .page-loader-sparkle::before,
    .page-loader-sparkle::after {
        content: "";
        position: absolute;
        width: 9px;
        height: 9px;
        border-radius: 999px;
        background: var(--accent-c);
        opacity: 0.75;
        animation: sparkle-dot 980ms ease-in-out infinite;
    }

    .page-loader-sparkle::before {
        top: 3px;
        right: 6px;
    }

    .page-loader-sparkle::after {
        bottom: 5px;
        left: 8px;
        width: 7px;
        height: 7px;
        animation-delay: 160ms;
    }

.sparkle-icon {
    width: 52px;
    height: 52px;
    display: block;
    fill: rgba(241, 232, 255, 0.88);
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
    animation: sparkle-turn 1.8s ease-in-out infinite;
}

.page-loader-title {
    margin: 0;
    color: var(--ink);
    font-size: 15px;
    font-weight: 800;
}

.page-loader-text {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 650;
}

@keyframes sparkle-turn {
    to {
        transform: rotate(360deg);
    }
}

@keyframes sparkle-pulse {
    0%, 100% {
        transform: scale(0.94);
    }

    50% {
        transform: scale(1.06);
    }
}

@keyframes sparkle-dot {
    0%, 100% {
        opacity: 0.35;
        transform: scale(0.7);
    }

    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

@media (prefers-reduced-motion: reduce) {
    .ai-translate-button,
    .ai-translate-button::before,
    .chevron-icon,
    .ai-loader,
    .page-loader-orbit::after {
        animation: none;
        transition: none;
    }
}


/************************************/

.ai-language-menu {
    position: absolute;
    /*top: calc(100% + 8px);
    right: 0;*/
    z-index: 500;
    width: min(230px, calc(100vw - 32px));
    max-height: min(360px, calc(100vh - 120px));
    overflow: auto;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 18px 44px rgba(88, 28, 135, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
}

    .ai-language-menu[hidden] {
        display: none;
    }

.ai-language-option {
    display: grid;
    grid-template-columns: auto 20px;
    gap: 10px;
    align-items: center;
    width: 100%;
    min-height: 46px;
    padding: 0 10px;
    border: 0;
    /* border-radius: 6px; */
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    font: 650 14px/1 Inter, ui-sans-serif, system-ui, sans-serif;
    text-align: left;
    /* border-bottom: solid; */
    border-collapse: collapse;
    border: 1px solid var(--accent-c);
}

button.ai-language-option.selected::after {
    content: '✓';
    font-weight: 900;
    color: #007bff;
    font-size: 24px;
}

button.ai-language-option.default {
    /*grid-template-columns: 15px auto 20px;*/
    background: var(--purple-soft);
}

/*button.ai-language-option.default::before {
    content: '⌂';
    font-weight: 900;
    color: #007bff;
    font-size: 24px;
}*/


.ai-language-option:hover {
    background: #f4ecff;
}

.language-mark {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 7px;
    background: #f1e8ff;
    color: #6d28d9;
    font: 800 12px/1 Inter, ui-sans-serif, system-ui, sans-serif;
}

.language-copy {
    display: grid;
    gap: 3px;
}

.language-name {
    color: var(--ink);
}

.language-hint {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.ai-translate-button:focus-visible,
.ai-language-option:focus-visible {
    outline: 3px solid rgba(124, 58, 237, 0.22);
    outline-offset: 3px;
}


.ai-translate > .ai-button {
    grid-template-columns: 22px auto 18px;
}

/********************************/

.summary-modal-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 500;
    width: 100%;
    height: 100%;
    display: none;
}

.summary-modal-bg {
    backdrop-filter: blur(1px);
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url(your-image.jpg);
    background-size: cover;
    filter: blur(8px);
    z-index: -1;
}

.summary-modal {
    position: fixed;
    width: min(720px, calc(100vw - 32px));
    max-height: min(760px, calc(100vh - 32px));
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
    border: 1px solid rgba(124, 58, 237, 0.18);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.36);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.summary-header {
    height: auto;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    align-items: start;
    padding: 22px 24px 16px;
    border-bottom: 1px solid var(--line);
    background: radial-gradient(circle at 10% 10%, rgba(124, 58, 237, 0.12), transparent 30%), #ffffff;
}

.title-block {
    display: grid;
    gap: 10px;
}

.summary-badge {
    width: fit-content;
    display: inline-grid;
    grid-template-columns: 15px auto;
    align-items: center;
    gap: 6px;
    padding: 6px 9px;
    border: 3px solid rgba(124, 58, 237, 0.24); /*1px solid rgba(124, 58, 237, 0.18);*/
    border-radius: 999px;
    background: var(--purple-soft);
    color: var(--purple-deep);
    font-size: 12px;
   /* font-weight: 1000;*/
}

.summary-badge-body-disclaimer {
    width: fit-content;
    display: none;
    grid-template-columns: 15px auto;
    align-items: center;
    gap: 6px;
    padding: 0 9px;
    border-radius: 7px;
    color: #9f03fc;
    font-size: 12px;
    position: fixed;
    top: 526px;
    transform: rotate(270deg);
    left: 445px;
    font-weight: 700;
}

.summary-badge-popup-disclaimer {
    width: 100%;
    grid-template-columns: 15px auto;
    align-items: center;
    gap: 6px;
    color: #9f03fc;
    font-size: 12px;
    position: fixed;
    font-weight: 700;
    background: #fff;
    bottom: 0px;
    justify-content: center;
    box-shadow: 0px -10px 20px 0px #fff;
}

#row_view > .sum_dis_arview {
    top: 481px;
    left: -75px;
}

.summary-title {
    margin: 0;
    color: var(--ink);
    font-size: clamp(22px, 3vw, 30px);
    line-height: 1.18;
    letter-spacing: 0;
    font-weight: 700;
}

.summary-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 650;
}

.meta-chip {
    padding: 5px 8px;
    border: 1px solid #ece7f6;
    border-radius: 999px;
    background: #fcfaff;
}

.close-button-summary {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid #e8e2f1;
    border-radius: 8px;
    background: #ffffff;
    color: #475467;
    cursor: pointer;
    transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

    .close-button-summary:hover {
        transform: translateY(-1px);
        border-color: rgba(124, 58, 237, 0.28);
        background: #faf7ff;
    }

    .close-button-summary:focus-visible,
    .footer-button:focus-visible {
        outline: 3px solid rgba(124, 58, 237, 0.22);
        outline-offset: 3px;
    }

.icon {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.summary-content {
    min-height: 0;
    overflow: auto;
    padding: 20px 24px 22px;
    font-size: 14px;
    padding:15px;
}

.summary-lede {
    margin: 0 0 18px;
    padding: 14px 16px;
    border-left: 4px solid var(--purple);
    border-radius: 0 8px 8px 0;
    background: #fbf8ff;
    color: #344054;
    font-size: 15px;
    line-height: 1.65;
}

.summary-list {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.summary-point {
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: 10px;
    align-items: start;
    padding: 12px;
    border: 1px solid #eee8f8;
    border-radius: 8px;
    background: #ffffff;
}

.point-mark {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 7px;
    background: var(--purple-soft);
    color: var(--purple-deep);
    font-size: 12px;
    font-weight: 900;
}

.point-text {
    margin: 0;
    color: #2f3645;
    font-size: 15px;
    line-height: 1.6;
}

.summary-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 24px;
    border-top: 1px solid var(--line);
    background: #fcfaff;
    margin-top: 0px;
}

.ai-note {
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 8px;
    align-items: center;
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

.footer-actions {
    display: flex;
    gap: 8px;
}

.footer-button {
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid #e2d8f4;
    border-radius: 8px;
    background: #ffffff;
    color: var(--purple-deep);
    cursor: pointer;
    font: 750 13px/1 Inter, ui-sans-serif, system-ui, sans-serif;
}

    .footer-button.primary {
        border-color: transparent;
        background: linear-gradient(135deg, var(--purple), #a855f7);
        color: #ffffff;
    }

.translate-icon {
    width: 100%;
    height: 100%;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.translate-icon {
    color: var(--accent-a);
}

.ai-summary > .ai-button > .spark-icon {
    top: 10px;
    left: -14px;
    position: absolute;
    fill: none !important;
    color: var(--accent-a) !important;
    filter: drop-shadow(0 2px 8px rgba(37, 99, 235, 0.25));
}

.ai-translate > .ai-button > .spark-icon {
    top: -2px;
    left: -23px;
    position: absolute;
    fill: none !important;
    color: var(--accent-a) !important;
    filter: drop-shadow(0 2px 8px rgba(37, 99, 235, 0.25));
}

@media (max-width: 620px) {
    body {
        padding: 16px;
    }

    #row_view > .summary-badge-body-disclaimer {
        top: 563px;
        left: -64px;
        background: #fff;
        font-weight: 400;
        font-size: 11px;
    }

    .ai-translate > .ai-button > .spark-icon,
    .ai-translate-mobile > .ai-button > .spark-icon,
    .ai-summary > .ai-button > .spark-icon,
    .ai-summary-summary > .ai-button > .spark-icon {
        top: -3px;
        left: 9px;
        position: absolute;
        fill: none !important;
        color: var(--accent-a) !important;
        filter: drop-shadow(0 2px 8px rgba(37, 99, 235, 0.25));
    }
    .ai-summary > .ai-button > .spark-icon,
    .ai-summary-mobile > .ai-button > .spark-icon {
        top: 11px;
        left: 12px;
    }

    .ai-action,
    .ai-action-mobile {
        border-radius: 6px;
        margin: 0 5px;
        width: 28px;
        height: 28px;
        max-height: 28px !important;
        /*box-shadow: 2px 4px 7px #d946ef !important;*/
        box-shadow: none !important;
    }

    .ai-translate > .ai-button,
    .ai-summary > .ai-button,
    .ai-translate-mobile > .ai-button,
    .ai-summary-mobile > .ai-button {
        grid-template-columns: 22px;
        padding: 0px;
        width: 28px;
        height: 28px;
    }

    .summary-header,
    .summary-content,
    .summary-footer {
        padding-left: 16px;
        padding-right: 16px;
    }

    .summary-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .footer-actions {
        width: 100%;
    }

    .footer-button {
        flex: 1;
    }
}

@media (max-width: 1024px) {
    .ai-action,
    .ai-action-mobile {
        border-radius: 6px;
        margin: 0 5px;
        width: 28px;
        height: 28px;
        max-height: 28px !important;
        /*box-shadow: 2px 4px 7px #d946ef !important;*/
        box-shadow: none !important;
    }

    .ai-translate > .ai-button,
    .ai-summary > .ai-button,
    .ai-translate-mobile > .ai-button,
    .ai-summary-mobile > .ai-button {
        grid-template-columns: 22px;
        padding: 0px;
        width: 28px;
        height: 28px;
    }
}
