/*! FolderSelector.css */
#folderSelectorOverlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.48);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

#folderSelectorModal {
    background: #ffffff;
    width: min(720px, 96vw);
    max-height: 88vh;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(2, 8, 20, 0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#folderSelectorHeader {
    padding: 20px 24px 8px 24px;
    border-bottom: 1px solid #eef2f7;
}

#folderSelectorHeader h2 {
    margin: 0 0 6px 0;
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
}

#folderSelectorSubtitle {
    margin: 0 0 6px 0;
    color: #475569;
    font-size: 13px;
}

#folderSelectorBody {
    padding: 16px 20px 8px 20px;
    overflow: auto;
    gap: 16px;
    display: grid;
    grid-template-columns: 1fr;
}

#folderSelectorFolderTitleContainer {
    position: relative;
    width: 100%;
    height: auto;
    overflow: hidden;
}

#folderSelectorFolderTitle {
    width: 50px;
    float: left;
    display: block;
}

.folderSelectorSectionTitle {
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    margin: 8px 0;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.folderSelectorTileRow {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Drives section uses a column list instead of tiles */
#folderSelectorDrives {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.folderSelectorTile {
    width: 100px;
    min-height: 100px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 10px;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s;
    outline: none;
}

.folderSelectorTile:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(2, 8, 20, 0.06);
}

.folderSelectorTile.is-selected {
    border-color: var(--main-color);
}

.folderSelectorTileIcon {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    background-size: cover;
    background-position: center;
    background-color: #e2e8f0;
    margin-bottom: 8px;
}

.folderSelectorTileName {
    font-size: 11px;
    color: #0f172a;
    text-align: center;
    word-break: break-word;
}

.folderSelectorAccordion {
    margin-top: 4px;
}

.folderSelectorRow {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: background .1s ease;
}

.folderSelectorRow:hover {
    background: #f1f5f9;
}

.folderSelectorRow.is-selected {
    background: #eaf2fe;
}

.folderSelectorChevron {
    width: 16px;
    color: #64748b;
    user-select: none;
}

.folderSelectorFolderIcon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    background-size: cover;
    background-position: center;
    border-radius: 4px;
    opacity: .9;
}

.folderSelectorFolderName {
    color: #0f172a;
    font-size: 13px;
}

#folderSelectorBreadcrumb {
    color: #475569;
    font-size: 12px;
    margin-bottom: 6px;
}

#folderSelectorCreateRow {
    margin-top: -5px;
    margin-left: 3px;
    display: none;
}

#folderSelectorCreateRow.is-disabled {
    opacity: .6;
    pointer-events: none;
}

#folderSelectorCreateInput {
    width: 100%;
    height: 35px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    padding: 0 12px;
    font-size: 13px;
    outline: none;
}

#folderSelectorCreateInput:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.folderSelectorError {
    color: #b91c1c;
    font-size: 12px;
    min-height: 16px;
}

#folderSelectorFooter {
    margin-top: auto;
    padding: 12px 16px;
    display: block;
    position: relative;
    gap: 8px;
    justify-content: flex-end;
    border-top: 1px solid #eef2f7;
}

#folderSelectorFooterOptions {
    position: relative;
    float: left;
    height: auto;
    overflow: hidden;
    width: fit-content;
}

#folderSelectorLeaveACopyRow {
    color: var(--dark-color);
    font-size: 14px;
    margin-top: 7px;
    margin-left: 14px;

}

#folderSelectorLeaveACopyContainer {
    position: relative;
    float: left;
    width: fit-content;
}

#folderSelectorLeaveACopy {
    float: left;
    color: var(--main-color);
    background-color: white;
    border: 1px solid var(--main-color);
    border-radius: .25em;
    width: 15px;
    height: 15px;
    margin-top: .25em;
    appearance: none;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    print-color-adjust: exact;
    display: block;
    position: relative;
    margin-left: 0px;
    margin-right: 5px;
}

#folderSelectorLeaveACopy:checked[type=checkbox] {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
}

