@value colors: 'src/common-ui/colors.css';
@value color4, color1, color2, color3, color5, color6, boxShadow from colors;

:root {
    --height: 90px;
    --imgWidth: 200px;
    --resultWidth: 800px;
    --vertical-spacing: 30px;
    --compact-scale: 0.6;
}

.resultBox {
    display: flex;
}

.resultBoxItem {
    width: 100%;
}

/* List entries shown as context around a search result */
.rootContainer.compact {
    opacity: 0.7;
    transform: scale(0.6);
    transform-origin: top;

    /* Compensate margin for scale reduction. */
    margin-bottom: calc((var(--compact-scale) - 1) * var(--height));

    &:hover,
    &:focus {
        opacity: 1;
    }
}

.rootContainer {
    border: 0.75px solid #e1e1e1;
    border-radius: 5px;
    display: flex;
    flex-direction: row;
    position: relative;
    color: inherit;
    text-decoration: none;
    z-index: 0;
    margin-bottom: 5px;
    background-color: white;
    height: fit-content;
    min-height: var(--height);
    width: 100%;
    max-width: 800px;
    box-shadow: rgb(143 143 143 / 0.05) 0px 4px 6px 4px,
        rgba(143, 143, 143, 0.05) 0px 2px 4px;
    transition: background 120ms ease-in 0s;

    &:hover {
        cursor: pointer;
    }

    &:hover .crossRibbon {
        display: block;
        margin-right: -4px;
    }

    &:hover .button {
        opacity: 0.6;
        display: flex;
    }

    &:hover .actionItems {
        display: flex;
    }

    &:hover .secondaryActionButton {
        display: flex;
    }

    & .button {
        display: none;
    }
}

.rootContainerOverview {
    max-width: var(--resultWidth);
    width: 100%;
    height: fit-content;

    & .button {
        display: flex;
    }

    & .displayTime {
        margin-right: 10px;
        font-size: 13px;
    }

    & .url {
        font-size: 14px;
        margin: -7px 0 4px 38px;
    }

    & .title {
        margin-top: -4px;
        letter-spacing: 0.1px;
        font-size: 16px;
        margin-left: 12px;
        overflow-y: hidden;
    }
}

.root {
    position: relative;
    display: flex;
    box-sizing: content-box;
    justify-content: space-between;
    padding: 6px 10px;
    width: 95%;
    height: fit-content;
    text-decoration: none;
    flex-direction: row;
}

.rootOverview {
    padding: 0;
    max-width: var(--resultWidth);
    width: 100%;
}

.crossRibbon {
    display: none;
}

.checkbox {
    position: absolute;
    opacity: 0;

    & + label {
        position: relative;
        cursor: pointer;
        padding: 0;
    }

    & + label::before {
        content: '';
        display: inline-block;
        vertical-align: text-top;
        width: 7px;
        height: 7px;
        outline: 1px solid #3eb995;
        box-shadow: 0 0 0 1.5pt #3eb995;
        border-radius: 1px;
        margin: 4px 0;
        color: honeydew;
    }

    &:focus + label::before {
        box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.12);
    }

    &:checked + label::before {
        background: #3eb995;
    }

    &:checked + label::after {
        content: '✔';
        position: absolute;
        margin-left: -2px;
        margin-top: -10px;
        left: 1px;
        top: 8px;
        color: white;
        width: 2px;
        height: 2px;
    }

    &:disabled + label {
        color: #3eb995;
        cursor: auto;
    }

    &:disabled + label::before {
        box-shadow: none;
        box-shadow: 0 0 0 2pt #3eb995;
        border-radius: 1px;
    }
}

.screenshotContainer {
    flex-shrink: 0;
    width: var(--imgWidth);
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    border-right: solid 1px #ebebeb;
    border-top-left-radius: 5px;
    border-bottom-left-radius: 5px;

    & .screenshot {
        max-width: 100%;
        width: auto;
        height: auto;
    }
}

.listItem {
    width: 98%;
    max-width: 800px;
    position: relative;
}

.tagContainer {
    width: 100%;
    display: flex;
    flex-direction: row;
    margin-top: 5px;
}

.infoContainer {
    display: flex;
    flex-direction: column;
    max-width: 100%;
    justify-content: space-between;
    width: stretch;
    padding: 15px 0px;
}

.removeCollectionItemBox {
    display: flex;
    align-items: flex-start;
    z-index: 1;

    & > div {
        height: fit-content;
    }
}

.infoContainerOverview {
    padding: 15px 13px 15px;
}

.infoContainerScreenshot {
    width: calc(100% - var(--imgWidth));
}

.noScreenshot {
    width: 100%;
}

.firstlineContainer {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    height: 30px;
    width: 100%;
}

.titleContainer {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    min-height: 26px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    align-items: flex-start;
    width: 800px;
}

.title {
    color: #3a2f45;
    flex-direction: row;
    font-size: 14px;
    height: 26px;
    font-weight: 600;
    align-items: flex-start;
    justify-content: flex-start;
    margin-left: 11px;
    white-space: nowrap;
    overflow-x: hidden;
    position: relative;
    text-overflow: ellipsis;
    letter-spacing: 0.1px;
}

.favIconContainer {
    width: 25px !important; /* stylelint-disable-line declaration-no-important */
    height: 25px !important; /* stylelint-disable-line declaration-no-important */
    border: 1px solid #efefef;
    border-radius: 30px;
    flex: none;
}

.favIcon {
    width: 100%;
    border-radius: 50px;
}

