/*
 * Custom login page styling for BIH VM Control Panel
 */

/* Set background image for the entire page */
body {
    background-image: url('../../login-bg.jpg') !important;
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    background-attachment: fixed !important;
    background-color: transparent !important;
}

/* Hide the default noVNC container background when disconnected */
:root:not(.noVNC_connected) #noVNC_container {
    background-color: transparent !important;
    background-image: none !important;
}

/* Also ensure html element doesn't block the background */
html {
    background-color: transparent !important;
    background-image: none !important;
}

/* Make sure body background is visible */
body {
    min-height: 100vh !important;
}

/* Override default panel styles for credentials dialog */
#noVNC_credentials_dlg.noVNC_panel {
    background-color: #ffffff !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
    padding: 40px !important;
    min-width: 400px;
    max-width: 450px;
    border: none !important;
    color: #333333 !important;
    /* Override panel translateX with translateY for centered dialog */
    transform: translateY(-50px) !important;
    max-width: 450px !important;
}

/* Ensure transform works correctly when dialog opens */
#noVNC_credentials_dlg.noVNC_open {
    transform: translateY(0) !important;
    visibility: visible !important;
    opacity: 1 !important;
}

#noVNC_credentials_dlg form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

/* Logo styling */
#noVNC_login_logo {
    text-align: center;
    margin-bottom: 10px;
}

#noVNC_login_logo img {
    max-width: 200px;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Title styling */
#noVNC_login_title {
    text-align: center;
    font-size: 28px;
    font-weight: bold;
    color: #333333;
    margin: 10px 0 30px 0;
    font-family: sans-serif;
}

/* Input field styling */
#noVNC_username_block,
#noVNC_password_block {
    width: 100%;
    margin: 0;
}

#noVNC_username_block label,
#noVNC_password_block label {
    display: none; /* Hide labels since we're using placeholders */
}

#noVNC_username_input,
#noVNC_password_input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    background-color: #ffffff;
    color: #333333;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

#noVNC_username_input:focus,
#noVNC_password_input:focus {
    outline: none;
    border-color: #DA0812;
    box-shadow: 0 0 0 3px rgba(218, 8, 18, 0.1);
}

#noVNC_username_input::placeholder,
#noVNC_password_input::placeholder {
    color: #999999;
}

/* Login button styling with red gradient */
#noVNC_credentials_button {
    width: 100%;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    color: #ffffff;
    cursor: pointer;
    background: linear-gradient(to right, #DA0812, #B8070F);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 12px rgba(218, 8, 18, 0.3);
    margin-top: 10px;
}

#noVNC_credentials_button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(218, 8, 18, 0.4);
}

#noVNC_credentials_button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(218, 8, 18, 0.3);
}

/* Hide the default heading */
#noVNC_credentials_dlg .noVNC_heading {
    display: none;
}

/* Button row styling */
#noVNC_credentials_dlg .button_row {
    width: 100%;
    margin-top: 0;
    justify-content: center;
}

/* Ensure the dialog is properly centered and doesn't use panel slide-in animation */
.noVNC_center #noVNC_credentials_dlg {
    position: relative;
    transform: translateY(-50px) !important;
}

.noVNC_center #noVNC_credentials_dlg.noVNC_open {
    transform: translateY(0) !important;
}

/* Override panel form gap for better spacing */
#noVNC_credentials_dlg form {
    gap: 20px !important;
}

/* Connect dialog styling (the initial dialog that shows first) */
#noVNC_connect_dlg {
    background-color: #ffffff !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
    padding: 40px !important;
    min-width: 400px;
    max-width: 450px;
    border: none !important;
    text-align: center;
}

#noVNC_login_logo_connect {
    text-align: center;
    margin-bottom: 10px;
}

#noVNC_login_logo_connect img {
    max-width: 200px;
    height: auto;
    display: block;
    margin: 0 auto;
}

#noVNC_login_title_connect {
    text-align: center;
    font-size: 28px;
    font-weight: bold;
    color: #333333;
    margin: 10px 0 30px 0;
    font-family: sans-serif;
}

/* Hide the default noVNC logo in connect dialog */
#noVNC_connect_dlg .noVNC_logo {
    display: none !important;
}

/* Style the connect button */
#noVNC_connect_button {
    width: 100% !important;
    padding: 12px 24px !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 18px !important;
    font-weight: bold !important;
    color: #ffffff !important;
    cursor: pointer;
    background: linear-gradient(to right, #DA0812, #B8070F) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 12px rgba(218, 8, 18, 0.3);
    margin-top: 10px;
}

#noVNC_connect_button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(218, 8, 18, 0.4);
}

#noVNC_connect_button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(218, 8, 18, 0.3);
}

#noVNC_connect_dlg div {
    background-color: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
}

/* Hide version display in sidebar */
.noVNC_version_separator,
.noVNC_version_wrapper {
    display: none !important;
}


/* Responsive design for smaller screens */
@media screen and (max-width: 480px) {
    #noVNC_credentials_dlg,
    #noVNC_connect_dlg {
        min-width: calc(100vw - 40px) !important;
        max-width: calc(100vw - 40px) !important;
        padding: 30px 20px !important;
    }
    
    #noVNC_login_logo img,
    #noVNC_login_logo_connect img {
        max-width: 150px;
    }
    
    #noVNC_login_title,
    #noVNC_login_title_connect {
        font-size: 24px;
    }
}