#folderSelectorLeaveACopyText {
    float: left;
    margin-left: 10px;
    font-size: 13px;
    margin-top: 2px;
}

#folderSelectorFooterButtons {
    position: relative;
    float: right;
    display: block;
    width: fit-content;
}

.folderSelectorBtn {
    height: 36px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-size: 14px;
    cursor: pointer;
}

.folderSelectorBtnPrimary {
    background: var(--main-color);
    color: white;
}

.folderSelectorBtnPrimary[disabled] {
    background: #bfdbfe;
    cursor: not-allowed;
}

.folderSelectorBtnSecondary {
    background: #f8fafc;
    color: #0f172a;
    border-color: #e2e8f0;
}

.folderSelectorSpinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: folderSelectorSpin 1s linear infinite;
    margin: 8px;
}

@keyframes folderSelectorSpin {
    to {
        transform: rotate(360deg);
    }
}

.folderSelectorRow.depth-0 {
    padding-left: 10px;
}

.folderSelectorRow.depth-1 {
    padding-left: 20px;
}

.folderSelectorRow.depth-2 {
    padding-left: 30px;
}

.folderSelectorRow.depth-3 {
    padding-left: 40px;
}

.folderSelectorRow.depth-4 {
    padding-left: 50px;
}

.folderSelectorRow.depth-5 {
    padding-left: 60px;
}

.folderSelectorRow.depth-6 {
    padding-left: 70px;
}

.folderSelectorRow.depth-7 {
    padding-left: 80px;
}

.folderSelectorRow.depth-8 {
    padding-left: 90px;
}

.folderSelectorRow.depth-9 {
    padding-left: 100px;
}

.folderSelectorRow.depth-10 {
    padding-left: 110px;
}

/* Mobile */
@media (orientation: portrait) {
    #folderSelectorModal {
        width: 96vw;
        max-height: 92vh;
    }

    .folderSelectorTile {
        width: calc(50% - 10px);
        min-height: 110px;
    }

    #folderSelectorBody {
        padding: 12px;
    }
}

#folderSelectorFolderSearch {
    float: left;
    position: relative;
    width: calc(100% - 70px);
    display: block;
    height: 30px;
    margin-left: 10px;
    margin-top: 2px;
}

#folderSelectorFolderSearchContainer {
    background-color: #ffffff;
    border: 1px solid #f1f1f1;
    height: 25px;
    margin-top: 1px;
    border-radius: 5px;
}

#folderSelectorFolderSearchIcon {
    width: 14px;
    margin-left: 5px;
    margin-top: 5px;
    display: block;
    float: left;
}

#folderSelectorFolderSearchText {
    display: block;
    float: left;
    width: calc(100% - 50px);
    margin-left: 10px;
    margin-top: 5px;
    color: grey;
    font-size: 12px;
}

#folderSelectorSearchResultsContainer {
    display: block;
    position: absolute;
    top: 32px;
    overflow: visible;
    left: 57px;
}

#folderSelectorSearchResults {
    top: 0px;
    background-color: white;
    overflow-y: scroll;
    height: 300px;
    width: 600px;
}

.folderSelectorSearchResultType {
    padding-top: 10px;
    padding-bottom: 10px;
}

.folderSelectorSearchResultLine1 {
    font-weight: 900;
    margin-left: 20px;
    margin-top: 6px;
    font-size: 12px;
    color: black;
}

.folderSelectorSearchResultLine2 {
    margin-left: 20px;
    font-size: 11px;
    color: var(--dark-color);
    opacity: 0.7;
    margin-top: 2px;
    margin-bottom: 6px;
}

.folderSelectorDriveIcon {
    fill: var(--main-color);
}

/* Drive list row */
.folderSelectorDriveRowIcon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    background-size: cover;
    background-position: center;
    border-radius: 4px;
    opacity: .85;
}

.folderSelectorDriveRowName {
    color: #0f172a;
    font-size: 13px;
    font-weight: 500;
}

.folderSelectorLeaveACopyText {
    font-size: 11px;
    position: relative;
    display: block;
    width: 200px;
    margin-top: 4px;
}