.resourceDetail {
    container-type: inline-size;
    isolation: isolate;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-size: 100% 100%;
    display: flex;
    flex-direction: column;
}

.resourceDetail .resourceContent {
    flex: 1;
    min-height: 0;
    position: relative;
}

/* Default: iframes inside resourceContent fill the available area.
   Type-specific rules (webpage, pdf, mastodon) override width/height for zoom scaling. */
.resourceDetail .resourceContent iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.resourceDetail .resourceButtons {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    display: flex;
    align-items: center;
}

.overlayElement .resourceDetail .resourceButtons {
    display: none;
}

.resourceDetail .resourceButtons .button {
    padding: 2px 4px;
    border-color: transparent;
    color: var(--primary-fg-color);
    background: var(--secondary-bg-color);
    margin: 2px;
}

.resourceDetail .resourceButtons .button:hover {
    background: var(--primary-fg-color);
    color: var(--primary-bg-color);
}

.resourceDetail .resourceButtons .resourcePlayFromHereButton, 
.resourceDetail .resourceButtons .button[download] {
    display: none;
}

.resourcePreviewDialog .resourceDetail .resourceButtons .resourcePlayFromHereButton,
.layoutArea[data-area="areaBottom"][data-size="large"] .resourceDetail .resourceButtons .resourcePlayFromHereButton,
.layoutArea[data-area="areaTop"][data-size="large"] .resourceDetail .resourceButtons .resourcePlayFromHereButton,
.layoutAreaDetails[data-area="areaTop"] .resourceDetail .resourceButtons .resourcePlayFromHereButton,
.layoutAreaDetails[data-area="areaBottom"] .resourceDetail .resourceButtons .resourcePlayFromHereButton {
    display: flex;
}

.resourcePreviewDialog .resourceDetail .resourceButtons .button[download] {
    display: flex;
}

.resourceDetail .licenseInformation {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    box-sizing: border-box;
    line-height: 30px;
    opacity: 0.7;
}

.resourceDetail:hover .licenseInformation {
    opacity: 1;
}

.resourceDetail .licenseInformation:not(:empty) {
    padding: 2px 8px;
    background-color: var(--secondary-bg-color);
    color: var(--primary-fg-color);
}

.overlayElement .resourceDetail .licenseInformation {
    display: none;
}

.resourceDetail .licenseInformation a {
    border: 0;
    outline: 0;
    color: var(--primary-fg-color);
}

.resourceDetail .licenseInformation a .cc-by-sa-bg-image {
    display: inline-block;
    width: 50px;
    height: 30px;
    vertical-align: bottom;
}

/* Resource Thumb */

.resourceThumb {
    background-repeat: no-repeat;
    background-size: cover;
    background-position: top center;
    background-color: var(--primary-bg-color);
    outline: 1px solid var(--primary-bg-color);
    cursor: pointer;
    border-radius: 3px;
}


.resourceThumb.ft-drag-clone {
    outline: 1px solid #FF9919;
}

.resourceThumb.ui-draggable {
    cursor: move;
}

.resourceThumb .resourceOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, .5) 100%);
}

.resourceThumb .resourceOverlay .resourceIcon {
    position: absolute;
    right: 10px;
    bottom: 10px;
    width: 26px;
    height: 16px;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    z-index: 2;
}

.resourceThumb .resourceOverlay .resourceIcon [class^="icon-"]::before, .resourceThumb .resourceOverlay .resourceIcon [class*=" icon-"]::before {
    font-size: 20px;
    color: var(--thumb-icon-color);
    text-shadow: var(--thumb-icon-shadow);
}


body > .resourceThumb:not(.resourceAnimationDiv) .resourceTitle {
    display: block;
}

.resourceThumb .resourceTitle {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    max-height: 50px;
    background-color: var(--thumb-title-bg);
    font-size: 13px;
    padding: 6px 5px 3px 5px;
    overflow: hidden;
    color: var(--thumb-title-color);
    text-shadow: var(--thumb-title-shadow);
    word-wrap: break-word;
    hyphens: auto;
    box-sizing: border-box;
}