.noFavicon {
    width: 25px !important; /* stylelint-disable-line declaration-no-important */
    height: 25px !important; /* stylelint-disable-line declaration-no-important */
}

.url {
    color: #72727f;
    font-size: 12px;
    min-width: 0;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    align-items: center;
    max-width: 100%;
    height: 20px;
    margin: -5px 0px 0px 38px;
}

.url a {
    text-decoration: none;
}

.bottomLine {
    color: #72727f;
    height: 16px;
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    padding-left: 38px;
    margin: 5px 0 0 0;
}

.buttonsContainer {
    display: grid;
    flex-direction: row;
    z-index: 0;
    grid-auto-flow: column;
    grid-gap: 3px;
    padding: 10px;
    margin: -10px -10px 0 0;
}

.detailsContainer {
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    align-items: flex-start;
    height: 20px;
    margin-top: -3px;
}

.displayTime {
    font-size: 11px;
    color: #72727f;
    min-width: fit-content;
}

.button {
    border: none;
    z-index: 2500;
    width: 24px;
    height: 24px;
    padding: 4px;
    cursor: pointer;
    outline: none;
    opacity: 0.2;
    border-radius: 3px;
    justify-content: center;
    align-items: center;
    display: flex;
    background: none;
    align-self: flex-start;

    &:hover {
        opacity: 1;
        background-color: #e0e0e0;
        background-position: center center;
        background-size: contain;
        background-repeat: no-repeat;
    }
}

.secondaryActionButton {
    display: none;
}

.permanentButton {
    border: none;
    z-index: 2500;
    height: 24px;
    width: 24px;
    padding: 4px;
    opacity: 0.6;
    cursor: pointer;
    outline: none;
    border-radius: 3px;
    background: none;

    &:hover {
        opacity: 0.6;
        background-color: #e0e0e0;
        background-position: center center;
        background-size: contain;
        background-repeat: no-repeat;
    }
}

.img {
    height: 100%;
    max-width: 100%;
}

.actionItems {
    display: flex;
    align-items: center;
}

.commentBtn {
    /* only used to ID if button is clicked - multiple buttons so cannot use a real `id` att */
}

.tagList {
    display: flex;
    flex-grow: 2;
}

.isDeleting {
    position: relative;
    opacity: 0.5;
}

.deletingSpinner {
    position: absolute;
    left: 50%;
    z-index: 1;
}

.bookmarkRibbon {
    position: absolute;
    top: 10px;
    left: -15px;
    width: 60px;
    height: 10px;
    transform: rotate(-45deg);
    background: #ff503e;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
}

.dragElement {
    text-decoration: none;
    display: none;
    border: solid 2px color2;
    border-radius: 4px;
    font-size: 0.8rem;
    max-height: 50px;
    max-width: 330px;
    text-align: center;
    font-weight: 500;
    background: #5cd9a6;
    color: #fff;
    opacity: 1;
    padding: 5px 10px;
    position: absolute;
    margin-left: 25px;
}

.duckduckgo {
    padding-top: 9px;
    padding-bottom: 9px;

    & .url {
        margin-top: -16px;
    }

    & .displayTime {
        margin-top: -8px;
    }
}

.annotsCount {
    color: white;
    font-size: 10px;
}

@keyframes onload {
    0% {
        transform: translateY(10px);
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

.tweetRootContainer {
    height: fit-content;
}

.tweetInfoContainer {
    width: 100%;
}

.header {
    display: flex;
    padding: 9px 9px 0px 9px;
    justify-content: space-between;
}

.twitterLogo {
    background-image: url('/img/twitterLogo.svg');
    display: flex;
    width: 30px;
    height: 30px;
    background-position: center center;
    background-size: 80%;
    background-repeat: no-repeat;
}

.tweetContent {
    padding: 5px 9px 4px;
}

.footer {
    padding: 4px 9px 2px 9px;
    border-top: 1px solid #efefef;
    height: 60px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.accountGroup {
    color: color3;
    display: inline-flex;
    text-decoration: none;
    align-items: center;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
}

.fullNameGroup {
    display: flex;
    flex-direction: column;
    max-width: 100%;
}

.fullName {
    color: color4;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    flex-direction: row;
    align-items: center;
}

.username {
    font-size: 14px;
    color: color6;
    font-weight: 500;
}

.verified {
    background-image: url('/img/twitter-verified-icon.svg');
    width: 15px;
    height: 15px;
    display: flex;
    margin-left: 5px;
}

.hiddenVisually {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    font-size: 1px;
    height: 1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
}

.tweetText {
    font-size: 15px;
    line-height: 22px;
    font-weight: normal;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: color5;
    margin: 10px 0px 5px 0px;
}

.topRow {
    display: flex;
    justify-content: space-between;
    height: 25px;
    align-items: center;
}

.bottomRow {
    display: flex;
}

.timeStamp {
    font-size: 14px;
    line-height: 24px;
    color: #72727f;
}

.closeContainer {
    display: inline-flex;
}

.tweetDetailsContainer {
    margin-top: -5px;
    width: stretch;
}

.tweetInfoContainerSidebar {
    & .header {
        padding: 3px 0px 0px 0px;
    }

    & .tweetContent {
        padding: 5px 0px 4px;
    }

    & .footer {
        padding: 4px 10px 0px 10px;
        border-top: 1px solid #efefef;
        margin: 0 -10px -3px -10px;
        height: auto;
    }

    & .bottomRow {
        flex-direction: column;
    }
}
