/*COMMON WINDOW*/

.window {
    display: none;
    position: absolute;
    width: 760px;
    height: 500px;
    top: 60px;
    left: 220px;
    background: #d4d0c8;
    border-top: 2px solid #ffffff;
    border-left: 2px solid #ffffff;
    border-right: 2px solid #404040;
    border-bottom: 2px solid #404040;
    box-shadow: 4px 4px 12px rgba(0, 0, 0, .45);
    overflow: visible;
    z-index: 100;
    flex-direction: column;
}

/*TITLE BAR*/

.title-bar {
    height: 27px;
    background: #1B2689;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 6px;
    user-select: none;
    cursor: move;
}

.title-left {
    display: flex;
    align-items: center;
    gap: 6px;
    color: white;
    font-family: Tahoma, sans-serif;
    font-size: 14px;
    font-weight: bold;
}

.title-left img {
    width: 16px;
    height: 16px;
}

/* TITLE BUTTONS*/

.title-buttons {
    display: flex;
    gap: 2px;
}

.title-btn {
    position: relative;
    display: inline-block;
}

.title-btn button {
    width: 22px;
    height: 20px;
    background: #d4d0c8;
    border-top: 1px solid white;
    border-left: 1px solid white;
    border-right: 1px solid #404040;
    border-bottom: 1px solid #404040;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    padding: 0;
}

.title-btn button:active {
    border-top: 1px solid #404040;
    border-left: 1px solid #404040;
    border-right: 1px solid white;
    border-bottom: 1px solid white;
}

.title-btn button img {
    width: 20px;
    height: 20px;
}

/*TOOLTIP*/

.btn-tooltip {
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #ffffe1;
    color: black;
    border: 1px solid black;
    padding: 2px 6px;
    font-size: 11px;
    font-family: Tahoma, sans-serif;
    white-space: nowrap;
    display: none;
    z-index: 99999;
}

.title-btn:hover .btn-tooltip {
    display: block;
}

/* WINDOW BODY*/

.window-body {
    flex: 1;
    min-height: 0;
    background: #d4d0c8;
    padding: 14px;
    position: relative;
}

/* APP LOADING OVERLAY */

.window-loading-overlay {
    position: absolute;
    inset: 0;
    background: #000000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 14px;
    z-index: 500;
    padding: 20px;
    box-sizing: border-box;
}

.loading-row {
    width: 100%;
    max-width: 380px;
    display: flex;
    justify-content: space-between;
    color: #ffffff;
    font-family: "Consolas", "Courier New", monospace;
    font-weight: bold;
    font-size: 16px;
}

.loading-bar-outer {
    width: 100%;
    max-width: 380px;
    height: 26px;
    border: 2px solid #ffffff;
    background: #000000;
    overflow: hidden;
    box-sizing: border-box;
}

.loading-bar-fill {
    height: 100%;
    width: 0%;
    background: repeating-linear-gradient(
        90deg,
        #ffffff 0px,
        #ffffff 16px,
        #000000 16px,
        #000000 20px
    );
    transition: width 0.35s ease-out;
}

.loading-fade-out {
    animation: loadingFadeOut 0.2s ease-in forwards;
}

@keyframes loadingFadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.window-content {
    width: 100%;
    height: 100%;
    background: #e4e3e1;
    border-top: 2px solid #696666;
    border-left: 2px solid #5e5c5c;
    border-right: 2px solid white;
    border-bottom: 2px solid white;
    padding: 20px;
    overflow: auto;
}

/* STATUS BAR*/

.status-bar {
    height: 22px;
    background: #d4d0c8;
    border-top: 1px solid #808080;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 8px;
    font-family: Tahoma, sans-serif;
    font-size: 12px;
}

/* MAXIMIZE*/

.maximize {
    width: 100% !important;
    height: calc(100vh - 30px) !important;
    left: 0 !important;
    top: 0 !important;
}

/* WINDOWS SCROLLBAR*/


.window-content::-webkit-scrollbar {
    width: 17px;
}

.window-content::-webkit-scrollbar-track {
    background: #d4d0c8;
    border-left: 1px solid #808080;
}

.window-content::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border-top: 2px solid white;
    border-left: 2px solid white;
    border-right: 2px solid #808080;
    border-bottom: 2px solid #808080;
    min-height: 35px;
}

.window-content::-webkit-scrollbar-thumb:hover {
    background: #b8b8b8;
}

.window-content::-webkit-scrollbar-button:single-button {
    height: 17px;
    background: #d4d0c8;
    border-top: 2px solid white;
    border-left: 2px solid white;
    border-right: 2px solid #808080;
    border-bottom: 2px solid #808080;
    background-repeat: no-repeat;
    background-position: center;
}

/*Window Animation*/

.window {
    transform-origin: center;
}

.window-opening {
    animation: winOpen .18s ease-out forwards;
}

.window-closing {
    animation: winClose .15s ease-in forwards;
}

.window-minimize {
    animation: winMinimize .18s ease-in forwards;
}

@keyframes winOpen {

    0% {
        opacity: 0;
        transform: scale(.15);
    }

    70% {
        opacity: 1;
        transform: scale(1.04);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes winClose {

    from {
        opacity: 1;
        transform: scale(1);
    }

    to {
        opacity: 0;
        transform: scale(.15);
    }
}

@keyframes winMinimize {

    from {
        opacity: 1;
        transform: scale(1);
    }

    to {
        opacity: 0;
        transform: scale(.2);
    }
}
