@import "colors.css";

.home-title {
    color: var(--primary-orange);
    width: fit-content;
    padding: 5px 10px;
    border-radius: 5px;
}

.home-title~subtitle {
    color: var(--secondary-gray);
    margin-left: 0.9rem;
}

subtitle.small {
    font-size: 0.9rem;
    color: var(--secondary-gray);
    margin-bottom: 1rem;
}

div.logo-organisation {
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    height: 10vh;
    opacity: 0.4;
    margin: auto;
}

h3.home-title {
    margin: auto;
    text-align: center;
}

/******************************************************
    Authentication
******************************************************/

.password-field {
    position: relative;
}

.password-field .toggle-password {
    position: absolute;
    right: .75rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
    line-height: 0;
}

.password-field .toggle-password svg {
    width: 20px;
    height: 20px;
}

/******************************************************
    Sidebar
******************************************************/

.sidebar {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
    border-right: 2px solid var(--navbar-color);
    position: fixed;
    z-index: 2;
    height: calc(100vh - var(--navbar-height) - 40px);
    width: 15%;
    overflow-y: auto;
    align-self: flex-start;
    background-color: var(--white);
}

.sidebar-btn {
    background-color: var(--white);
    border: none;
    border-radius: 10px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: normal;
    flex-wrap: wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.sidebar-btn:hover,
.sidebar-btn:disabled {
    text-decoration: underline;
}

.sidebar-btn.active {
    color: var(--primary-orange);
    background-color: var(--white);
}

.sidebar-btn img {
    width: 20px;
    height: 20px;
    margin-right: 15px;
    flex-shrink: 0;
}

.sidebar-dropdown {
    width: 100%;
}

.sidebar-dropdown .dropdown-menu {
    width: max-content;
    min-width: 100%;
    white-space: nowrap;
}

.sidebar-label {
    flex: 1;
    min-width: 0;
}

@media (max-width: 768px) {
    .sidebar {
        position: static;
        height: auto;
        border-right: none;
        border-bottom: 2px solid var(--navbar-color);
        padding-bottom: 20px;
        margin-bottom: 20px;
        align-items: center;
        overflow: visible;
    }

    .sidebar .list-group {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 12px;
        align-items: center;
    }

    .sidebar-btn {
        flex: 0 0 auto;
        width: 48px;
        height: 48px;
        padding: 12px;
        margin-bottom: 0;
        justify-content: center;
        text-align: center;
    }

    .sidebar-btn img {
        margin-right: 0;
    }

    .sidebar-dropdown {
        width: auto;
    }

    .sidebar-label,
    .sidebar-dropdown .sidebar-label {
        display: none !important;
    }

    .sidebar-dropdown .sidebar-btn {
        width: 48px;
        height: 48px;
        padding: 12px;
        justify-content: center;
    }
}

.dropdown-toggle {
    text-align: left;
    width: 100%;
    background-color: var(--navbar-color);
    color: var(--primary-gray);
    border-radius: 10px;
    padding: 10px 15px;
    font-size: 16px;
}

.dropdown-toggle:hover {
    background-color: var(--navbar-color);
    text-decoration: underline;
}

.dropdown-menu {
    border-radius: 5px;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    z-index: 1000;
}

.dropdown-menu.show {
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

.dropdown-menu .dropdown-item {
    color: var(--primary-gray);
}

.dropdown-menu .dropdown-item:hover {
    text-decoration: underline;
    background-color: none;
}

/******************************************************
    Cards
******************************************************/

.card {
    position: relative;
    transition: transform 0.2s ease-in-out;
    background-color: var(--white);
    border: none;
    border-radius: 1.5rem;
    width: 50%;
    height: 25vh;
    transition: all 0.3s ease-in-out;
}

.card-blocked {
    position: relative;
    background-color: var(--white);
    border: none;
    border-radius: 1.5rem;
    width: 50%;
    height: 25vh;
    transition: all 0.3s ease-in-out;
}

.card img,
.card-blocked img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 1.5rem;
    transition: all 0.3s ease-in-out;
    filter: brightness(0.7);
}

.card-blocked img {
    filter: brightness(0.5);
}

.card-blocked .lock {
    position: absolute;
    top: 5%;
    right: 5%;
    z-index: 1;
    width: 50px;
    height: 50px;
}

.card-blocked .lock.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0% {
        transform: rotate(0deg);
    }

    20% {
        transform: rotate(-10deg);
    }

    40% {
        transform: rotate(10deg);
    }

    60% {
        transform: rotate(-10deg);
    }

    80% {
        transform: rotate(10deg);
    }

    100% {
        transform: rotate(0deg);
    }
}

.card .card-title,
.card-blocked .card-title {
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 1;
    margin: 20px;
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--bg-color);
    transition: all 0.3s ease-in-out;
}

