/* @font-face rules removed as they are now in separate, linked CSS files */
/* Initial Dark Mode styles to prevent FOUC */
html.dark-mode-initial,
:root[data-color-scheme="dark"] {
    background-color: #1e1e1e !important; /* Ensure html root also gets dark background */
}
html.dark-mode-initial body,
:root[data-color-scheme="dark"] body {
    background-color: #1e1e1e !important; /* Match body.dark-mode from client.css, !important to override client.css body default */
    color: #cccccc !important; /* Match body.dark-mode from client.css, !important to override client.css body default */
}

/*
   The existing body.dark-mode styles will further refine the theme
   once the main JavaScript applies the class to the body.
   The html.dark-mode-initial is for the very first paint.
*/

/* Apply dark mode styles to loading screen elements immediately if dark-mode-initial is set */
html.dark-mode-initial #background-logo-container .middle-content,
:root[data-color-scheme="dark"] #background-logo-container .middle-content {
    box-shadow: 0px 4px 122.1px rgba(92, 92, 92, 0.76);
    background: transparent; /* Ensure no light default background is shown */
}

html.dark-mode-initial #background-logo-container .animated-logo-container,
:root[data-color-scheme="dark"] #background-logo-container .animated-logo-container {
    box-shadow: 0px 0px calc(43.2px * 0.65) rgba(94, 94, 94, 0.6);
    background: transparent;
}

html.dark-mode-initial #background-logo-container .custom-title-style,
:root[data-color-scheme="dark"] #background-logo-container .custom-title-style {
    color: #57effd;
    background-image: linear-gradient(to right, rgba(24, 236, 255, 0.15), rgba(24, 236, 255, 0.15));
}

html.dark-mode-initial #background-logo-container .custom-paragraph-container-style,
:root[data-color-scheme="dark"] #background-logo-container .custom-paragraph-container-style {
    background-color: rgba(115, 128, 132, 0.08);
}

html.dark-mode-initial #background-logo-container .custom-paragraph-text-style,
:root[data-color-scheme="dark"] #background-logo-container .custom-paragraph-text-style {
    color: #93a0a0;
}

/* Background logo container styles */
#background-logo-container {
    background-color: transparent; /* Show body background */
    position: fixed; /* Ensure it covers the whole screen */
    inset: 0;
    z-index: 3; /* Above the body's dark mode overlays */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100vh;
    padding-top: 60px; /* Space if a fixed header was present, adjust as needed */
    box-sizing: border-box;
    pointer-events: none; /* Don't interfere with interactions */
}

#background-logo-container .middle-content {
    width: calc(661px * 0.65);
    height: calc(660px * 0.65);
    background: none; /* Default, overridden by dark/light mode specifics */
    box-shadow: 0px 4px 122.1px rgba(0, 0, 0, 0.76); /* Default shadow, overridden */
    position: relative;
    box-sizing: border-box;
}

body:not(.dark-mode) #background-logo-container .middle-content {
    background: linear-gradient(138.61deg, rgba(255, 255, 255, 0) 10.35%, rgba(87, 87, 87, 0.1) 92.49%);
    box-shadow: 0px 4px 122.1px rgba(255, 255, 255, 0.76);
}

body.dark-mode #background-logo-container .middle-content,
:root[data-color-scheme="dark"] #background-logo-container .middle-content {
    box-shadow: 0px 4px 122.1px rgba(92, 92, 92, 0.76);
}

#background-logo-container .animated-logo-container {
    width: calc(581px * 0.65);
    height: calc(581px * 0.65);
    background: none; /* Default, overridden */
    box-shadow: 0px 0px calc(43.2px * 0.65) rgba(255, 255, 255, 0.6); /* Default, overridden */
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-sizing: border-box;
}

body:not(.dark-mode) #background-logo-container .animated-logo-container {
    background: linear-gradient(138.61deg, rgba(0, 0, 0, 0) 10.35%, rgba(49, 49, 49, 0.18) 92.49%);
}

