/* static/css/project.css */

/* ###########################
      Add Project Button
########################### */ 

/* Main Settings */
.new-project-row{
    display: flex;
    width: 100%;
    margin-bottom: 4px;
    background: transparent;
}
.new-project-btn{
    display: flex;
    position: relative;
    z-index: 4000;
    justify-content: flex-start;
    align-items: center;
    width: 160px;
    height: 35px;
    margin: 15px;
    background: var(--bg-upload-new-img-btn);
    color: var(--text-upload-new-img-btn);
    border: var(--border-upload-new-img-btn);
    border-radius: 15px;
    font-family: 'PingFangHKWeb', sans-serif;
    font-weight: 500;
    font-size: 15px;
    cursor: pointer;
}
/* Create Project modal */
#project-modal-overlay[hidden]{
    display: none !important;
}
.project-modal-box,
#project-modal-overlay .modal-box{
    position: relative;
    min-width: 320px;
    max-width: 420px;
    padding: 22px 20px 18px 20px;
}
#project-name-input{
    width: 100%;
    height: 38px;
    margin: 10px 0 14px 0;
    padding: 8px 12px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 10px;
    outline: none;
    color: var(--text-modal-box);
    font-family: 'PingFangHKWeb', sans-serif;
    font-size: 14px;
}
#project-name-input:focus{
    border-color: rgba(255,255,255,0.35);
}
#project-modal-create{
    background: rgb(60, 179, 113);
}
#project-modal-create:hover{
    background: rgb(76, 199, 127);
}
#project-modal-cancel{
    background: rgb(100,100,100);
}
#project-modal-close{
    position: absolute;
    top: 10px;
    right: 10px;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text-modal-box);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
}
#project-modal-close:hover{
    background: rgba(255,255,255,0.08);
}





/* ###########################
        Project Folder
########################### */ 

