body {
    font-family: Arial, Helvetica, sans-serif;
    margin: 0;
    padding: 0;
}
div.page {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    overflow: hidden;
    width:100vw;
    height:100vh;
}
div.header {
    background-color: #79a548;
    color: rgba(255,255,255,0.8);
    padding: 10px;
    height: 60px;
    box-sizing: border-box;
    font-size: 2em;
    display: flex;
    flex-direction: row;
    gap: 10px;
    align-items: center;
    user-select: none;
}
div.header img {
    height: 40px;
    vertical-align: middle;
}
div.main{
    flex-grow: 1;
    overflow: auto;
    background: white;
    padding: 10px;
}
div.footer{
    user-select: none;
    box-sizing: border-box;
    background-color: #4d4d4d;
    color: white;
    padding: 10px;
    height: 40px;
    text-align: center;
}
div.footer a {
    color:white;
}
div.dialog {
    width:1000px;
    max-width: calc(100vw - 20px); /* 20px <- padding of main container */
    margin: 0 auto;
    padding: 2em;
    background-color: #f2f2f2;
    font-size: 1em;
    box-sizing: border-box;
}
div.error {
    text-align: center;
    background-color: #ffebe6;
    font-size: 1.3em;
    color:red;
}
div.login {

}
div.dialog-btn-wrapper {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    user-select: none;
}
button.dialog, input.dialog[type=submit], input.dialog[type=button] {
    box-sizing: border-box !important;
    -webkit-appearance: none;
    -webkit-border-radius: 0;
    padding: 12px;
    margin: 8px 0 !important;
    border: none !important;
    cursor: pointer;
    font-size: 110%;
    text-decoration: none !important;
    background-color: #2f769c;
    color:white;
}
button.dialog:hover, input.dialog[type=submit]:hover, input.dialog[type=button]:hover {
    background-color: #25509d;
}
button.dialog:focus, input.dialog[type=submit]:focus, input.dialog[type=button]:focus {
    text-decoration: none !important;
    border: none !important;
}
button.dialog::-moz-focus-inner, input.dialog[type=submit]::-moz-focus-inner, input.dialog[type=button]::-moz-focus-inner {
    border: none !important;
}
button.dialog:disabled, input.dialog[type=submit]:disabled, input.dialog[type=button]:disabled, select.dialog:disabled {
    background-color: #404040 !important;
    color: gray !important;
    cursor: not-allowed;
}
select.dialog:disabled {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='20px' height='20px' viewBox='0 0 20 20' version='1.1'><path style=' stroke:none;fill-rule:nonzero;fill:rgb(50%,50%,50%);fill-opacity:1;' d='M 18.960938 4.496094 L 10 13.425781 L 1.039062 4.496094 L 0 5.539062 L 10 15.503906 L 20 5.539062 Z M 18.960938 4.496094 '/></svg>");
}
button.dialog:disabled:hover, input.dialog[type=submit]:disabled:hover, input.dialog[type=button]:disabled:hover {
    background-color: #404040 !important;
}
button.dialog img {
    height: 1.5em;
    vertical-align: middle;
    filter: brightness(0) invert(1);
}
.ok {
    background-color: #71c174 !important;
    color: white !important;
}
.ok:hover {
    background-color: #4CAF50 !important;
}
.cancel {
    background-color: #f66055 !important;
    color: white !important;
}
.cancel:hover {
    background-color: #F44336 !important;
}
input.dialog[type=text], input.dialog[type=email], input.dialog[type=password] {
    padding: 5px;
    margin-top: 5px;
    margin-bottom: 15px;
    width:100%;
    box-sizing: border-box;
}
div.msg-error {
    color:red;
    background-color: #ffebe6;
    padding: 10px;
}
div.msg-ok {
    color:#006600;
    background-color: #e6ffe6;
    padding: 10px;
}
form.upload {
    background-color: #f5f5dc;
    padding: 10px;
}
div.share-header {
    user-select: none;
    background-color: #b4d095;
    padding: 10px;
    display:flex;
    flex-direction: row;
    gap: 10px;
    flex-wrap: wrap;
}
div.file-list{
    /*padding: 10px;*/
    flex-grow: 1;
    border: 1px solid lightgray;
    box-sizing: border-box;
    overflow: auto;
}
div.file-list > table{
    /*max-width: calc(100vw - 20px); 20px <- padding of main container */
    /*margin: 10px; auto;*/
    border-collapse: collapse;
}
div.file-list > table td, th{
    border-bottom:1px solid lightgray;
    padding: 4px 20px 4px 4px;
}
a.action {
    color:black;
}
a.action > img{
    vertical-align: middle;
    height:28px;
}
div.file-name-w {
    display: flex;
    max-width:min(50vw, 25em);
    width:100%;
    overflow: hidden;
}
dif.file_name-c {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
a.file-name {
    display: block;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    text-decoration: none;
}
a.file-name:hover {
    text-decoration: underline; /* Underline on hover */
} 

div.folder-tree-container {
    border-left: 1px solid lightgray;
    border-top: 1px solid lightgray;
    border-bottom: 1px solid lightgray;
    padding-right: 10px;
    overflow: auto;
    box-sizing: border-box;
    min-width: 15em;
    max-width: 20em;
    user-select: none;
    background-color: #fafafa;
}

.diva-file-tree, ul.diva-file-tree ul {
    font-family: "Segoe UI", Arial, sans-serif;
    list-style: none;
    margin: 0;
    padding-left: 1.5em;
    overflow: hidden;
}


.diva-file-tree li {
    position: relative;
}

.diva-file-tree ul:not(.top-level) li::before {
    content: '';
    position: absolute;
    border-left: 1px solid #999;
    border-bottom: 1px solid #999;
    right: calc(100% + 0.1em );
    top: -500%;
    width: 1em;
    bottom: calc(100% - 0.8em);
}

.diva-file-tree li > div {
    padding: 0.2em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%; /* required */
    box-sizing: border-box;
    color: #4e4e4b;
}
.diva-file-tree li > div:hover {
    text-decoration: underline;
}

div.diva-file-tree li > div:hover::before {
    opacity: 0.8; 
}

.diva-file-tree li > div::before{
    content: "";
    display: inline-block;
    vertical-align: middle;
    width: 1.3em;
    height: 1.3em;
    background-image: url('/DiVA/filecloud/src/img/folder.png');
    background-size: cover; /* or contain, or specify exact size */
    margin-right: 4px;
    opacity: 0.64;
}

.folder-selected {
    font-weight: bold;
    color:black !important;
}

#folder-select-list{
    display: none;
}
#folder-select-text{
}

@media only screen and (max-width: 820px) {
    #folder-select-list{
        display: inline-block;
    }
    #folder-select-text{
        display:none;
    }
    div.folder-tree-container {
        display:none;
    }
}