body.dark-mode #background-logo-container .animated-logo-container,
:root[data-color-scheme="dark"] #background-logo-container .animated-logo-container {
    box-shadow: 0px 0px calc(43.2px * 0.65) rgba(94, 94, 94, 0.6);
    background: transparent; /* Explicitly transparent for dark mode if needed */
}

#background-logo-container .animated-logo-container img {
    max-width: 90%;
    max-height: 90%;
    box-shadow: 0px 8px 32px rgba(0, 0, 0, 0.3);
}

#background-logo-container .info-section {
    margin-top: 30px;
    text-align: center;
    width: 1024px; /* Increased by 50% from 600px */
    box-sizing: border-box;
    /* Visibility controlled by JS - shown during loading, hidden after */
}

#background-logo-container .custom-title-style {
    color: #404F51;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    font-family: 'Oxanium', sans-serif;
    font-size: 38px;
    font-weight: 600;
    line-height: 1.25;
    margin-bottom: 15px;
    display: inline-block;
    background-repeat: no-repeat;
    background-position: left center;
    background-size: 100% 100%; /* Start fully highlighted, or animate with JS */
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
    white-space: pre-wrap;
    background-color: transparent;
    background-image: linear-gradient(to right, rgba(24, 236, 255, 0.25), rgba(24, 236, 255, 0.25));
    /* animation: highlight-reveal 0.6s ease-out 0.4s forwards; /* If JS handles timing, remove animation */
}

body.dark-mode #background-logo-container .custom-title-style,
:root[data-color-scheme="dark"] #background-logo-container .custom-title-style {
    color: #57effd;
    background-image: linear-gradient(to right, rgba(24, 236, 255, 0.15), rgba(24, 236, 255, 0.15));
}

/* @keyframes highlight-reveal {
    from { background-size: 0% 100%; }
    to { background-size: 100% 100%; }
} */

#background-logo-container .custom-paragraph-container-style {
    padding: 0.75rem; /* 12px */
    background-color: rgba(115, 128, 132, 0.25);
    border-radius: 0;
    border: 0;
    box-shadow: none;
    width: 100%;
    margin: 20px auto 0 auto;
    box-sizing: border-box;
}

body.dark-mode #background-logo-container .custom-paragraph-container-style,
:root[data-color-scheme="dark"] #background-logo-container .custom-paragraph-container-style {
    background-color: rgba(115, 128, 132, 0.08);
}

#background-logo-container .custom-paragraph-text-style {
    color: #f0f0f0; /* Default light text, overridden by dark mode */
    font-family: 'Ubuntu', sans-serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 25px;
    margin: 0;
    padding: 0;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

body:not(.dark-mode) #background-logo-container .custom-paragraph-text-style {
    color: #333; /* Darker text for light mode paragraph */
}
body.dark-mode #background-logo-container .custom-paragraph-text-style,
:root[data-color-scheme="dark"] #background-logo-container .custom-paragraph-text-style {
    color: #93a0a0;
}


/* Responsive Styles for background logo */
@media (max-width: 768px) {
    #background-logo-container .middle-content {
        transform: scale(0.7);
    }
    #background-logo-container .info-section {
        width: 95% !important;
        max-width: 400px !important;
        margin-top: -34px !important; /* Adjusted for scaled middle-content */
        padding: 0 10px !important;
    }
    #background-logo-container .custom-paragraph-container-style {
        margin: 15px 0 0 0 !important;
        padding: 0.5rem !important;
    }
    #background-logo-container .custom-title-style {
        font-size: 24px !important;
        margin-bottom: 8px !important;
        padding-left: 0.25rem !important;
        padding-right: 0.25rem !important;
    }
    #background-logo-container .custom-paragraph-text-style {
        font-size: 14px !important;
        line-height: 20px !important;
    }
}

@media (max-width: 480px) {
    #background-logo-container {
        justify-content: flex-start;
        padding-top: 20px; /* Reduced padding for very small screens */
    }
    #background-logo-container .middle-content {
        transform: scale(0.5);
    }
    #background-logo-container .info-section {
        margin-top: -77px !important; /* Adjusted for more aggressive scaling */
    }
}

