:root {
    --shadowColor: hsla(0, 0%, 0%, 0.08);
}

body {
    font-family: Roboto;
    background: #ffffff;
    color: rgba(0, 0, 0, 0.6);
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

form {
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
    border-radius: 5px;
    width: 600px;
    margin: 0 auto;
    padding: 2em 1.5em;
    background: white;
    margin-top: 20px;
}

label,
p {
    text-align: center;
    display: block;
    padding-bottom: 1em;
    margin-bottom: 1em;
    font-weight: bold;
    box-shadow: 0 3px 2px -2px var(--shadowColor);
}

label {
    font-size: 1.2em;
}

p {
    font-size: 2em;
}

input,
select,
button {
    width: 100%;
    border-radius: 5px;
    box-shadow: inset 0 2px 4px 0 var(--shadowColor);
    font-size: 14px;
    padding: 0.8em 1em;
    box-sizing: border-box;
    border: 1px solid var(--shadowColor);
    margin-bottom: 1em;
    outline: 0;
}

select {
    font-family: Roboto;
    width: min-content;
}

button {
    color: white;
    background: #27315d;
    font-size: 1em;
}

.preview {
    position: relative;
}

.preview img {
    max-width: 100%;
}

.preview p {
    position: absolute;
    background: white;
    left: 5px;
    top: 5px;
}

.table-container {
    margin-top: 2em;
    overflow-x: auto;
    width: 800px;
}

.bg-primary {
    background: #27315d !important;
    color: white;
}

#loader,
.table-container,
.json-result-container {
    display: none;
}

.text-primary,
#result {
    color: #27315d !important;
}

#result {
    margin-top: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
}

.json-result-container {
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
    border-radius: 5px;
    width: 600px;
    margin: 20px;
    padding: 2em 1.5em;
    background: white;
}

header {
    background: #ffffff;
    color: rgba(38, 48, 93, 0.75);
    padding: 1em;
    text-align: center;
    font-size: 16px;
    margin-bottom: 1em;
    font-weight: 400;
    width: 100%;
    height: 84px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding-left: 24px;
    padding-right: 24px;
    z-index: 999;
}

header img {
    max-height: 60px;
    width: auto;
}

header a,
a {
    color: rgba(38, 48, 93, 0.75);
    text-decoration: none;
    font-size: 16.5px;
}

a:hover {
    text-decoration: none;
}

nav {
    display: flex;
    flex: 1;
    justify-content: flex-start;
    align-items: center;
}

nav ul {
    list-style: none;
    display: flex;
    padding: 0;
    margin: 0;
    margin-bottom: 0 !important;
    justify-content: center;
    align-items: center;
}

nav ul li {
    padding: 12px;
}

.separador {
    width: 100%;
    margin-top: 10px;
}

.header-space {
    height: 85px;
    width: 100%;
}

.div-process {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-top: 20px;
    width: 100%;
    gap: 10px;
}

.btn-process {
    background: #27315d;
    color: white;
    padding: 0.8em 1em;
    border-radius: 5px;
    font-size: 1em;
    margin-top: 20px;
    width: 20%;
    border: none;
}

.btn-process:hover {
    background: #46538f;
    color: white;
}

.modal-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
}

.disabled-button {
    background-color: #dcdcdc;
    color: #6c757d;
    cursor: not-allowed;
    border: 1px solid #dcdcdc;
    border-radius: 4px;
    padding: 8px 16px;
    font-size: 16px;
    pointer-events: none;
}

.disabled-button:hover {
    background-color: #dcdcdc;
    color: #6c757d;
}

.check-circle {
    color: green !important;
}

.cross-circle {
    color: gray !important;
}

.audio-report-iframe {
    min-width: 80vw;
    height: 110vh;
    border: none;
}

.refresh-button {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.8em 1em;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    margin-top: 20px;
}

.logo-nav {
    display: flex;
    align-items: center;
    width: 200px;
    margin-right: 20px;
    min-width: 200px;
}

.logo-nav img {
    width: 200px;
    height: auto;
    margin: 0;
    object-fit: contain;
}

#logout {
    margin: 0;
}

.prompt-logo {
    width: 200px;
    height: auto;
    margin-left: auto;
    margin-right: 0;
    object-fit: contain;
}

@media (max-width: 992px) {
    .prompt-logo {
        width: 180px;
    }

    .logo-nav {
        width: 180px;
        min-width: 180px;
    }

    .logo-nav img {
        width: 180px;
    }
}

@media (max-width: 768px) {
    .prompt-logo {
        width: 150px;
    }

    .logo-nav {
        width: 150px;
        min-width: 150px;
    }

    .logo-nav img {
        width: 150px;
    }
}

/* --- Dark Mode Overrides --- */
body.dark-mode {
    background: #0f1115;
    color: rgba(255, 255, 255, 0.88);
}

body.dark-mode header {
    background: #0f1115;
    color: rgba(255, 255, 255, 0.88);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset;
}

body.dark-mode header a,
body.dark-mode a {
    color: rgba(255, 255, 255, 0.88);
}

/* Make logos readable on dark header */
body.dark-mode header .logo-nav img,
body.dark-mode header .prompt-logo {
    /* Convert dark logos to light while keeping relative colors */
    filter: invert(1) hue-rotate(180deg) brightness(1.1) contrast(1.05);
}

body.dark-mode form,
body.dark-mode .json-result-container,
body.dark-mode .settings-card {
    background: #161a22;
    color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06),
        0 8px 24px rgba(0, 0, 0, 0.5);
}

body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
    background: #0f1115;
    color: rgba(255, 255, 255, 0.92);
    border-color: rgba(255, 255, 255, 0.12);
}

body.dark-mode button {
    color: #fff;
}

/* Avatar Studio: improve button contrast in dark mode */
body.dark-mode .avatar-button {
    /* keep existing background from page-specific styles */
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.18);
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.6);
}

body.dark-mode .avatar-button:hover {
    filter: brightness(1.06);
}

body.dark-mode .avatar-button:focus {
    outline: 2px solid rgba(255, 255, 255, 0.4);
    outline-offset: 2px;
}

/* Disabled buttons in dark mode: ensure sufficient contrast */
body.dark-mode .disabled-button,
body.dark-mode .avatar-button.disabled-button {
    background-color: #2a2f3a !important;
    color: rgba(255, 255, 255, 0.7) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
}

body.dark-mode .table,
body.dark-mode .table-bordered {
    color: rgba(255, 255, 255, 0.9);
}

body.dark-mode .table thead tr {
    background: #1b2130;
}

body.dark-mode .table-bordered td,
body.dark-mode .table-bordered th {
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .nav-tabs .nav-link {
    color: rgba(255, 255, 255, 0.8);
}

body.dark-mode .nav-tabs .nav-link.active {
    background-color: #161a22;
    border-color: rgba(255, 255, 255, 0.1) rgba(255, 255, 255, 0.1) #161a22;
}

/* Assistants page: ensure chat backgrounds are dark in dark mode */
body.dark-mode .examples-container {
    background: #121621;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06),
        0 8px 24px rgba(0, 0, 0, 0.45);
    border-radius: 8px;
}

body.dark-mode .chatQuestion {
    background-color: #1b2130; /* override light #f1f0f0 */
    color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
}

body.dark-mode .chatbot-container h4,
body.dark-mode #modelDescription,
body.dark-mode .examples-container span,
body.dark-mode .examples-container label {
    color: rgba(255, 255, 255, 0.9);
}
body.dark-mode .chatQuestionTitle {
    color: rgba(255, 255, 255, 0.92);
}