.resourceThumb .resourcePreviewButton {
    position: absolute;
    bottom: 4px;
    left: 4px;
    z-index: 4;
    background-color: var(--semi-transparent-bg-color);
    border: 2px solid var(--primary-fg-color) ;
    border-radius: 50%;
    font-size: 0;
    height: 28px;
    width: 28px;
    display: none;
}

.resourceThumb .resourcePreviewButton [class^="icon-"]::before, .resourceThumb .resourcePreviewButton [class*=" icon-"]::before {
    font-size: 18px;
    width: 100%;
    margin: 0;
    line-height: 26px;
    color: var(--primary-fg-color);
}

.resourceThumb .resourcePreviewButton:hover {
    background-color: var(--primary-bg-color);
}

.resourceThumb:hover .resourcePreviewButton {
    display: block;
}

.resourceThumb.ft-drag-clone .resourcePreviewButton, .resourceThumb.dragPlaceholder .resourcePreviewButton, .resourceThumb.resourceAnimationDiv .resourcePreviewButton {
    display: none;
}

.resourceThumb .resourceEditButton {
    position: absolute;
    bottom: 4px;
    right: 4px;
    z-index: 4;
    background-color: var(--semi-transparent-bg-color);
    border: 2px solid var(--primary-fg-color);
    border-radius: 50%;
    font-size: 0;
    height: 28px;
    width: 28px;
    display: none;
    cursor: pointer;
}

.resourceThumb .resourceEditButton [class^="icon-"]::before, .resourceThumb .resourceEditButton [class*=" icon-"]::before {
    font-size: 18px;
    width: 100%;
    margin: 0;
    line-height: 26px;
    color: var(--primary-fg-color);
}

.resourceThumb .resourceEditButton:hover {
    background-color: var(--primary-bg-color);
}

.resourceThumb:hover .resourceEditButton {
    display: block;
}

.resourceThumb.ft-drag-clone .resourceEditButton, .resourceThumb.dragPlaceholder .resourceEditButton, .resourceThumb.resourceAnimationDiv .resourceEditButton {
    display: none;
}

.resourceThumb.resourceAnimationDiv.listThumb {
    background-image: none !important;
    padding: 0 !important;
    overflow: hidden;
}

.resourceThumb.resourceAnimationDiv.listThumb::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-image: var(--thumb-bg);
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    background-color: var(--primary-bg-color);
    border-radius: 0;
}

.resourceThumb.resourceAnimationDiv.listThumb .resourceOverlay,
.resourceThumb.resourceAnimationDiv.listThumb .resourceTitle {
    display: none;
}

/* Edit Overlay Properties */

.editPropertiesContainer .layoutRow > * {
    margin-bottom: 10px;
}

.editPropertiesContainer .controlsWrapper {
    width: 100%;
    height: 100%;
}

.editPropertiesContainer .previewThumbContainer {
    float: right;
    height: 100px;
    width: 140px;
}

.editPropertiesContainer .previewThumbContainer .resourceThumb {
    position: relative;
    width: 100%;
    height: 100%;
}

.editPropertiesContainer .tagManagementUI {
    padding-top: 10px;
    clear: both;
}

.editPropertiesContainer .propertiesTypeIcon {
    float: left;
    background-position: left 3px;
    background-repeat: no-repeat;
    background-size: 100% auto;
    height: 28px;
    margin-bottom: 2px;
    width: 32px;
}

.editPropertiesContainer .propertiesTypeIcon [class^="icon-"]::before, .editPropertiesContainer .propertiesTypeIcon [class*=" icon-"]::before {
    font-size: 25px;
    margin-left: 0px;
    color: var(--primary-bg-color);
}

.editPropertiesContainer input[type="number"] {
    border: var(--input-border-width) solid var(--primary-bg-color);
    background: var(--primary-fg-color);
    margin: 0px 2px 0px 2px;
    padding: 0;
    width: 46px;
    overflow: hidden;
    box-sizing: border-box;
}

