/* Fuente */

@font-face {
    font-family: Mulish;
    src: url(../ttf/Mulish-VariableFont_wght.ttf);
}

@font-face {
    font-family: Mulish;
    font-style: italic;
    src: url(../ttf/Mulish-Italic-VariableFont_wght.ttf);
}

/* Cuerpo */

body {
    height: 100vh;
    background-image: url(../img/background.jpg);
    background-color: var(--body-background);
    background-size: cover;
    background-position: center;
    background-blend-mode: multiply;
    padding: 0 0 0 0;
    margin: 0 0 0 0;
    font-family: Mulish, Arial, Helvetica, sans-serif;
}

#cabecera, #pie {
    position: fixed;
    width: 100%;
    max-width: 1024px;
    padding: 0 calc((100vw - 1024px) / 2) 0 calc((100vw - 1024px) / 2);
    height: 48px;
    background-color: var(--header-background);
    backdrop-filter: blur(2px);
    color: var(--header-color);
    box-shadow: 0px 0px 16px black;
}

#contenido {
    padding: 64px calc((100vw - 1024px) / 2) 64px calc((100vw - 1024px) / 2);
    color: var(--text-color);
}

#pie {
    text-align: center;
    bottom: 0;
}

/* Miscelaneo */

hr {
    margin: 3px 0 3px 0;
    opacity: 0;
    /* Por alguna razón sin esto se oculta el menú */
    display: table;
}

/* Menu */

#menu_izquierdo, #menu_derecho {
    height: 100%;
    width: fit-content;
    display: inline-flex;
}

#menu_derecho {
    float: right;
}

#cabecera a {
    display: inline-flex;
    height: 100%;
    align-items: center;
    font-weight: bold;
    text-decoration: none;
    padding: 0 1em 0 1em;
}

#cabecera a h5 {
    display: none;
}

#cabecera a:hover h5, #cabecera a:active h5 {
    display: inline;
}

#cabecera a:hover, #cabecera a:active {
    background-color: var(--header-hover-background);
    cursor: pointer;
}

#cabecera a.not-implemented {
    background-color: var(--header-not-implemented-background);
}

#cabecera a.not-implemented:hover, #cabecera a.not-implemented:active {
    background-color: var(--header-not-implemented-hover-background);
}

#cabecera a img {
    filter: invert();
    height: 32px;
}

/* Pié de página */

#pie * {
    display: grid;
    height: 100%;
    align-items: center;
    margin: 0;
    padding: 0;
}

/* Cajas */

.box {
    background: var(--box-background);
    margin: auto;
    border-radius: 6px;
    box-shadow: 0px 0px 16px var(--hr-color);
}

.box .box {
    background: var(--table-row-even);
    box-shadow: none;
}

.box h2, .box h3 {
    padding: 4px 4px 4px 4px;
    margin: 0 0 0 0;
    text-align: center;
    background-color: var(--box-header-background);
    border-radius: 6px;
}

.box h4, .box h5 {
    padding: 4px 4px 4px 4px;
    margin: 0 0 0 0;
    background-color: var(--box-header-background);
    border-radius: 6px;
}

.box p {
    padding: 4px 4px 4px 4px;
    margin: 0 0 0 0;
}

.box p.margin-left {
    margin-left: 16px;
}

.box-content {
    padding: 16px;
}

