/* Frameless BITB — Windows/Edge Chrome Styles */

#pop-window {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #fff;
    border-radius: 8px;
    border: 1px solid #ccc;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    width: 480px;
    max-width: 95vw;
    height: 600px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    isolation: isolate;
    contain: layout style;
    will-change: left, top, width, height, transform, opacity;
    transition: width 0.2s ease, height 0.2s ease, border-radius 0.2s ease;
    transform-origin: center center;
}

#pop-window.hidden {
    display: none !important;
}

#pop-window.dragging {
    transition: none;
    cursor: move;
    user-select: none;
    -webkit-user-select: none;
}

/* ── Open animation: window "opens up" for login ─────────── */
@keyframes popupOpen {
    0% {
        transform: translate(-50%, -50%) scale(0.08);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

#pop-window.opening {
    animation: popupOpen 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

#pop-background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    background: transparent;
    pointer-events: none;
}

#primary {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 500;
}

#primary iframe {
    width: 100%;
    height: 100%;
    border: none;
}

#pop-head {
    background: #fff;
    border-radius: 8px 8px 0 0;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
    user-select: none;
    -webkit-user-select: none;
}

#pop-title-bar, .pop-title-bar {
    background: #f0f0f0;
    height: 36px;
    display: flex;
    align-items: center;
    padding: 0 8px 0 12px;
    border-radius: 8px 8px 0 0;
    cursor: move;
}

#pop-logo {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    pointer-events: none;
}

#pop-title-text {
    font-size: 12px;
    color: #222;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}

.pop-control-btns {
    display: flex;
    gap: 0;
}

#pop-control-min,
#pop-control-max,
#pop-control-esc {
    width: 36px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 4px;
}

#pop-control-min:hover,
#pop-control-max:hover {
    background: #d8d8d8;
}

#pop-control-esc:hover {
    background: #e81123;
}

#pop-control-min img,
#pop-control-max img,
#pop-control-esc img {
    width: 11px;
    height: 11px;
    pointer-events: none;
}

#pop-uri-bar {
    background: #f5f5f5;
    height: 34px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    gap: 0;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    cursor: default;
}

#pop-ssl-icon {
    cursor: pointer;
    margin-right: 8px;
    flex-shrink: 0;
}

#pop-ssl-icon img {
    display: block;
}

#pop-uri-prefix {
    font-size: 12px;
    color: #888;
    pointer-events: none;
}

#pop-uri-host {
    font-size: 12px;
    color: #222;
    cursor: pointer;
}

#pop-uri-path {
    font-size: 12px;
    color: #888;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}

#pop-ssl {
    position: absolute;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    z-index: 10001;
    width: 340px;
    border: 1px solid #ddd;
    display: none;
}

#pop-ssl-container {
    padding: 0;
}

#pop-ssl-head {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
}

#pop-ssl-head-title {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: #222;
}

#pop-ssl-head-esc {
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
}

#pop-ssl-head-esc:hover {
    background: #f0f0f0;
}

#pop-ssl-body {
    padding: 8px 16px;
}

.pop-ssl-row {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f5f5f5;
}

.pop-ssl-row:last-child {
    border-bottom: none;
}

.pop-ssl-row-left {
    display: flex;
    align-items: center;
    flex: 1;
}

.pop-ssl-row-pre {
    width: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pop-ssl-row-text {
    font-size: 12px;
    color: #333;
}

.pop-ssl-row-post {
    width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Content container */
#pop-content-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    background: #fff;
    border-radius: 0 0 8px 8px;
    position: relative;
    z-index: 0;
}

#pop-content-container > div:first-child {
    display: block !important;
    min-height: 100%;
}

/* Maximized state */
#pop-window.maximized {
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    top: 0 !important;
    left: 0 !important;
    transform: none !important;
    border-radius: 0 !important;
}

#pop-window.maximized #pop-head,
#pop-window.maximized #pop-title-bar {
    border-radius: 0 !important;
}

#pop-window.maximized #pop-content-container {
    border-radius: 0 !important;
}

#pop-window.maximized #pop-title-bar {
    cursor: default;
}

/* Mobile */
@media (max-width: 520px) {
    #pop-window {
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        max-height: 100vh;
        top: 0;
        left: 0;
        transform: none;
        border-radius: 0;
    }
    #pop-window.opening {
        animation: none;
    }
}