@media (max-width: 599px) and (max-height: 699px) {
    #background-logo-container {
        justify-content: flex-start;
        padding-top: 20px;
    }
    #background-logo-container .middle-content {
        transform: scale(0.5);
        margin-top: -70px; /* Specific pull-up for very small, short screens */
    }
    #background-logo-container .info-section {
        margin-top: -77px !important;
    }
}

/* Hide old progress indicator */
#progress {
    display: none !important;
}

/* Terminal quick access (shown when no windows are running) */
#terminal_quick_access.terminal-quick-access {
    position: fixed;
    left: 50%;
    bottom: calc(24px + var(--tqa-keyboard-offset, 0px));
    transform: translateX(-50%);
    width: min(920px, calc(100vw - 24px));
    z-index: 9999; /* below connection/terminal modals, above background */
    pointer-events: none; /* enable on card only */
}

#terminal_quick_access .terminal-quick-access-card {
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.10);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.64));
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(14px) saturate(120%);
    -webkit-backdrop-filter: blur(14px) saturate(120%);
    animation: tqa-enter 220ms ease-out;
}

body.dark-mode #terminal_quick_access .terminal-quick-access-card,
html.dark-mode-initial #terminal_quick_access .terminal-quick-access-card,
:root[data-color-scheme="dark"] #terminal_quick_access .terminal-quick-access-card {
    border-color: rgba(255, 255, 255, 0.14);
    background: linear-gradient(135deg, rgba(18, 20, 22, 0.76), rgba(18, 20, 22, 0.58));
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.56);
}

#terminal_quick_access .terminal-quick-access-title {
    font-family: 'Oxanium', sans-serif;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.2px;
    color: #152224;
}

body.dark-mode #terminal_quick_access .terminal-quick-access-title,
html.dark-mode-initial #terminal_quick_access .terminal-quick-access-title,
:root[data-color-scheme="dark"] #terminal_quick_access .terminal-quick-access-title {
    color: #c9f7fb;
}

#terminal_quick_access .terminal-quick-access-subtitle {
    margin-top: 2px;
    font-family: 'Ubuntu', sans-serif;
    font-size: 13px;
    line-height: 1.35;
    color: rgba(21, 34, 36, 0.78);
}

body.dark-mode #terminal_quick_access .terminal-quick-access-subtitle,
html.dark-mode-initial #terminal_quick_access .terminal-quick-access-subtitle,
:root[data-color-scheme="dark"] #terminal_quick_access .terminal-quick-access-subtitle {
    color: rgba(201, 247, 251, 0.78);
}

#terminal_quick_access .terminal-quick-access-actions {
    flex-shrink: 0;
}

#terminal_quick_access .terminal-quick-access-button {
    border: 0;
    border-radius: 14px;
    padding: 10px 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: 'Oxanium', sans-serif;
    font-weight: 800;
    font-size: 14px;
    letter-spacing: 0.2px;
    color: #00363b;
    background: linear-gradient(90deg, rgba(24, 236, 255, 0.92), rgba(24, 236, 255, 0.55));
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
    transition: transform 140ms ease, filter 140ms ease, box-shadow 140ms ease;
}

#terminal_quick_access .terminal-quick-access-button:hover {
    transform: translateY(-1px);
    filter: brightness(1.02);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
}

#terminal_quick_access .terminal-quick-access-button:active {
    transform: translateY(0px);
    filter: brightness(0.98);
}

#terminal_quick_access .terminal-quick-access-button:focus-visible {
    outline: 3px solid rgba(24, 236, 255, 0.55);
    outline-offset: 3px;
}

#terminal_quick_access .terminal-quick-access-icon[data-icon]:before {
    width: 22px;
    height: 22px;
    line-height: 22px;
    font-size: 22px;
    color: currentColor;
}

@keyframes tqa-enter {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0px);
    }
}

@media (max-width: 560px) {
    #terminal_quick_access .terminal-quick-access-card {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    #terminal_quick_access .terminal-quick-access-button {
        width: 100%;
        justify-content: center;
    }
}