.card-blocked .card-title {
    color: var(--secondary-gray);
}

.card .card-subtitle,
.card-blocked .card-subtitle {
    color: var(--white);
    font-size: 1rem;
    font-weight: normal;
}

.card-blocked .card-subtitle {
    color: var(--secondary-gray);
}

.card:hover {
    cursor: pointer;
}

.card:hover>img {
    filter: blur(2px);
    opacity: 0.7;
}

.card:hover .card-title {
    color: var(--primary-orange);
}

.card:hover .card-subtitle {
    color: var(--secondary-orange);
}

.card-title {
    font-size: 1.1rem;
    font-weight: bold;
}

a.home-card {
    text-decoration: none;
}

.modal-title {
    font-family: monospace;
    font-variant-caps: all-small-caps;
    color: var(--primary-orange);
}

/******************************************************
    Generation form
******************************************************/

.form-container {
    padding-right: 0.5rem;
    padding-left: 0.5rem;
    background-color: var(--navbar-color);
    border-radius: 10px;
    margin-top: 5px;
    margin-right: 5px;
    margin-left: -20px;
    margin-bottom: 5px;
    overflow: auto;
}

header.document-type {
    width: 100%;
    font-weight: 500;
    font-size: 1.4rem;
    margin: 1vh 0;
    color: var(--primary-gray);
}

textarea {
    resize: none;
    height: 5rem;
}

input[type="text"]:disabled,
input[type="date"]:disabled,
select:disabled,
textarea:disabled {
    color: var(--secondary-gray);
    background-color: var(--navbar-soft);
}

input[type="text"]::placeholder,
input[type="number"]::placeholder,
input[type="date"]::placeholder,
textarea::placeholder,
select option,
select:has(option:checked[value=""]) {
    color: var(--secondary-gray);
    font-style: italic;
}

label.form-label {
    font-weight: bold;
    margin-right: 2rem;
    color: var(--primary-gray);
}

input[type="text"]::placeholder,
input[type="date"]::placeholder,
select::placeholder {
    color: var(--secondary-gray);
}

input[type="text"]:focus,
input[type="date"]:focus,
select:focus {
    border-color: var(--primary-orange);
    outline: none;
}

.search-input-container {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 0;
}

.clear-search {
    position: absolute;
    right: 5%;
    color: var(--primary-orange);
    cursor: pointer;
    z-index: 2;
}

.search-input {
    width: 100% !important;
    padding-right: 60px !important;
    padding-left: 10px !important;
    overflow: hidden !important;
    float: left;
}

.checkbox-list {
    position: absolute;
    top: 5px;
    z-index: 1;
    width: 95%;
    margin-top: 48px;
    padding: 0 10px;
    max-height: 30vh;
    overflow-y: auto;
    overflow-x: hidden;
    border: 2px solid var(--navbar-color);
    background-color: var(--white);
}

/* Checkbox */
.checkbox-list input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

/* Create a custom checkbox */
.custom-checkbox {
    position: relative;
    display: block;
    padding-left: 35px;
    cursor: pointer;
    border-bottom: 1px solid var(--navbar-color);
}

.custom-checkbox:hover {
    background-color: var(--navbar-soft);
}

#lotes-formset {
    display: none;
    flex-direction: row;
    gap: 5px;
}

#lotes-desc-list {
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 20vh;
}

#lotes-formset textarea {
    resize: none;
    height: 4rem;
    width: 90%;
    margin: 5px 0;
}

/******************************************************
    Results page
******************************************************/

#loading-steps {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 60%;
    transition: transform 0.5s;
}

#loading-steps .step {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background-color: var(--bg-color);
    color: var(--secondary-gray);
    border: 2px solid var(--secondary-gray);
    border-radius: 10px;
    padding: 10px 40px;
    margin: 0.5em 0;
    transition: opacity 0.5s;
    opacity: 1;
}

#loading-steps .step .stepNum {
    position: absolute;
    left: -1em;
    background-color: var(--bg-color);
    color: var(--secondary-gray);
    border: 2px solid var(--secondary-gray);
    border-radius: 20px;
    padding: 5px 13px;
    font-weight: bold;
}

#loading-steps .stepLink {
    position: absolute;
    right: -1em;
    bottom: -2em;
    width: 1em;
    height: 3em;
    border: 2px solid var(--secondary-gray);
    border-left: 0px;
    border-radius: 0 20px 20px 0;
    font-weight: bold;
}

#loading-steps .step:last-child {
    background: linear-gradient(270deg, var(--secondary-orange), var(--white));
    background-size: 400% 400%;
    animation: gradientAnimation 2s ease infinite;
    border: 2px solid var(--secondary-orange);
}