.box-content.middle * {
    position: relative;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.box-content.overflow {
    overflow: auto
}

.box-input {
    padding: 0 0 0 0;
    margin: 0 0 0 0;
    border: 0;
    height: 24px;
    font-family: Mulish, Arial, Helvetica, sans-serif;
    font-weight: bold;
    border-radius: 6px;
}

.box-button {
    display: inline-block;
    padding: 4px 4px 4px 4px;
    border: 0;
    height: 24px;
    font-family: Mulish, Arial, Helvetica, sans-serif;
    font-weight: bold;
    background-color: var(--button-background);
    color: var(--opposite-text-color);
    cursor: pointer;
    border-radius: 6px;
}

.box-button:disabled {
    opacity: 0.3;
}

.box-content .wide {
    width: 100%;
}

.box-content .center {
    margin: auto;
    display: block;
}

.box-button:hover, .box-button:active {
    background-color: var(--button-hover-background);
}

.box-button.red {
    background-color: var(--box-button-red);
}

.box-button.red:hover, .box-button.red:active {
    background-color: var(--box-button-red-hover);
}

.box-content br {
    height: 16px;
}

.box.large {
    width: 100%;
}

.box.medium {
    width: 600px;
}

.box.small {
    width: 400px;
}

.box.centered {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.box .align-left {
    text-align: left;
}

.box .align-center {
    text-align: center;
}

.box .align-right {
    text-align: right;
}

.box .float-left {
    float: left;
}

.box .float-right {
    float: right;
}

.box .inline-block {
    display: inline-block;
}

.box .inline-grid {
    display: inline-grid;
}

.box .hidden {
    display: none;
}

/* Tablas */

.box-table {
    width: 100%;
    text-align: center;
    border-spacing: 0;
}

.box-table thead, .box-table tfoot {
    background: var(--box-header-background);
}

.box-table tr {
    height: 32px;
}

.box-table td {
    padding: 6px 0 6px 0;
}

.box-table.huge th {
    font-size: 14px;
}

.box-table.huge td {
    font-size: 12px;
    font-weight: bold;
}

/* Filas pares */
.box-table tr:nth-child(even) {
    background: var(--table-row-even);
}

/* Filas impares */
.box-table tr:nth-child(odd) {
    background: var(--table-row-odd);
}

.box-table tr.green {
    background: var(--table-row-green);
}

.box-table tr.red {
    background: var(--table-row-red);
}

/* Botones de tabla */

.table-button {
    width: 24px;
    height: 24px;
    margin: 0 2px 0 2px;
    vertical-align: middle;
    border-radius: 50%;
    border: 0;
    cursor: pointer;
    background-size: 80% !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    box-shadow: 3px 3px 2px var(--hr-color);
}

.table-button.small {
    width: 20px;
    height: 20px;
    margin-top: -2px;
}

.table-button:hover, .table-button:active {
    opacity: 0.7;
}

.table-button:disabled {
    opacity: 0.3 !important;
    cursor: not-allowed;
}

.table-button.green {
    background: var(--table-button-green);
}

.table-button.yellow {
    background: var(--table-button-yellow);
}

.table-button.red {
    background: var(--table-button-red);
}

.table-button.pencil {
    background-image: url(../img/pencil.svg);
}

.table-button.role {
    background-image: url(../img/role.svg)
}

.table-button.content {
    background-image: url(../img/content.svg);
}

.table-button.trash {
    background-image: url(../img/trash.svg);
}

.table-button.cancel {
    background-image: url(../img/cancel.svg);
}

.table-button.save {
    background-image: url(../img/save.svg);
}

.table-button.password {
    background-image: url(../img/password.svg);
}

.table-button.goto {
    background-image: url(../img/goto.svg);
}

.table-button.check {
    background-image: url(../img/check.svg);
}

.table-button.next {
    background-image: url(../img/next.svg);
}

.table-button.prev {
    background-image: url(../img/prev.svg);
}

.table-button.first {
    background-image: url(../img/first.svg);
}

.table-button.last {
    background-image: url(../img/last.svg);
}

/* Input de tabla */

.table-input {
    background: transparent;
    font-family: Mulish, Arial, Helvetica, sans-serif;
    font-weight: bold;
    color: var(--text-color);
    border: none;
    border-bottom: 2px solid var(--text-color);
}

.box-table .table-input {
    width: 90%;
    text-align: center;
}

.table-input option {
    color: var(--hr-color);
}

.table-input:disabled {
    font-weight: normal;
    border-bottom: none;
}

select.table-input:disabled {
    appearance: none;
}

/* Mensaje de error de inicio de sesión */

#login_error {
    float: right;
    line-height: 24px;
    font-weight: bold;
    color: var(--login-error-color);
}

/* Popup de error */

.error-popup {
    background: var(--error-popup-red);
    width: fit-content;
    padding: 10px;
    position: fixed;
    right: 20px;
    top: 68px;
    color: var(--error-popup-text);
    font-weight: bold;
    border-radius: 6px;
    opacity: 0;
    visibility: hidden;
    animation: fadeOut 4s ease-in-out;
}

.error-popup.green {
    background: var(--error-popup-green);
}

.error-popup button {
    padding: 0;
    margin-left: 10px;
    background: transparent;
    border: 0;
    color: var(--text-color);
    opacity: 0.5;
    cursor: pointer;
}

@keyframes fadeOut {
    0% {
        opacity: 1;
        visibility: visible;
    }

    50% {
        opacity: 1;
        visibility: visible;
    }

    100% {
        opacity: 0;
        visibility: hidden;
    }
}

/* Listado de permisos */

.permission-mod-check {
    float: right;
    width: 18px;
    height: 18px;
    margin-top: 1px;
}

/* Pestañas */

.tab {
    overflow: hidden;
}

.tab button {
    background-color: inherit;
    float: left;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 8px 16px;
    color: var(--text-color);
    font-weight: bold;
    font-family: Mulish, Arial, Helvetica, sans-serif;
}

.tab button:hover {
    background-color: var(--table-row-even);
}
  
.tab button.active {
    background-color: var(--box-header-background);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: revert;
}

/* Nombre de campo con campo al lado */

.label {
    width: 20%;
    display: inline-block;
}

.label.long {
    width: 40%;
}

.label .required-field {
    color: var(--required-field-color);
}

/* Menu dropdown */

.dropdown-content {
    transition: visibility 0.1s, opacity 0.1s ease;
    visibility: hidden;
	opacity: 0;
    box-shadow: 0px 0px 4px var(--hr-color);
    backdrop-filter: blur(4px);
    position: absolute;
}

.dropdown-content a {
    display: block !important;
    height: 28px !important;
    line-height: 28px;
    text-align: center;
    background: var(--header-background);
    font-weight: normal !important;
    font-size: 14px;
}

.dropdown:hover .dropdown-content {
	visibility: visible;
	opacity: 1;
}

.dropdown:hover > a {
    background: var(--header-hover-background);
}

/* Texto parpadeante */

.blink {
    animation: blink-text 2s;
    animation-iteration-count: infinite;
}

@keyframes blink-text {
    0% {
        opacity: 0.9;
    }
    50% {
        opacity: 0;
    }
    55% {
        opacity: 1;
    }
    100% {
        opacity: 0.9;
    }
}

/* Popup de extender sesión */

.emergency {
    position: absolute;
    z-index: 2;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    backdrop-filter: blur(10px);
}

.emergency .box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.home_button {
    padding: 20px;
    margin: 4px;
    font-weight: 900;
    font-size: large;
    border: 2px solid;
    border-radius: 50px;
    background-color: var(--header-background);
    cursor: pointer;
    color: white;
    box-shadow: 4px 4px 4px #0007;
}

.home_button:hover {
    background-color: var(--header-hover-background);
}