html {
    font-family: 'Open Sans', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f7f7f7;
    color: #333;
    height: 100%;
    overflow: hidden;
}
body {
    display: flex;
    flex-direction: column;
    height: 100%;
    margin: 0;
}

p {
    background-color: #ffffff;
    padding: 20px;
    border-left: 8px solid #5B5FC7;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    line-height: 1.6;
    font-size: 1.1rem;
    max-width: 600px;
    margin: 10px auto;
}

.auth-options {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.auth-options label {
    margin-left: 10px;
    margin-right: 10px;
    margin-top: 20px;
    margin-bottom: 20px;
}

.button-container {
    max-width: 600px;
    margin: 30px auto;
    text-align: center;
    display: none;
    justify-content: space-between;
    gap: 10px;
}

.styled-button {
    padding: 10px 20px;
    margin: 0 5px;  /* Reduced margin to save space */
    font-size: 1rem;
    color: white;
    background-color: #5B5FC7;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: inline-block;
    /*min-width: 40px;  /* Consistent minimum width */
    white-space: nowrap;  /* Prevent text wrapping inside buttons */
}  

.button-row {
    display: inline-block;
    width: 100%;
    text-align: left;
}

.button-row .styled-button {
    display: inline-block;
    margin-right: 10px;
}

.styled-button:hover {
    background-color: #484FB0;
}

.styled-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}


#error, #unauthorized, #start, #stop, #signinreqired {
    display: none;
    border-left: 8px solid #ff0000;
}

#open {
    display: none;
    border-left: 8px solid #008000;
}

#start {
    border-left-color: #008000;
}

#xrai-iframe {
    position: absolute;  /* Change to absolute for precise positioning */
    top: 0;
    left: 0;
    width: 100%;  /* Base width before scaling */
    height: 100%;  /* Base height before scaling */
    border: none;
    display: none;  /* Assuming this is toggled via JS */
    transform-origin: 0 0;  /* Anchor scaling to top-left to fix positioning */
    transform: scale(1);  /* Initial scale */
}

#loadingIndicator {
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    height: 95%;
    text-align: center;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top: 4px solid #5B5FC7;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.waiting-text {
    padding: 20px 30px;
    background-color: #f0f0f0;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
    color: #333;
    font-size: 1.2rem;
    font-weight: 600;
    display: inline-block;
}

.waiting-text span {
    font-weight: 400;
    color: #5B5FC7;
}

.overlay-image {
    position: absolute;
    top: 5px;
    right: 5px;
    z-index: 999;
    height: 20px;
}

.iframe-container {
    flex: 1;  /* Keeps filling remaining height */
    position: relative;  /* Already set, good for containing absolute children */
    width: 100%;
    overflow: hidden;  /* Retain to clip overflow */
    background: #fff;
}

#save {
    border-left: 8px solid #008000;
}

#signInButton {
    margin-top: 10px;
}

#connect, #signInButton, #save, #getready, #authContainer, #forceSigninGroup, #iframe-container {
    display: none;
}

/* Remove ALL focus outlines and borders - AGGRESSIVE FIX */
*, *:focus, *:active, *:visited, button, button:focus, button:active, input, input:focus, input:active, div, div:focus, p, p:focus, h1, h2, h3, h4, h5, h6 {
    outline: none !important;
    box-shadow: none !important;
}

/* Connect container - MORE COMPACT VERSION */
.connect-container {
    background-color: #ffffff !important;
    padding: 10px !important;
    border-radius: 4px !important;
    line-height: 1.3 !important;
    font-size: 0.9rem !important;
    max-width: 600px !important;
    margin: 8px auto !important;
    border-top: none !important;
    border-right: none !important;
    border-bottom: none !important;
}

.connect-header {
    text-align: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.connect-header h2 {
    margin: 0 !important;
    color: #333 !important;
    font-size: 1.2rem !important;
    font-weight: 600 !important;
    background: none !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}

/* REMOVE THE SUBTITLE TO SAVE SPACE */
.connect-subtitle {
    display: none !important;
}

.connect-steps {
    margin: 12px 0;
}

.connect-step {
    background: #f8f9ff;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 6px;
    border-left: 3px solid #5B5FC7;
    border-top: none;
    border-right: none;
    border-bottom: none;
}

.step-header {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
}

.step-num {
    background: #5B5FC7;
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-right: 10px;
    flex-shrink: 0;
    font-size: 0.85rem;
    border: none;
}

.step-header h3 {
    margin: 0 !important;
    color: #333 !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    background: none !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}

.connect-step p {
    margin: 6px 0 !important;
    color: #666 !important;
    background: none !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    font-size: 0.85rem !important;
    line-height: 1.3 !important;
    outline: none !important;
}

.download-btn {
    background: #5B5FC7 !important;
    color: white !important;
    border: none !important;
    padding: 8px 16px !important;
    border-radius: 4px !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: background-color 0.3s ease !important;
    margin: 6px 0 !important;
    outline: none !important;
    box-shadow: none !important;
}

.download-btn:hover {
    background: #484FB0 !important;
}

.download-btn:focus, .download-btn:active {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

.tip {
    background: #e8f4fd;
    padding: 6px 8px;
    border-radius: 4px;
    margin-top: 6px;
    color: #555;
    font-size: 0.8rem;
    border-top: none;
    border-right: none;
    border-bottom: none;
}

/* REMOVE FEATURES TO SAVE SPACE */
.connect-features {
    display: none !important;
}

#organizer-controls {
    flex: 0 0 auto;  /* Buttons take fixed space */
    display: flex;
    justify-content: center;
    align-items: center;  /* Vertically center buttons */
    padding: 10px;
    flex-wrap: nowrap;  /* Prevent buttons from wrapping to new lines */
    overflow-x: auto;   /* Allow horizontal scrolling if too many buttons */
    white-space: nowrap;  /* Ensure inline elements don't wrap */
    border-bottom: 0.1rem solid rgb(224, 224, 224);
}

#zoomIn, #zoomOut {
    font-size: 1.2rem; /* Larger icons */
    padding: 8px 12px; /* Compact sizing */
}
.scaled-iframe {
position: absolute;
top: 0;
left: 0;
border: none;
transform-origin: 0 0;
transition: transform 0.3s ease;
}

.signin-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: nowrap;  /* Prevent wrapping */
    padding: 10px;
    overflow-x: auto;
    border-bottom: 0.1rem solid rgb(224, 224, 224);
}