/**
 * Estilos globales para la aplicación.
 * Define variables CSS personalizadas y estilos para elementos comunes.
 * 
 * Archivo: /c:/xampp/htdocs/mantenimiento/public/css/styles.css
 */
/* GLOBAL */
:root {
	--primary-color: #3498db;
	--secondary-color: #2c3e50;
	--success-color: #2ecc71;
	--info-color: #3498db;
	--warning-color: #f1c40f;
	--danger-color: #e74c3c;
	--light-color: #ecf0f1;
	--dark-color: #34495e;
}

* {
	box-sizing: border-box;
}

body,
p {
	margin: 0;
}

html {
	height: 100vh;
	overflow: hidden;
}

body {
	height: 100%;
	display: flex;
	flex-direction: column;
	font-family: "Open Sans", sans-serif;
	font-weight: 400;
	font-size: 16px;
	background-color: #3498db;
	background-image: linear-gradient(0, #3498db 0%, #2ecc71 100%);
}

/* HEADER */

header {
	position: relative;
	height: 80px;
	box-shadow: 0px 5px 5px var;
	color: var(--secondary-color);
	background-color: rgba(255, 255, 255, 0.5);
	backdrop-filter: blur(2px);
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 0 15px;
}

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

.nav__link {
	color: var(--dark-color);
	text-decoration: none;
	padding: 10px 15px;
	border-radius: 3px;
	transition: background-color 0.3s ease-in-out;
	font-weight: bold;
	margin-right: 15px;
}

.nav__link--logout {
	background-color: var(--danger-color) !important;
	color: var(--light-color) !important;
}

.nav__link:hover {
	background-color: var(--secondary-color);
	color: var(--light-color);
}

.nav__link:active {
	background-color: var(--primary-color);
}

.nav__info {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	margin-right: auto;
	margin-left: 15px;
}

.logo__link {
	display: inline-block;
	height: 100%;
}

.logo__image {
	height: 100%;
	object-fit: contain;
	margin-right: 15px;
}

.logo--form {
	display: flex;
	justify-content: center;
	align-items: center;
	height: 80px;
}

.logo--form img {
	height: 100%;
	object-fit: contain;
}

.nav__links {
	display: flex;
	align-items: center;
	margin-right: 15px;
}

.nav__links a {
	margin-left: 15px;
}

h1 {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	font-size: 28px;
	font-weight: 600;
	text-align: center;
	margin: 0 auto;
}

/* LAYOUT */

main {
	height: 100%;
	overflow-y: auto;
	padding: 0 15px;
}

section {
	display: flex;
	flex-direction: column;
	align-items: center;
}

.section--dashboard,
.section--login {
	margin: 0;
}

.section--dashboard {
	height: auto;
}

.section--login {
	justify-content: center;
}

footer {
	display: flex;
	flex-direction: column;
	align-items: center;
	font-size: 14px;
	padding: 15px 0;
	background-color: var(--primary-color);
	color: var(--light-color);
}

.footer__logo {
	height: 50px;
	object-fit: contain;
	margin-bottom: 10px;
}

.footer__links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	margin-bottom: 10px;
}

.footer__links a {
	color: var(--light-color);
	margin: 0 10px;
	text-decoration: none;
}

.footer__links a:hover {
	text-decoration: underline;
}

.footer__copy {
	margin-top: auto;
	font-size: 12px;
	text-align: center;
}

/* FORMS */

form {
	padding: 35px 40px;
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	background-color: var(--light-color);
	border: 2px solid var(--primary-color);
	border-radius: 8px;
	box-shadow: 0px 5px 5px var(--dark-color);
	margin: 20px 0;
	max-width: 440px;
}

form h3 {
	margin-bottom: 40px;
	color: var(--secondary-color);
}

form label {
	align-self: flex-start;
	margin-bottom: 10px;
	font-size: 16px;
	font-weight: 600;
	color: var(--dark-color);
}

form input,
form select,
form textarea {
	height: 50px;
	width: 100%;
	padding: 10px;
	margin-bottom: 20px;
	border: none;
	border-radius: 5px;
	background-color: #f5f5f5;
	font-size: 16px;
	color: #333;
}

form input:focus,
form select:focus,
form textarea:focus {
	outline: none;
	background-color: #fff;
	box-shadow: 0px 0px 5px #c2c2c2;
}

form select option {
	background-color: var(--light-color);
	color: var(--dark-color);
	font-size: 16px;
}

form textarea {
	height: 100px;
}

form button[type="submit"] {
	height: 50px;
	width: 100%;
	border: none;
	border-radius: 5px;
	background-color: var(--primary-color);
	color: var(--light-color);
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.3s ease-in-out;
}

form button[type="submit"]:hover {
	background-color: var(--secondary-color);
}

form button[type="submit"]:active {
	background-color: var(--primary-color);
}
form:invalid button[type="submit"] {
	opacity: 0.6;
	pointer-events: none;
	cursor: default;
}