/* Main Settings */
#projects-container-wrapper{
    overflow: hidden;
    transition: max-height 0.22s ease, opacity 0.18s ease, margin-top 0.18s ease;
    max-height: 2000px;
    opacity: 1;
    margin-top: 0;
}
#projects-container-wrapper.collapsed{
    max-height: 0;
    opacity: 0;
    margin-top: 0;
}
#projects-container{
    margin: 0;
    padding: 4px 20px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: none;
    overflow: visible;
    box-sizing: border-box;
}
.project-empty-state{
    padding: 6px 4px 10px 4px;
    color: var(--text-history-item);
    opacity: 0.7;
    font-family: 'PingFangHKWeb', sans-serif;
    font-size: 13px;
}
.project-entry{
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.project-folder{
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 35px;
    padding: 8px 34px 8px 12px;
    background: var(--bg-history-item);
    border: none;
    border-radius: 15px;
    color: var(--text-history-item);
    font-family: 'PingFangHKWeb', sans-serif;
    font-size: 15px;
    text-align: left;
    transition: background 0.18s ease;
    padding-right: 34px;
}
.project-folder:hover{
    background: var(--bg-history-item-hover);
}
.project-folder.multi-selected {
    border: 3px solid rgba(135, 206, 250, 0.95) !important;
    box-shadow: 0 0 0 1px rgba(135, 206, 250, 0.35);
    background: rgba(100, 100, 100, 0.35);
    box-sizing: border-box;
}

.project-folder.multi-selected:hover {
    background: rgba(100, 100, 100, 0.45);
}
.project-folder-left{
    display: flex;
    align-items: center;
    min-width: 0;
    margin: 0 0 0 0 !important;
}
.folder_icon{
    width: 16px;
    height: 16px;
    margin: 0 8px 0 0;
    object-fit: contain;
}
.project-folder-name{
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
/* Project Folder Menu */
.project-folder-menu-btn{
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    display: none;
    background: transparent;
    border: none;
    color: var(--bg-history-menu-btn);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}
.project-folder:hover .project-folder-menu-btn{
    display: block;
}
.project-folder-action-menu{
    position: absolute;
    transform: none !important;
    margin: 0 !important;
    background: var(--bg-history-action-menu);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.6);
    padding: 4px 0;
    min-width: 140px;
    width: auto;
    height: auto;
    display: none;
    overflow: visible;
    z-index: 3000;
}
.project-folder-action-menu button{
    width: 100%;
    padding: 8px 12px;
    background: none;
    border: none;
    color: var(--text-history-action-menu-button);
    text-align: left;
    cursor: pointer;
}
.project-folder-action-menu button:hover{
    background: var(--bg-history-action-menu-button-hover);
}
.project-folder .history-rename-input{
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    max-width: 100%;

    height: 24px;
    box-sizing: border-box;

    margin: 0;
    padding: 2px 6px;

    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 6px;

    color: var(--text-history-item);
    font-family: 'PingFangHKWeb', sans-serif;
    font-size: 14px;
    line-height: 1.2;

    outline: none;
}
.project-folder .history-rename-input:focus{
    border-color: rgba(255,255,255,0.35);
}
/* Project Folder Name Tooltip */
.project-folder::after,
.project-image-item::after {
    content: attr(data-tooltip);
    position: fixed;
    left: 190px;
    top: var(--tooltip-y, 0px);

    max-width: 260px;
    padding: 7px 10px;

    background: var(--bg-history-item-hover);
    color: #fff;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.45);

    font-family: 'PingFangHKWeb', sans-serif;
    font-size: 13px;
    line-height: 1.3;
    white-space: normal;
    word-break: break-word;

    opacity: 0;
    pointer-events: none;
    z-index: 6000;
    transform: translateY(-50%);
}
.project-folder:hover::after,
.project-image-item:hover::after {
    opacity: 1;
}
/* Drag and Drop */
.project-folder.drag-over{
    background: rgba(255,255,255,0.16);
    outline: 1px dashed rgba(255,255,255,0.45);
}
body.dragging-image-item .project-folder{
    transition: background 0.12s ease, outline 0.12s ease;
}





/* ###########################
        Project Images
########################### */ 
.project-images-list{
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-left: 12px;
    overflow: hidden;
    max-height: 1200px;
    opacity: 1;
    transition: max-height 0.22s ease, opacity 0.18s ease, padding-top 0.18s ease;
}
.project-images-list.collapsed{
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    gap: 0;
}
.project-image-entry{
    display: flex;
    flex-direction: column;
}
.project-image-item{
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 33px;
    padding: 8px 12px;
    background: var(--bg-history-item);
    border: none;
    border-radius: 12px;
    color: var(--text-history-item);
    font-family: 'PingFangHKWeb', sans-serif;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition: background 0.18s ease;
    position: relative;
    padding-right: 34px;
}
.project-image-item:hover{
    background: var(--bg-history-item-hover);
}
.project-image-item.selected{
    background: var(--bg-history-item-hover);
}
.project-image-left{
    display: flex;
    align-items: center;
    min-width: 0;
    width: 100%;
}
.project-image-item{
    overflow: hidden;
    box-sizing: border-box;
}
.project-image-name{
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.history-entry,
.project-image-entry,
.project-entry{
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.history-item,
.project-image-item,
.project-folder {
    max-width: 100%;
    box-sizing: border-box;
}
/* Project Image Menu */
.project-image-menu-btn{
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    display: none;
    background: transparent;
    border: none;
    color: var(--bg-history-menu-btn);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}
.project-image-item:hover .project-image-menu-btn{
    display: block;
}
.project-image-action-menu{
    position: absolute;
    transform: none !important;
    margin: 0 !important;
    background: var(--bg-history-action-menu);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.6);
    padding: 4px 0;
    min-width: 160px;
    width: auto;
    height: auto;
    display: none;
    overflow: visible;
    z-index: 3000;
}
.project-image-action-menu button{
    width: 100%;
    padding: 8px 12px;
    background: none;
    border: none;
    color: var(--text-history-action-menu-button);
    text-align: left;
    cursor: pointer;
}
.project-image-action-menu button:hover{
    background: var(--bg-history-action-menu-button-hover);
}
.project-image-move-wrapper{
    position: relative;
}

.project-image-move-btn{
    width: 100%;
}
.project-image-move-submenu{
    position: absolute;
    top: 0;
    left: calc(100% - 4px);
    min-width: 160px;
    max-width: 220px;
    background: var(--bg-history-action-menu);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.6);
    padding: 4px 0;
    display: none;
    z-index: 3100;

    max-height: calc(100vh - 16px);
    overflow-y: auto;
}
.project-image-move-submenu.visible{
    display: block;
}
.project-image-move-btn{
    width: 100%;
}
.move-project-option,
.move-to-images-option,
.move-project-empty{
    width: 100%;
    padding: 8px 12px;
    background: none;
    border: none;
    color: var(--text-history-action-menu-button);
    text-align: left;
    cursor: pointer;
    font-family: 'PingFangHKWeb', sans-serif;
    font-size: 13px;
}
.move-project-option:hover,
.move-to-images-option:hover{
    background: var(--bg-history-action-menu-button-hover);
}
.move-project-option:disabled,
.move-project-empty:disabled{
    opacity: 0.5;
    cursor: default;
}