.editPropertiesContainer .timeControls {
    float: left;
    position: relative;
    width: 300px;
    margin-bottom: 14px;
}

.editPropertiesContainer .timeControls .ft-spinner {
    width: 55px;
    margin: 3px 2px 3px 6px;
    float: left;
}

.editPropertiesContainer .timeControls label, 
.editPropertiesContainer .positionControls label {
    position: absolute;
    top: 26px;
    left: 0px;
    font-size: 12px;
}

.editPropertiesContainer label[for="TimeStart"] {
    left: 40px;
}

.editPropertiesContainer label[for="TimeEnd"] {
    left: 94px;
}

.editPropertiesContainer .timeControls .deleteOverlay, .editPropertiesContainer .timeControls .deleteAnnotation {
    padding: 1px 3px 0px 3px;
    margin-right: 6px;
    color: #e90000;
    border-color: #e90000;
    vertical-align: middle;
    margin-left: 4px;
}

.editPropertiesContainer .timeControls .deleteOverlay:hover, .editPropertiesContainer .timeControls .deleteAnnotation:hover {
    color: #ffffff;
    background-color: #e90000;
}

.editPropertiesContainer .positionControls {
    float: right;
    position: relative;
    width: 220px;
}

.editPropertiesContainer .positionControls label {
    left: auto;
}

.editPropertiesContainer label[for="PositionTop"] {
    right: 195px;
}

.editPropertiesContainer label[for="PositionLeft"] {
    right: 139px;
}

.editPropertiesContainer label[for="PositionWidth"] {
    right: 74px;
}

.editPropertiesContainer label[for="PositionHeight"] {
    right: 24px;
}

.editPropertiesContainer .positionControls .ft-spinner {
    float: right;
    margin-right: 6px;
}

.editPropertiesContainer .textContentEditorContainer {
    height: calc(100% - 90px);
}

.editPropertiesContainer .overlayOptionsWrapper {
    clear: both;
    height: calc(100% - 41px);
}

.editPropertiesContainer .annotationOptionsWrapper {
    clear: both;
    height: calc(100% - 104px);
}