#loading-steps .step:last-child .stepNum {
    color: var(--secondary-orange);
    border: 2px solid var(--secondary-orange);
    background: linear-gradient(270deg, var(--white), var(--secondary-orange));
    background-size: 400% 400%;
    animation: gradientAnimationNum 2s ease infinite;
}

#loading-steps .step:last-child .stepLink {
    display: none;
}

@keyframes gradientAnimation {
    0% {
        background-position: 0% 50%;
        color: var(--secondary-orange);
    }

    50% {
        background-position: 100% 50%;
        color: var(--bg-color);
    }

    100% {
        background-position: 0% 50%;
        color: var(--secondary-orange);
    }
}

@keyframes gradientAnimationNum {
    0% {
        background-position: 0% 50%;
        color: var(--bg-color);
    }

    50% {
        background-position: 100% 50%;
        color: var(--secondary-orange);
    }

    100% {
        background-position: 0% 50%;
        color: var(--bg-color);
    }
}

#pdf-embed {
    height: 100%;
    width: 100%;
}

/******************************************************
    History
******************************************************/

.delete-session {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    text-align: center;
    line-height: 30px;
    border-radius: 10px;
    text-decoration: none;
    border: 2px solid var(--white);
}

.delete-session:hover {
    border: 2px solid var(--primary-orange);
}

.session-item {
    background-color: var(--white);
    border-radius: 10px;
    border: 1px solid var(--navbar-color);
    padding: 10px;
    margin-bottom: 10px;
    margin-right: 20%;
    padding: 1rem 3rem;
}

.session-item uuid {
    font-family: monospace;
    font-weight: bold;
    font-size: 0.8rem;
    color: var(--secondary-gray);
    background-color: var(--navbar-soft);
    border: 1px solid var(--navbar-color);
    padding: 5px 15px;
    border-radius: 15px;
}

.session-item .status {
    font-family: monospace;
    font-weight: bold;
    font-size: 0.8rem;
    padding: 5px 15px;
    border-radius: 15px;
    color: var(--secondary-gray);
    background-color: var(--navbar-soft);
    border: 1px solid var(--navbar-color);
}

.session-item .status:hover span::after {
    position: absolute;
    bottom: 25%;
    transform: translate(-50%, -50%);
    background-color: var(--primary-gray);
    padding: 5px;
    border-radius: 5px;
    font-family: var(--font-monospace);
    font-size: 0.8rem;
    color: var(--bg-color);
    z-index: 3;
}

.session-item .status.EXIT_ERROR {
    color: var(--primary-orange);
    background-color: var(--secondary-orange);
    border: 1px solid var(--primary-orange);
}

.session-item .status.EXIT_ERROR:hover span::after {
    content: 'Error en la generación';
}

.session-item .status.DONE {
    color: var(--primary-green);
    background-color: var(--secondary-green);
    border: 1px solid var(--primary-green);
}

.session-item .status.DONE:hover span::after {
    content: 'Finalizado con éxito';
}

#recomendacion-text {
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 0 5px var(--shadow);
    width: 70%;
    background-color: var(--white);
    text-align: center;
    color: var(--primary-gray);
}

#malicious-input-text {
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 0 5px var(--shadow);
    width: 70%;
    background-color: var(--secondary-red);
    text-align: center;
    color: var(--primary-gray);
}

#malicious-input-text a {
    color: var(--bg-color) !important;
}

.empty-img {
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    width: 20vw;
    height: 20vw;
}

.session-item p.history-datetime {
    position: absolute;
    bottom: -20%;
    right: -2%;
    font-weight: bold;
    font-size: 0.8rem;
    color: var(--secondary-gray);
    padding: 5px 15px;
    border-radius: 5px;
}

/******************************************************
    User profile
******************************************************/

.userinfo-table {
    display: flex;
    flex-direction: column;
    gap: 10px;
    border: 1px solid var(--navbar-color);
    border-radius: 10px;
    padding: 10px;
    background-color: var(--white);
}

.userinfo-table label {
    font-weight: bold;
    color: var(--secondary-gray);
}

.userinfo-table label.important {
    color: var(--secondary-orange);
}

.userinfo-table value {
    font-weight: 400;
    color: var(--primary-gray);
    border: 1px solid var(--navbar-color);
    border-radius: 10px;
    padding: 5px 20px;
    float: right;
}

.userinfo-table value.uuid {
    font-family: monospace;
    font-weight: bold;
    color: var(--secondary-gray);
    background-color: var(--navbar-soft);
}

/******************************************************
    Admin monitor
******************************************************/
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--navbar-color);
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: var(--white);
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--primary-orange);
}

input:checked+.slider:before {
    transform: translateX(26px);
}
