
/* Reset and base styles */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

.container {
	max-width: 800px;
	margin: 0 auto;
	border-radius: 20px;
	box-shadow: 0 20px 40px rgba(0,0,0,0.1);
overflow: hidden;
}

.calculator-section {
	padding: 10px;
	max-width: 350px;
	margin: 0 auto;
}


.input-group {
	margin-bottom: 30px;
	max-width: 300px;
	margin: 0 auto;
}

.input-group label {
	display: block;
	font-weight: 600;
	color: #495057;
	margin-bottom: 8px;
	font-size: 1.1rem;
}

.modern-input {
	width: 100%;
	padding: 15px 20px;
	border: 2px solid #e9ecef;
	border-radius: 12px;
	font-size: 1.1rem;
	transition: all 0.3s ease;
	background: white;
}

.modern-input:focus {
	outline: none;
	border-color: #667eea;
	box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.division-symbol {
	text-align: center;
	font-size: 2.5rem;
	color: #667eea;
	margin: 2px 0;
	font-weight: bold;
}

.controls-section {
	display: flex;
	flex-wrap: wrap;
	gap: 3px;
	align-items: center;
	justify-content: center;
	margin: 30px 0;
}

.variable-select {
	padding: 12px 20px;
	border: 2px solid #e9ecef;
	border-radius: 12px;
	font-size: 1rem;
	background: white;
	cursor: pointer;
	transition: all 0.3s ease;
	display: block;
}

.variable-select:focus {
	outline: none;
	border-color: #667eea;
}

.calculate-btn {
	background: #00ae34;
	color: white;
	border: none;
	height: 52px;
	/*! padding: 0 20px; */
	border-radius: 12px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.3s ease;
	box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
	width: 170px;
}

.calculate-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.calculate-btn:active {
	transform: translateY(0);
}

/* Modal styles */
.modal {
	display: none;
	position: fixed;
	z-index: 1000;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.5);
	backdrop-filter: blur(5px);
}

.modal-content {
	background-color: transparent;
	margin: 5% auto;
	padding: 0;
	border-radius: 20px;
	width: 90%;
	max-width: 800px;
	max-height: 80vh;
	overflow-y: hidden;
	box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
	animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
	from {
		opacity: 0;
		transform: translateY(-50px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.modal-header {
	background: #575757;
	color: white;
	padding: 7px 30px;
	border-radius: 20px 20px 0 0;
	/*! display: flex; */
	justify-content: space-between;
	/*! align-items: center; */
	position: sticky;
	top: 0;
	z-index: 10;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
	/*! text-align: -moz-right; */
	/*! text-align: right; */
	/*! right: 8px; */
}

.modal-title {
	font-size: 1.8rem;
	font-weight: 600;
	margin: 0;
}

.modal-close {
	background: rgba(255, 23, 23, 0.89);
	color: white;
	border: none;
	/* padding: 2px 15px 0; */
	border-radius: 50%;
	cursor: pointer;
	font-size: 1.7rem;
	/*! transition: all 0.3s ease; */
	width: 40px;
	height: 40px;
	display: flex;
	/*! align-items: center; */
	justify-content: center;
	/*! float: right; */
}

.modal-close:hover {
	background: rgba(255, 255, 255, 0.3);
	transform: scale(1.1);
}

.modal-body {
	padding: 20px;
	height: 70vh;
	overflow-y: auto;
	background: #1c1c1c;
}

.result-item {
	margin-bottom: 8px;
	padding: 8px 12px;
	background: rgb(28, 28, 28);
	/*! border-radius: 6px; */
	/*! width: max-content; */
	margin: 0 auto;
	/*! border-bottom: 1px solid black; */
}

.result-label {
	font-weight: 600;
	color: #e1e1e1;
	margin-bottom: 4px;
	font-size: 0.95rem;
	text-align: center;
}

.result-content {
	font-size: 1.1rem;
	color: #212529;
	display: inline;
}



/* Responsive design */
@media (max-width: 768px) {
	body {
		padding: 10px;
	}
	
	
	.controls-section {
		/* flex-direction: column; */
		/* align-items: stretch; */
	}
	
	.calculate-btn {
		/* width: 100%; */
	}
	
	.modal-content {
		width: 95%;
		margin: 10% auto;
		max-height: 85vh;
	}
	
	.modal-header {
		padding: 20px;
	}
	
	.modal-body {
		padding: 15px;
	}
	
	.result-item {
		margin-bottom: 6px;
		padding: 6px 10px;
	}
	
	.result-label {
		font-size: 0.9rem;
		min-width: 70px;
	}
	
	.result-content {
		font-size: 1rem;
	}
}

/* Legacy styles for compatibility */
hr.vertical {
	width: 1px;
	/* color: #aaa; */
	background:#ac93b1;
	height: 60px;
	border: 1px solid #ac93b1;
	margin: -25px 0 -30px;
}

hr.horizontal {
	/* color: #a075a6; */
	/* margin-left: -12px; */
	/* margin-right: -12px; */
	padding-bottom: 0px;
	height:1px;
	background:#ac93b1;
	border: 1px solid #ac93b1;
	margin: 0 -12px 0;
}

#contenedor_r {
	width: 98%;
	overflow-x: auto;
}

.pc-output-value {
	/*! margin: 6px auto; */
	padding: 8px;
	/*! background: #f8f9fa; */
	border-radius: 6px;
	font-size: 0.9rem;
	color: #45e5ff;
}

.pc-output-value.l9 {
	font-size: 0.85rem;
	padding: 6px;
}

/* Estilos para la tabla de procedimiento */
#dialogv_formulario_result table tr:last-child td {
	color: #a8b8ff !important;
}

#dialogv_formulario_result table tr:last-child td:last-child {
	color: #ff9c91 !important;
}