.editPropertiesContainer .overlayOptionsTabs, .editPropertiesContainer .annotationOptionsTabs {
    clear: both;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.infoAreaRight .ui-tabs .ui-tabs-nav {
    flex: 0 0 auto;
}

.infoAreaRight .ui-tabs .ui-tabs-panel {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.editPropertiesContainer .opacitySlider {
    margin: 10px 5px;
    height: 6px;
    background: #cfcfcf;
}

.editPropertiesContainer .ui-slider-range {
    background: rgba(47, 50, 58, .5);
}

.editPropertiesContainer .ui-slider-handle {
    background: var(--primary-bg-color);
    height: 14px;
    width: 14px;
    margin-left: -7px;
    border-radius: 50%;
}

/* =====================================================
   Generic Resource Card
   Used by: ResourceUrlPreview, ResourceWikipedia,
            ResourceWebpage (forbidden fallback)
   ===================================================== */

.resourceDetail .resourceContent .resourceCard {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    overflow: auto;
    scrollbar-width: thin;
    background: var(--primary-bg-color);
    color: var(--primary-fg-color);
}

.resourceDetail .resourceContent .resourceCard .resourceCardHeader {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 0 0 10px 0;
    flex-shrink: 0;
}

.resourceDetail .resourceContent .resourceCard .resourceCardTypeIcon {
    flex-shrink: 0;
    width: 23px;
    font-size: 18px;
    line-height: 1;
    margin-top: 2px;
    opacity: 0.8;
}

.resourceDetail .resourceContent .resourceCard .resourceCardTypeIcon [class^="icon-"]::before,
.resourceDetail .resourceContent .resourceCard .resourceCardTypeIcon [class*=" icon-"]::before {
    font-size: 18px;
    margin: 0;
    color: var(--primary-fg-color);
}

.resourceDetail .resourceContent .resourceCard .resourceCardMeta {
    flex: 1;
    min-width: 0;
}

.resourceDetail .resourceContent .resourceCard .resourceCardTitle {
    line-height: 1.3;
    font-size: 1.2em;
    word-break: break-word;
    hyphens: auto;
    padding-right: 70px;
}

.resourceDetail .resourceContent .resourceCard .resourceCardSubtitle {
    opacity: 0.8;
    margin-top: 2px;
    padding-right: 70px;
}

.resourceDetail .resourceContent .resourceCard .resourceCardThumb {
    flex-shrink: 0;
    width: 100%;
    padding: 2px;
    box-sizing: border-box;
    background: var(--secondary-bg-color);
}

.resourceDetail .resourceContent .resourceCard .resourceCardThumb img {
    width: 100%;
    height: auto;
    display: block;
}

.resourceDetail .resourceContent .resourceCard .resourceCardContent {
    flex: 1;
    padding: 4px 0px;
    overflow-y: auto;
    line-height: 1.5;
    opacity: 1;
    min-height: 70px;
}

.resourceDetail .resourceContent .resourceCard .resourceCardContent p:first-child {
    margin-top: 0;
}

.resourceDetail .resourceContent .resourceCard .resourceCardFooter {
    flex-shrink: 0;
    padding: 5px 0 0 0;
    margin-top: 8px;
    border-top: 1px solid var(--secondary-fg-color);
}

.resourceDetail .resourceContent .resourceCard .resourceCardFooter a {
    color: var(--primary-fg-color);
    text-decoration: none;
    opacity: 0.8;
}

.resourceDetail .resourceContent .resourceCard .resourceCardFooter a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* 2-column layout for thumb+content when resourceDetail is wide enough */
@container (min-width: 400px) {
    .resourceDetail .resourceContent .resourceCard:has(.resourceCardThumb) {
        display: grid;
        grid-template-columns: minmax(80px, 40%) 1fr;
        grid-template-rows: auto 1fr auto;
    }

    .resourceDetail .resourceContent .resourceCard:has(.resourceCardThumb) .resourceCardHeader {
        grid-column: 1 / 3;
        grid-row: 1;
    }

    .resourceDetail .resourceContent .resourceCard:has(.resourceCardThumb) .resourceCardThumb {
        grid-column: 1;
        grid-row: 2;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .resourceDetail .resourceContent .resourceCard:has(.resourceCardThumb) .resourceCardThumb img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .resourceDetail .resourceContent .resourceCard:has(.resourceCardThumb) .resourceCardContent {
        grid-column: 2;
        grid-row: 2;
        padding-left: 8px;
    }

    .resourceDetail .resourceContent .resourceCard:has(.resourceCardThumb) .resourceCardFooter {
        grid-column: 1 / 3;
        grid-row: 3;
    }
}

/* Shrink thumb image when the overlay is narrow */
@container (max-width: 500px) {
    .resourceDetail .resourceContent .resourceCard .resourceCardThumb img {
        width: 80%;
        margin: 0 auto;
    }
}

@container (max-width: 400px) {
    .resourceDetail .resourceContent .resourceCard .resourceCardThumb img {
        width: 50%;
        margin: 0 auto;
    }
    .resourceDetail .resourceContent .resourceCard .resourceCardContent {
        overflow-y: visible;
        min-height: unset;
    }
}

/* ===================================================== */

.editPropertiesContainer .ui-tabs textarea,
.editPropertiesContainer .ui-tabs input[type="text"], 
.editPropertiesContainer .ui-tabs label:not(.switch) {
    box-sizing: border-box;
    width: 100%;
    margin-top: 0px;
    margin-right: 0px;
    /*visibility: hidden;*/
}

.editPropertiesContainer .ui-tabs input[type="time"] {
    box-sizing: border-box;
    margin-top: 0px;
}

.editPropertiesContainer .ui-tabs label:not(.switch) {
    display: block;
    margin-bottom: 3px;
}

.editPropertiesContainer .ui-tabs button {
    padding: 3px 5px;
}

.editPropertiesContainer .ui-tabs .switch {
    margin-right: 8px;
    vertical-align: top;
    margin-top: 7px;
}