form.form--filters {
	margin-top: 20px;
	width: 100%;
	flex-direction: row;
	justify-content: space-between;
	padding: 10px;
	max-width: 100%;
}

form.form--filters input,
form.form--filters select {
	width: 100%;
	margin-right: 20px;
	margin-bottom: 0;
}

form select:focus {
	outline: none;
	background-color: #fff;
	box-shadow: 0px 0px 5px #c2c2c2;
}

.form__image {
	width: 100%;
	max-height: 240px;
	object-fit: cover;
	margin-bottom: 20px;
	cursor: pointer;
}

.form__state {
	width: 100%;
	margin-bottom: 20px;
	border: none !important;
	padding: 10px;
}

/* TABLES */

table {
	border-collapse: collapse;
	width: 100%;
	margin-top: 20px;
	background-color: var(--light-color);
}

th,
td {
	padding: 8px;
	text-align: center;
}

th {
	background-color: var(--primary-color);
	color: var(--light-color);
	border-left: 1px solid var(--light-color);
	border-right: 1px solid var(--light-color);
	font-weight: 500;
}

tr {
	cursor: pointer;
}

tr:nth-child(even) {
	background-color: #e7e7e7;
}

tr:hover {
	background-color: var(--secondary-color);
	color: var(--light-color);
}

/* PAGINATION */

.pagination {
	margin: 20px 0;
	width: 100%;
	text-align: center;
}

.pagination__link {
	background-color: var(--secondary-color);
	color: white;
	margin: 0 10px;
	padding: 10px 20px;
	text-decoration: none;
	transition: background-color 0.3s ease-in-out;
}

.pagination__link:hover,
.pagination__link.active {
	background-color: var(--success-color);
}

.pagination__link.active {
	background-color: var(--success-color);
	color: white;
}

/* ALERTS */
.error {
	background-color: var(--danger-color);
	color: #fff;
	border-radius: 5px;
	margin-top: 10px;
	position: relative;
	padding: 20px;
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: space-between;
}

.error__close {
	cursor: pointer;
	width: 20px;
	height: 20px;
	display: flex;
	justify-content: center;
	align-items: center;
	font-weight: bold;
	color: white;
	font-size: 16px;
	text-decoration: none;
	margin-left: 10px;
}

/* MEDIA QUERIES */

@media (max-width: 767px) {
	nav {
		flex-direction: column;
	}

	.nav__link {
		display: block;
		width: 100%;
		margin: 0;
		text-align: center;
		background-color: var(--secondary-color);
		color: var(--light-color);
		border-radius: 0;
		border-top: 1px solid var(--light-color);
	}

    .pagination {
		display: flex;
        justify-content: center;
		flex-wrap: wrap;
        margin-top: 20px;
        width: 100%;
    }

    .pagination__link {
        margin:5px;
    }
}

@media screen and (min-width: 768px) {
	form input {
		min-width: 280px;
	}
}

@media screen and (max-width: 1239px) {
	header {
		flex-direction: column;
		justify-content: center;
		height: auto;
	}

	.header--main {
		padding: 0;
	}

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

	.nav__info {
		margin-left: 0;
		margin-top: 15px;
		align-items: center;
		width: 100%;
	}

	.logo__image {
		margin-right: 0;
		margin-bottom: 15px;
		height: auto;
		width: 100%;
		max-width: 120px;
	}

	.logo--form {
		display: none;
	}

	h1 {
		position: relative;
		margin-bottom: 10px;
		width: 100%;
		transform: none;
		left: auto;
		top: auto;
	}

	form.form--filters {
		flex-direction: column;
	}

	form.form--filters label {
		margin-bottom: 5px;
	}

	form.form--filters input,
	form.form--filters select {
		margin-right: 0px;
		width: 100%;
		margin-bottom: 10px;
	}

	form.form--filters button[type="submit"] {
		margin-top: 10px;
	}

	table,
	thead,
	tbody,
	td,
	tr {
		display: block;
	}

	th {
		display: none;
	}

	td {
		display: flex;
		justify-content: space-between;
		border-bottom: 1px solid var(--secondary-color);
		text-align: right;
	}

	td:first-child {
		background-color: var(--secondary-color);
		color: var(--light-color);
	}

	.td--empty {
		justify-content: center;
	}

	td::before {
		content: attr(data-label);
		float: right;
		font-weight: bold;
		text-align: left;
	}
}

@media screen and (min-width: 1240px) {
	.status.warning {
		background-color: var(--warning-color);
		color: var(--secondary-color);
		border-top: 1px solid var(--secondary-color);
		border-bottom: 1px solid var(--secondary-color);
		font-weight: 600;
	}

	.status.success {
		background-color: var(--success-color);
		color: var(--secondary-color);
		border-top: 1px solid var(--secondary-color);
		border-bottom: 1px solid var(--secondary-color);
		font-weight: 600;
	}

	.status.danger {
		background-color: var(--danger-color);
		color: var(--light-color);
		border-top: 1px solid var(--secondary-color);
		border-bottom: 1px solid var(--secondary-color);
		font-weight: 600;
	}
}