/* Alternativa más específica para la tabla de división sintética */
#dialogv_formulario_result .l9 tr:last-child td {
	color: #a8b8ff !important;
}

#dialogv_formulario_result .l9 tr:last-child td:last-child {
	color: #ff9c91 !important;
}

#random_polynomials_btn{font-size: 41px !important;background: #0000 !important;width: fit-content;padding: 0;box-shadow: none;/* margin-top: -5px; */}

/* Loading spinner styles */
.loading-spinner {
	display: inline-block;
	width: 16px;
	height: 16px;
	border: 2px solid #ffffff;
	border-top: 2px solid transparent;
	border-radius: 50%;
	animation: spin 1s linear infinite;
	margin-right: 8px;
}

@keyframes spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

/* System classes (required for calculator functionality) */
.class05, .class06, .class09, .v8, .x8, .v2, .pc-precision, .y8, .h6, .v6, .k6, .j6, .q6, .p6, .r6, .n6, .o6, .j0, .n4, .x, .e4, .c4, .b2, .pc-calc-footer, .ba, .u8 {
	/* These classes are used by the calculator system */
}

.pc-output-value {
	/* Output value styling */
}

.l9 {
	/* Table styling for procedure */
}

/* Responsive design */
@media (max-width: 768px) {
	.container {
		margin: 10px;
		border-radius: 15px;
	}
	
	.calculator-section {
		padding: 15px;
	}
	
	.modal-content {
		width: 95%;
		margin: 5% auto;
	}
	
	.controls-section {
		/* flex-direction: column; */
		/* gap: 10px; */
	}
	
	.calculate-btn {
		/* width: 100%; */
		/* max-width: 200px; */
	}
}

/* Specific element styling */
#dialogv_formulario_numerator,
#dialogv_formulario_divisor {
	display: none;
}

#dialogv_formulario_loading {
	display: none;
}

.class05.class06,
.v8 {
	display: none;
}

#dialogv_formulario_preciso_p {
	display: none;
	position: relative;
}

#enunciado {
	color: #b8c0e4;
	font-size: 1.1rem;
}

#resultado_f {
	color: #7eff9c;
	font-size: 1.1rem;
}

#quotient_compact {
	color: #a8b8ff;
	font-size: 1.1rem;
}

#remainder_compact {
	color: #ff9c91;
	font-size: 1.1rem;
}

#dialogv_formulario_quotient,
#dialogv_formulario_remainder {
	display: none;
}

/* Random polynomial button specific styling */
#random_polynomials_btn {
	font-size: 35px !important;
	/* background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important; */
	margin-right: 10px;
	width: fit-content;
	padding: 0;
	box-shadow: none;
	/* margin-top: -5px; */
	height: 52px;
	display: flex;
	align-items: center;
}

/* Table styling for procedure */
#dialogv_formulario_result table tr:last-child td {
	color: #a8b8ff !important;
}

#dialogv_formulario_result table tr:last-child td:last-child {
	color: #ff9c91 !important;
}

#dialogv_formulario_result .l9 tr:last-child td {
	color: #a8b8ff !important;
}

#dialogv_formulario_result .l9 tr:last-child td:last-child {
	color: #ff9c91 !important;
}

.l9 td{padding: 2px 8px;}
.l9{margin: 0 auto;}


/* Estilos para el modal de alerta compacto */
.alert-modal {
	display: none;
	position: fixed;
	z-index: 2000;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.3);
	backdrop-filter: blur(2px);
}

.alert-content {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
	border-radius: 12px;
	padding: 20px;
	min-width: 320px;
	max-width: 400px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
	border: 1px solid #e9ecef;
	display: flex;
	align-items: center;
	gap: 15px;
	animation: alertSlideIn 0.3s ease-out;
}

@keyframes alertSlideIn {
	from {
		opacity: 0;
		transform: translate(-50%, -60%);
	}
	to {
		opacity: 1;
		transform: translate(-50%, -50%);
	}
}

.alert-icon {
	font-size: 24px;
	flex-shrink: 0;
}

.alert-text {
	flex: 1;
}

.alert-title {
	font-size: 16px;
	font-weight: 600;
	color: #495057;
	margin-bottom: 4px;
}

.alert-message {
	font-size: 14px;
	color: #6c757d;
	line-height: 1.4;
}

.alert-close {
	background: none;
	border: none;
	color: #6c757d;
	font-size: 20px;
	font-weight: bold;
	cursor: pointer;
	padding: 0;
	width: 24px;
	height: 24px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	transition: all 0.2s ease;
	flex-shrink: 0;
}

.alert-close:hover {
	background-color: #f8f9fa;
	color: #495057;
	transform: scale(1.1);
}

/* Variantes de alerta */
.alert-modal.warning .alert-icon {
	color: #ffc107;
}

.alert-modal.error .alert-icon {
	color: #dc3545;
}

.alert-modal.success .alert-icon {
	color: #28a745;
}

.alert-modal.info .alert-icon {
	color: #17a2b8;
}
